-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Perfomance] Track time range picker with onPageReady
function
#202889
Conversation
"owner": ["@elastic/obs-ux-logs-team"], | ||
"group": "platform", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't use the package outside of observability so I updated the group in order to be reuse and extend it. Let me know if that's okay for you @elastic/obs-ux-logs-team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the plan in case the package is needed elsewhere so it's fine.
…na into 3377-add-query_range_secs
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
"owner": ["@elastic/obs-ux-logs-team"], | ||
"group": "platform", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the plan in case the package is needed elsewhere so it's fine.
...aset_quality/public/components/dataset_quality/summary_panel/datasets_quality_indicators.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from Core's POV.
cc @dmlemeshko and @thomasneirynck as these changes may be relevant to their efforts in Dashboard Performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks of implementing this.
This is awesome, thanks! 🚀 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
History
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12316291530 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…stic#202889) closes elastic/observability-dev#3377 in seconds. 'rangeTo'/end' time picker value in seconds. ____ Extend the `onPageReady` function to support date ranges in the meta field. The function should compute the query range in seconds based on the provided time range and report it to telemetry as meta.query_range_secs. If the `rangeTo` is different from 'now', calculate the offset. - A negative offset indicates that the rangeTo is in the past, - a positive offset means it is in the future, - and zero indicates that the rangeTo is exactly 'now'." To report the selected time range, pass the `rangeFrom` and `rangeTo` . > Failing to pass the correct type will result in TS error. Then, use this data when invoking onPageReady: ``` onPageReady({ meta: { rangeFrom, rangeTo }, }); ``` Meta is flatten field. In order to aggregate the data it's necessary to create a run time field. You can add a field in the 1. select data view (`ebt-kibana-*-performance-metrics`) 2. Add a new field 3. Type double 4. Set value `query_range_secs` ``` def meta = doc[“meta”].size(); if (meta > 0) { def range = doc[“meta.query_range_secs”].size(); if (range > 0) { // Emit the value of ‘meta.target’ emit(Double.parseDouble(doc[“meta.query_range_secs”].value)); } } ``` `query_offset_secs` ``` def meta = doc[“meta”].size(); if (meta > 0) { def offset = doc[“meta.query_offset_secs”].size(); if (offset > 0) { emit(Double.parseDouble(doc[“meta.query_offset_secs”].value)); } } ``` <img width="1478" alt="Screenshot 2024-12-09 at 19 51 32" src="https://github.com/user-attachments/assets/72f796e1-4f20-487f-b62a-b6a4aead9a4a"> <img width="1478" alt="Screenshot 2024-12-09 at 19 56 08" src="https://github.com/user-attachments/assets/c278dc3b-e6f3-47ed-9c90-954d71b59161"> <img width="1478" alt="Screenshot 2024-12-09 at 19 53 45 1" src="https://github.com/user-attachments/assets/ef42ecef-48cd-4396-9f5d-c971098d5219"> - Instrumented only 2 solutions as an example (dataset and apm services) - [x] Update documentation - elastic#204179 - [ ] Update dashboards (create a runtime field) - [x] Track offset ( we need to know if the user selected now or now) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit bd1c00f)
#202889) (#204564) # Backport This will backport the following commits from `main` to `8.x`: - [[Perfomance] Track time range picker with `onPageReady` function (#202889)](#202889) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Katerina","email":"aikaterini.patticha@elastic.co"},"sourceCommit":{"committedDate":"2024-12-13T13:11:44Z","message":"[Perfomance] Track time range picker with `onPageReady` function (#202889)\n\n## Summary\r\n\r\ncloses https://github.com/elastic/observability-dev/issues/3377\r\n## Metrics \r\n#### `meta.query_range_secs` - The duration of the selected time range\r\nin seconds.\r\n#### `meta.query_offset_secs` - The offset from \"now\" to the\r\n'rangeTo'/end' time picker value in seconds.\r\n\r\n____\r\n\r\nExtend the `onPageReady` function to support date ranges in the meta\r\nfield. The function should compute the query range in seconds based on\r\nthe provided time range and report it to telemetry as\r\nmeta.query_range_secs.\r\n\r\n\r\n\r\n\r\nIf the `rangeTo` is different from 'now', calculate the offset. \r\n- A negative offset indicates that the rangeTo is in the past, \r\n- a positive offset means it is in the future, \r\n- and zero indicates that the rangeTo is exactly 'now'.\" \r\n\r\n\r\n\r\n### How to instrument\r\nTo report the selected time range, pass the `rangeFrom` and `rangeTo` . \r\n> Failing to pass the correct type will result in TS error.\r\n\r\n\r\nThen, use this data when invoking onPageReady:\r\n```\r\n onPageReady({\r\n meta: { rangeFrom, rangeTo },\r\n });\r\n```\r\n\r\n### Analysis \r\n\r\nMeta is flatten field. In order to aggregate the data it's necessary to\r\ncreate a run time field. You can add a field in the\r\n\r\n1. select data view (`ebt-kibana-*-performance-metrics`) \r\n2. Add a new field\r\n3. Type double\r\n4. Set value \r\n\r\n`query_range_secs`\r\n```\r\ndef meta = doc[“meta”].size();\r\nif (meta > 0) {\r\n def range = doc[“meta.query_range_secs”].size();\r\n if (range > 0) {\r\n // Emit the value of ‘meta.target’\r\n emit(Double.parseDouble(doc[“meta.query_range_secs”].value));\r\n }\r\n}\r\n\r\n```\r\n\r\n`query_offset_secs` \r\n```\r\n\r\ndef meta = doc[“meta”].size();\r\nif (meta > 0) {\r\n def offset = doc[“meta.query_offset_secs”].size();\r\n if (offset > 0) {\r\n \r\n emit(Double.parseDouble(doc[“meta.query_offset_secs”].value));\r\n }\r\n}\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Examples\r\n\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 51 32\"\r\nsrc=\"https://github.com/user-attachments/assets/72f796e1-4f20-487f-b62a-b6a4aead9a4a\">\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 56 08\"\r\nsrc=\"https://github.com/user-attachments/assets/c278dc3b-e6f3-47ed-9c90-954d71b59161\">\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 53 45 1\"\r\nsrc=\"https://github.com/user-attachments/assets/ef42ecef-48cd-4396-9f5d-c971098d5219\">\r\n\r\n\r\n\r\n\r\n\r\n### Notes\r\n- Instrumented only 2 solutions as an example (dataset and apm services)\r\n\r\n### TODO\r\n- [x] Update documentation -\r\nhttps://github.com//pull/204179\r\n- [ ] Update dashboards (create a runtime field) \r\n- [x] Track offset ( we need to know if the user selected now or now)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"bd1c00fd65848ff27a1bace14363c5ab326c491d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services"],"number":202889,"url":"https://github.com/elastic/kibana/pull/202889","mergeCommit":{"message":"[Perfomance] Track time range picker with `onPageReady` function (#202889)\n\n## Summary\r\n\r\ncloses https://github.com/elastic/observability-dev/issues/3377\r\n## Metrics \r\n#### `meta.query_range_secs` - The duration of the selected time range\r\nin seconds.\r\n#### `meta.query_offset_secs` - The offset from \"now\" to the\r\n'rangeTo'/end' time picker value in seconds.\r\n\r\n____\r\n\r\nExtend the `onPageReady` function to support date ranges in the meta\r\nfield. The function should compute the query range in seconds based on\r\nthe provided time range and report it to telemetry as\r\nmeta.query_range_secs.\r\n\r\n\r\n\r\n\r\nIf the `rangeTo` is different from 'now', calculate the offset. \r\n- A negative offset indicates that the rangeTo is in the past, \r\n- a positive offset means it is in the future, \r\n- and zero indicates that the rangeTo is exactly 'now'.\" \r\n\r\n\r\n\r\n### How to instrument\r\nTo report the selected time range, pass the `rangeFrom` and `rangeTo` . \r\n> Failing to pass the correct type will result in TS error.\r\n\r\n\r\nThen, use this data when invoking onPageReady:\r\n```\r\n onPageReady({\r\n meta: { rangeFrom, rangeTo },\r\n });\r\n```\r\n\r\n### Analysis \r\n\r\nMeta is flatten field. In order to aggregate the data it's necessary to\r\ncreate a run time field. You can add a field in the\r\n\r\n1. select data view (`ebt-kibana-*-performance-metrics`) \r\n2. Add a new field\r\n3. Type double\r\n4. Set value \r\n\r\n`query_range_secs`\r\n```\r\ndef meta = doc[“meta”].size();\r\nif (meta > 0) {\r\n def range = doc[“meta.query_range_secs”].size();\r\n if (range > 0) {\r\n // Emit the value of ‘meta.target’\r\n emit(Double.parseDouble(doc[“meta.query_range_secs”].value));\r\n }\r\n}\r\n\r\n```\r\n\r\n`query_offset_secs` \r\n```\r\n\r\ndef meta = doc[“meta”].size();\r\nif (meta > 0) {\r\n def offset = doc[“meta.query_offset_secs”].size();\r\n if (offset > 0) {\r\n \r\n emit(Double.parseDouble(doc[“meta.query_offset_secs”].value));\r\n }\r\n}\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Examples\r\n\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 51 32\"\r\nsrc=\"https://github.com/user-attachments/assets/72f796e1-4f20-487f-b62a-b6a4aead9a4a\">\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 56 08\"\r\nsrc=\"https://github.com/user-attachments/assets/c278dc3b-e6f3-47ed-9c90-954d71b59161\">\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 53 45 1\"\r\nsrc=\"https://github.com/user-attachments/assets/ef42ecef-48cd-4396-9f5d-c971098d5219\">\r\n\r\n\r\n\r\n\r\n\r\n### Notes\r\n- Instrumented only 2 solutions as an example (dataset and apm services)\r\n\r\n### TODO\r\n- [x] Update documentation -\r\nhttps://github.com//pull/204179\r\n- [ ] Update dashboards (create a runtime field) \r\n- [x] Track offset ( we need to know if the user selected now or now)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"bd1c00fd65848ff27a1bace14363c5ab326c491d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202889","number":202889,"mergeCommit":{"message":"[Perfomance] Track time range picker with `onPageReady` function (#202889)\n\n## Summary\r\n\r\ncloses https://github.com/elastic/observability-dev/issues/3377\r\n## Metrics \r\n#### `meta.query_range_secs` - The duration of the selected time range\r\nin seconds.\r\n#### `meta.query_offset_secs` - The offset from \"now\" to the\r\n'rangeTo'/end' time picker value in seconds.\r\n\r\n____\r\n\r\nExtend the `onPageReady` function to support date ranges in the meta\r\nfield. The function should compute the query range in seconds based on\r\nthe provided time range and report it to telemetry as\r\nmeta.query_range_secs.\r\n\r\n\r\n\r\n\r\nIf the `rangeTo` is different from 'now', calculate the offset. \r\n- A negative offset indicates that the rangeTo is in the past, \r\n- a positive offset means it is in the future, \r\n- and zero indicates that the rangeTo is exactly 'now'.\" \r\n\r\n\r\n\r\n### How to instrument\r\nTo report the selected time range, pass the `rangeFrom` and `rangeTo` . \r\n> Failing to pass the correct type will result in TS error.\r\n\r\n\r\nThen, use this data when invoking onPageReady:\r\n```\r\n onPageReady({\r\n meta: { rangeFrom, rangeTo },\r\n });\r\n```\r\n\r\n### Analysis \r\n\r\nMeta is flatten field. In order to aggregate the data it's necessary to\r\ncreate a run time field. You can add a field in the\r\n\r\n1. select data view (`ebt-kibana-*-performance-metrics`) \r\n2. Add a new field\r\n3. Type double\r\n4. Set value \r\n\r\n`query_range_secs`\r\n```\r\ndef meta = doc[“meta”].size();\r\nif (meta > 0) {\r\n def range = doc[“meta.query_range_secs”].size();\r\n if (range > 0) {\r\n // Emit the value of ‘meta.target’\r\n emit(Double.parseDouble(doc[“meta.query_range_secs”].value));\r\n }\r\n}\r\n\r\n```\r\n\r\n`query_offset_secs` \r\n```\r\n\r\ndef meta = doc[“meta”].size();\r\nif (meta > 0) {\r\n def offset = doc[“meta.query_offset_secs”].size();\r\n if (offset > 0) {\r\n \r\n emit(Double.parseDouble(doc[“meta.query_offset_secs”].value));\r\n }\r\n}\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Examples\r\n\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 51 32\"\r\nsrc=\"https://github.com/user-attachments/assets/72f796e1-4f20-487f-b62a-b6a4aead9a4a\">\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 56 08\"\r\nsrc=\"https://github.com/user-attachments/assets/c278dc3b-e6f3-47ed-9c90-954d71b59161\">\r\n\r\n<img width=\"1478\" alt=\"Screenshot 2024-12-09 at 19 53 45 1\"\r\nsrc=\"https://github.com/user-attachments/assets/ef42ecef-48cd-4396-9f5d-c971098d5219\">\r\n\r\n\r\n\r\n\r\n\r\n### Notes\r\n- Instrumented only 2 solutions as an example (dataset and apm services)\r\n\r\n### TODO\r\n- [x] Update documentation -\r\nhttps://github.com//pull/204179\r\n- [ ] Update dashboards (create a runtime field) \r\n- [x] Track offset ( we need to know if the user selected now or now)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"bd1c00fd65848ff27a1bace14363c5ab326c491d"}}]}] BACKPORT-->
## Summary Related to this: #202889 Update the documentation with the recent changes
## Summary Related to this: elastic#202889 Update the documentation with the recent changes (cherry picked from commit 860d5b6)
## Summary Related to this: elastic#202889 Update the documentation with the recent changes
## Summary Related to this: elastic#202889 Update the documentation with the recent changes
…stic#202889) ## Summary closes elastic/observability-dev#3377 ## Metrics #### `meta.query_range_secs` - The duration of the selected time range in seconds. #### `meta.query_offset_secs` - The offset from "now" to the 'rangeTo'/end' time picker value in seconds. ____ Extend the `onPageReady` function to support date ranges in the meta field. The function should compute the query range in seconds based on the provided time range and report it to telemetry as meta.query_range_secs. If the `rangeTo` is different from 'now', calculate the offset. - A negative offset indicates that the rangeTo is in the past, - a positive offset means it is in the future, - and zero indicates that the rangeTo is exactly 'now'." ### How to instrument To report the selected time range, pass the `rangeFrom` and `rangeTo` . > Failing to pass the correct type will result in TS error. Then, use this data when invoking onPageReady: ``` onPageReady({ meta: { rangeFrom, rangeTo }, }); ``` ### Analysis Meta is flatten field. In order to aggregate the data it's necessary to create a run time field. You can add a field in the 1. select data view (`ebt-kibana-*-performance-metrics`) 2. Add a new field 3. Type double 4. Set value `query_range_secs` ``` def meta = doc[“meta”].size(); if (meta > 0) { def range = doc[“meta.query_range_secs”].size(); if (range > 0) { // Emit the value of ‘meta.target’ emit(Double.parseDouble(doc[“meta.query_range_secs”].value)); } } ``` `query_offset_secs` ``` def meta = doc[“meta”].size(); if (meta > 0) { def offset = doc[“meta.query_offset_secs”].size(); if (offset > 0) { emit(Double.parseDouble(doc[“meta.query_offset_secs”].value)); } } ``` ### Examples <img width="1478" alt="Screenshot 2024-12-09 at 19 51 32" src="https://github.com/user-attachments/assets/72f796e1-4f20-487f-b62a-b6a4aead9a4a"> <img width="1478" alt="Screenshot 2024-12-09 at 19 56 08" src="https://github.com/user-attachments/assets/c278dc3b-e6f3-47ed-9c90-954d71b59161"> <img width="1478" alt="Screenshot 2024-12-09 at 19 53 45 1" src="https://github.com/user-attachments/assets/ef42ecef-48cd-4396-9f5d-c971098d5219"> ### Notes - Instrumented only 2 solutions as an example (dataset and apm services) ### TODO - [x] Update documentation - elastic#204179 - [ ] Update dashboards (create a runtime field) - [x] Track offset ( we need to know if the user selected now or now) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary Related to this: elastic#202889 Update the documentation with the recent changes
## Summary Related to this: elastic#202889 Update the documentation with the recent changes
Summary
closes https://github.com/elastic/observability-dev/issues/3377
Metrics
meta.query_range_secs
- The duration of the selected time range in seconds.meta.query_offset_secs
- The offset from "now" to the 'rangeTo'/end' time picker value in seconds.Extend the
onPageReady
function to support date ranges in the meta field. The function should compute the query range in seconds based on the provided time range and report it to telemetry as meta.query_range_secs.If the
rangeTo
is different from 'now', calculate the offset.How to instrument
To report the selected time range, pass the
rangeFrom
andrangeTo
.Then, use this data when invoking onPageReady:
Analysis
Meta is flatten field. In order to aggregate the data it's necessary to create a run time field. You can add a field in the
ebt-kibana-*-performance-metrics
)query_range_secs
query_offset_secs
Examples
Notes
TODO
onPageReady
documentation #204179