Skip to content

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Sep 3, 2025

Towards https://github.com/elastic/response-ops-team/issues/297

Summary

Updates the grouping for task manager per task type metrics to categorize ad_hoc_run-backfill task types under the alerting grouping.

To Verify

  1. Start ES and Kibana
  2. Create a detection rule
  3. Manually schedule a backfill for the detection rule
  4. Navigate to the task manager metrics endpoint(https://localhost:5601/api/task_manager/metrics?reset=false) and verify that the success counter for alerting (under metrics.task_run.value.by_type.alerting) is incremented, as well as the success counter for ad_hoc_run-backfill (under metrics.task_run.value.by_type.ad_hoc_run-backfill). (The counters reset every 30 seconds so you will have to look at this endpoint quickly after scheduling the backfill).

@ymao1
Copy link
Contributor Author

ymao1 commented Sep 18, 2025

@elasticmachine merge upstream

@ymao1
Copy link
Contributor Author

ymao1 commented Sep 19, 2025

@elasticmachine merge upstream

@ymao1 ymao1 changed the title Grouping ad hoc runs under alerting metrics [Response Ops][Alerting] Grouping ad hoc run metrics under alerting metrics Sep 19, 2025
@ymao1 ymao1 self-assigned this Sep 19, 2025
@ymao1 ymao1 added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.0 labels Sep 19, 2025
@ymao1 ymao1 marked this pull request as ready for review September 19, 2025 19:37
@ymao1 ymao1 requested a review from a team as a code owner September 19, 2025 19:37
@elasticmachine
Copy link
Contributor

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


export function getTaskTypeGroup(taskType: string): string | undefined {
// we want to group ad hoc runs under alerting
if (taskType === 'ad_hoc_run-backfill') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Using BACKFILL_TASK_TYPE const from the alerting plugin could be better.

Copy link
Contributor

@ersin-erdal ersin-erdal left a comment

Choose a reason for hiding this comment

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

LGTM

Tested locally and observed the expected results.

"alerting":{"success":1,"not_timed_out":1,"total":1,"total_errors":0,"rescheduled_failures":0,"user_errors":0,"framework_errors":0},"ad_hoc_run-backfill":{"success":1,"not_timed_out":1,"total":1,"total_errors":0,"rescheduled_failures":0,"user_errors":0,"framework_errors":0}

Just left a nit.

@ymao1
Copy link
Contributor Author

ymao1 commented Sep 22, 2025

@elasticmachine merge upstream

@ymao1 ymao1 enabled auto-merge (squash) September 22, 2025 17:33
@ymao1 ymao1 merged commit b4bec7e into elastic:main Sep 22, 2025
12 checks passed
@ymao1 ymao1 deleted the backfill-metrics branch September 22, 2025 19:24
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @ymao1

CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
…etrics (elastic#233875)

Towards elastic/response-ops-team#297

## Summary

Updates the grouping for task manager per task type metrics to
categorize `ad_hoc_run-backfill` task types under the `alerting`
grouping.

## To Verify

1. Start ES and Kibana
2. Create a detection rule
3. Manually schedule a backfill for the detection rule
4. Navigate to the task manager metrics
endpoint(https://localhost:5601/api/task_manager/metrics?reset=false)
and verify that the success counter for `alerting` (under
`metrics.task_run.value.by_type.alerting`) is incremented, as well as
the success counter for `ad_hoc_run-backfill` (under
`metrics.task_run.value.by_type.ad_hoc_run-backfill`). (The counters
reset every 30 seconds so you will have to look at this endpoint quickly
after scheduling the backfill).

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
niros1 pushed a commit that referenced this pull request Sep 30, 2025
…etrics (#233875)

Towards elastic/response-ops-team#297

## Summary

Updates the grouping for task manager per task type metrics to
categorize `ad_hoc_run-backfill` task types under the `alerting`
grouping.

## To Verify

1. Start ES and Kibana
2. Create a detection rule
3. Manually schedule a backfill for the detection rule
4. Navigate to the task manager metrics
endpoint(https://localhost:5601/api/task_manager/metrics?reset=false)
and verify that the success counter for `alerting` (under
`metrics.task_run.value.by_type.alerting`) is incremented, as well as
the success counter for `ad_hoc_run-backfill` (under
`metrics.task_run.value.by_type.ad_hoc_run-backfill`). (The counters
reset every 30 seconds so you will have to look at this endpoint quickly
after scheduling the backfill).

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This PR does not require backporting Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants