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

Onboard Latency Threshold rule type with FAAD #179080

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

doakalexi
Copy link
Contributor

@doakalexi doakalexi commented Mar 20, 2024

Towards: #169867

This PR onboards Latency Threshold rule type with FAAD.

To verify

  1. Run the following script to generate APM data:
node scripts/synthtrace simple_trace.ts --local --live
  1. Create a latency threshold rule.
    Example:
POST kbn:/api/alerting/rule
{
  "params": {
    "aggregationType": "avg",
    "environment": "ENVIRONMENT_ALL",
    "threshold": 400,
    "windowSize": 5,
    "windowUnit": "m"
  },
  "consumer": "alerts",
  "schedule": {
    "interval": "1m"
  },
  "tags": [],
  "name": "testinggg",
  "rule_type_id": "apm.transaction_duration",
  "notify_when": "onActionGroupChange",
  "actions": []
}
  1. Your rule should create an alert and should saved it in .internal.alerts-observability.apm.alerts-default-000001
    Example:
GET .internal.alerts-*/_search
  1. Set threshold: 10000

  2. The alert should be recovered and the AAD in the above index should be updated kibana.alert.status: recovered.

@doakalexi doakalexi changed the title Initial commit moving latency threshold to faad Onboard Latency Threshold rule type with FAAD Mar 20, 2024
@doakalexi
Copy link
Contributor Author

/ci

@doakalexi doakalexi added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0 labels Mar 20, 2024
@doakalexi
Copy link
Contributor Author

/ci

@doakalexi doakalexi requested review from a team, ymao1 and js-jankisalvi March 21, 2024 17:32
@doakalexi doakalexi self-assigned this Mar 21, 2024
@doakalexi doakalexi marked this pull request as ready for review March 21, 2024 17:33
@doakalexi doakalexi requested a review from a team as a code owner March 21, 2024 17:33
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@@ -90,6 +90,7 @@ export const ApmRuleTypeAlertDefinition: IRuleTypeAlerts = {
context: APM_RULE_TYPE_ALERT_CONTEXT,
mappings: { fieldMap: apmRuleTypeAlertFieldMap },
useLegacyAlerts: true,
shouldWrite: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

What does shouldWrite mean?

Copy link
Contributor Author

@doakalexi doakalexi Mar 22, 2024

Choose a reason for hiding this comment

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

We added this flag to prevent rules that were registered with both the rule registry and the alerting framework from having both write alerting docs. It will be removed once we move all rules away from the rule registry

Copy link
Contributor

Choose a reason for hiding this comment

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

We should set this to true here and remove the override in x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/transaction_duration/register_transaction_duration_rule_type.ts

Copy link
Contributor Author

@doakalexi doakalexi Mar 22, 2024

Choose a reason for hiding this comment

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

I think we need this until all the APM rules have been onboarded. On the last rule I will make sure to do this. Thanks!

@botelastic botelastic bot added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Mar 22, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, alert documents appear correct, in the expected index, can be updated

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

Verified locally, works as expected 👍 🎉

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM

@doakalexi doakalexi enabled auto-merge (squash) March 26, 2024 14:31
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @doakalexi

@doakalexi doakalexi merged commit a936bf7 into elastic:main Mar 26, 2024
17 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 26, 2024
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:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

8 participants