Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(openapi): rule parameters documentation for observability rules #158676

Merged
merged 13 commits into from Jun 5, 2023

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented May 30, 2023

Resolves https://github.com/elastic/actionable-observability/issues/11

Summary

This PR adds the openAPI documentation for the following observability rules:

  • SLO burn rate rule
  • Infra log threshold
  • Infra inventory
  • Infra metric threshold
  • APM anomaly
  • APM error count
  • APM transaction duration
  • APM transaction error rate
  • Synthetics uptime TLS
  • Synthetics uptime monitor status

@kdelemme kdelemme self-assigned this May 30, 2023
@kdelemme kdelemme added release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.9.0 labels May 30, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@kdelemme kdelemme marked this pull request as ready for review May 31, 2023 13:19
@kdelemme kdelemme requested review from a team as code owners May 31, 2023 13:19
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kdelemme, I have two questions:

  • How can I access these files once Kibana is running?
  • If recall correctly, don't we need the URL in the API definition for each endpoint?

@botelastic botelastic bot added Team:APM All issues that need APM UI Team support Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Jun 1, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apm changes lgtm

@kdelemme
Copy link
Contributor Author

kdelemme commented Jun 1, 2023

@kdelemme, I have two questions:

  • How can I access these files once Kibana is running?
  • If recall correctly, don't we need the URL in the API definition for each endpoint?

@fkanout, you cannot access the output of these files. It's meant to be used by a script to bundle all the rules parameters. The script would search all yaml files starting with a # @kbn-doc-linker partial line.
Therefore, there are no need for the full OpenAPI specification of a regular API, response-ops only need the parameters of the rules.

If you want to check the schema individually, you can paste the content of the yaml file (starting after the first properties:) in this dummy spec into https://editor.swagger.io:

openapi: 3.0.1
info:
  title: dummy
  description: OpenAPI schema
  version: '1.0'
  contact:
    name: Actionable Observability Team
servers:
  - url: http://localhost:5601
    description: local
paths:
  /foo:
    get:
      summary: dummy
      operationId: dummy
      responses:
        '200':
          description: dummy
          content:
            application/json:
              schema:
                properties:
                  <PASTE_HERE>

@jcger
Copy link
Contributor

jcger commented Jun 2, 2023

I did some changes to the script so that it will load the spec using the file name only. Would it be ok for you to change it the root key is removed? x-pack/plugins/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml would look like:

# @kbn-doc-linker partial

required:
  - windowSize
  - windowUnit
  - environment
  - anomalySeverityType
properties:
  serviceName:
    type: string
    description: The service name from APM
  transactionType:
    type: string
    description: The transaction type from APM
  windowSize:
    type: number
    example: 6
    description: The window size
  windowUnit:
    type: string
    description: The window size unit
    enum:
      - "m"
      - "h"
      - "d"
  environment:
    type: string
    description: The environment from APM
  anomalySeverityType:
    type: string
    description: The anomaly threshold value
    enum:
      - critical
      - major
      - minor
      - warning

It's feasible to make it work using the file name only but I'm thinking about leaving the header comment just to make it easier for developers to understand/trace what happens to this file. Any thoughts?

@kdelemme
Copy link
Contributor Author

kdelemme commented Jun 2, 2023

@jcger Done

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 414 418 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 498 502 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kdelemme

Copy link
Contributor

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infra changes LGTM!

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uptime changes LGTM

@kdelemme kdelemme merged commit 8a07e58 into elastic:main Jun 5, 2023
18 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 5, 2023
@kdelemme kdelemme deleted the rules-parameters-openapi branch June 5, 2023 20:36
sloanelybutsurely pushed a commit to sloanelybutsurely/kibana that referenced this pull request Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" Team:APM All issues that need APM UI Team support Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet