Skip to content

Comments

[ResponseOps][Cases] Add timing metrics to cases SO#219070

Merged
cnasikas merged 33 commits intoelastic:mainfrom
umbopepato:217638-cases-so-status-changes-metrics
Jun 20, 2025
Merged

[ResponseOps][Cases] Add timing metrics to cases SO#219070
cnasikas merged 33 commits intoelastic:mainfrom
umbopepato:217638-cases-so-status-changes-metrics

Conversation

@umbopepato
Copy link
Member

@umbopepato umbopepato commented Apr 24, 2025

Summary

  • Adds the in_progress_at timestamp to Cases Saved Objects
  • Adds the time_to_acknowledge, time_to_investigate and time_to_resolve timing metrics to Cases Saved Objects

References

Closes #217638

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@umbopepato umbopepato force-pushed the 217638-cases-so-status-changes-metrics branch from 23491a2 to a80d713 Compare May 6, 2025 14:10
@umbopepato umbopepato added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// backport:version Backport to applied version labels v9.1.0 v8.19.0 labels May 6, 2025
@umbopepato umbopepato marked this pull request as ready for review May 6, 2025 14:14
@umbopepato umbopepato requested review from a team as code owners May 6, 2025 14:14
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8243

[✅] x-pack/test/cases_api_integration/security_and_spaces/config_basic.ts: 50/50 tests passed.

see run history

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Nice work @umbopepato , I focussed review on the new SO additions and left a question I'd like to get your thoughts on before approving 👍🏻

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

LGTM! I left some comments.

) {
if (inProgressAtMillis == null) {
// When a case transitions directly from 'open' to 'closed', set inProgressAt to
// updatedAtMillis to reflect the implicit start of progress
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure about this. I think it is better to omit the calculation and let them be null. So, only newly created cases will be able to have these fields populated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't know how common it is, but you could jump directly from open to closed. If users do this a lot we would lose a lot of metrics in new cases too, are we ok with this?

Copy link
Member

Choose a reason for hiding this comment

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

I thought about it more, and you are right. I changed the code to mark the time_to_acknowledge same as the time_to_resolve and the time_to_investigate to zero if the in_progress_at is not defined.

@cnasikas cnasikas requested a review from a team as a code owner June 18, 2025 19:58
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 18, 2025

💔 Build Failed

Failed CI Steps

History

Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

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

LGTM, left two small comments 👍

clientArgs.services.attachmentService.getter.getCaseCommentStats.mockResolvedValue(new Map());
});

it('calculates metrics correctly', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we have a similar test for the function that calculates in_progress_at?

@cnasikas cnasikas merged commit b0aa031 into elastic:main Jun 20, 2025
11 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15775951233

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 20, 2025
## Summary

- Adds the `in_progress_at` timestamp to Cases Saved Objects
- Adds the `time_to_acknowledge`, `time_to_investigate` and
`time_to_resolve` timing metrics to Cases Saved Objects

## References

Closes elastic#217638

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed (passed ✅)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
(cherry picked from commit b0aa031)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 20, 2025
…224651)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ResponseOps][Cases] Add timing metrics to cases SO
(#219070)](#219070)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"umbopepato@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-20T09:34:37Z","message":"[ResponseOps][Cases]
Add timing metrics to cases SO (#219070)\n\n## Summary\n\n- Adds the
`in_progress_at` timestamp to Cases Saved Objects\n- Adds the
`time_to_acknowledge`, `time_to_investigate` and\n`time_to_resolve`
timing metrics to Cases Saved Objects\n\n## References\n\nCloses
#217638\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed (passed
✅)\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Christos Nasikas <xristosnasikas@gmail.com>\nCo-authored-by: Christos
Nasikas
<christos.nasikas@elastic.co>","sha":"b0aa0319942a7e6b65b97331d46bdf5ed9a5076e","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps][Cases]
Add timing metrics to cases
SO","number":219070,"url":"https://github.com/elastic/kibana/pull/219070","mergeCommit":{"message":"[ResponseOps][Cases]
Add timing metrics to cases SO (#219070)\n\n## Summary\n\n- Adds the
`in_progress_at` timestamp to Cases Saved Objects\n- Adds the
`time_to_acknowledge`, `time_to_investigate` and\n`time_to_resolve`
timing metrics to Cases Saved Objects\n\n## References\n\nCloses
#217638\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed (passed
✅)\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Christos Nasikas <xristosnasikas@gmail.com>\nCo-authored-by: Christos
Nasikas
<christos.nasikas@elastic.co>","sha":"b0aa0319942a7e6b65b97331d46bdf5ed9a5076e"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219070","number":219070,"mergeCommit":{"message":"[ResponseOps][Cases]
Add timing metrics to cases SO (#219070)\n\n## Summary\n\n- Adds the
`in_progress_at` timestamp to Cases Saved Objects\n- Adds the
`time_to_acknowledge`, `time_to_investigate` and\n`time_to_resolve`
timing metrics to Cases Saved Objects\n\n## References\n\nCloses
#217638\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed (passed
✅)\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Christos Nasikas <xristosnasikas@gmail.com>\nCo-authored-by: Christos
Nasikas
<christos.nasikas@elastic.co>","sha":"b0aa0319942a7e6b65b97331d46bdf5ed9a5076e"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request Jun 25, 2025
## Summary

- Adds the `in_progress_at` timestamp to Cases Saved Objects
- Adds the `time_to_acknowledge`, `time_to_investigate` and
`time_to_resolve` timing metrics to Cases Saved Objects

## References

Closes elastic#217638

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed (passed ✅)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ResponseOps][Cases] Track metrics regarding status changes in the cases SO

7 participants