[ResponseOps][Cases] Add timing metrics to cases SO#219070
[ResponseOps][Cases] Add timing metrics to cases SO#219070cnasikas merged 33 commits intoelastic:mainfrom
Conversation
… src/core/server/integration_tests/ci_checks'
…-status-changes-metrics
23491a2 to
a80d713
Compare
|
Pinging @elastic/response-ops (Team:ResponseOps) |
…-status-changes-metrics
…-status-changes-metrics
…-status-changes-metrics
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. |
jloleysens
left a comment
There was a problem hiding this comment.
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 👍🏻
x-pack/platform/plugins/shared/cases/server/saved_object_types/cases/model_versions.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/cases/server/client/cases/utils.ts
Outdated
Show resolved
Hide resolved
...m/plugins/shared/cases/server/saved_object_types/cases/model_versions/model_versions.test.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/cases/common/types/domain/case/v1.ts
Outdated
Show resolved
Hide resolved
x-pack/test/cases_api_integration/security_and_spaces/tests/common/cases/patch_cases.ts
Outdated
Show resolved
Hide resolved
x-pack/test/cases_api_integration/security_and_spaces/tests/common/cases/patch_cases.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/cases/common/types/domain/case/v1.ts
Outdated
Show resolved
Hide resolved
...m/plugins/shared/cases/server/saved_object_types/cases/model_versions/model_versions.test.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/cases/server/services/cases/index.test.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/cases/server/client/cases/utils.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/cases/server/client/cases/utils.ts
Outdated
Show resolved
Hide resolved
| ) { | ||
| if (inProgressAtMillis == null) { | ||
| // When a case transitions directly from 'open' to 'closed', set inProgressAt to | ||
| // updatedAtMillis to reflect the implicit start of progress |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
…mbopepato/kibana into 217638-cases-so-status-changes-metrics
…-status-changes-metrics
…mbopepato/kibana into 217638-cases-so-status-changes-metrics
💔 Build Failed
Failed CI StepsHistory
|
adcoelho
left a comment
There was a problem hiding this comment.
LGTM, left two small comments 👍
| clientArgs.services.attachmentService.getter.getCaseCommentStats.mockResolvedValue(new Map()); | ||
| }); | ||
|
|
||
| it('calculates metrics correctly', async () => { |
There was a problem hiding this comment.
nit: should we have a similar test for the function that calculates in_progress_at?
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15775951233 |
## 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)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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>
## 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>
Summary
in_progress_attimestamp to Cases Saved Objectstime_to_acknowledge,time_to_investigateandtime_to_resolvetiming metrics to Cases Saved ObjectsReferences
Closes #217638
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.