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

[8.x] [Perfomance] Track time range picker with onPageReady function (#202889) #204564

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

kpatticha
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

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)
@kpatticha kpatticha enabled auto-merge (squash) December 17, 2024 12:24
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Dec 17, 2024
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 17, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 2c09b0b
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-204564-2c09b0b8e1a4

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/ebt-tools 28 29 +1
@kbn/timerange 8 14 +6
total +7

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.5MB 3.5MB +185.0B
datasetQuality 252.0KB 252.1KB +81.0B
total +266.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/ebt-tools 2 3 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 450.9KB 451.0KB +150.0B
kbnUiSharedDeps-srcJs 3.4MB 3.4MB +35.0B
total +185.0B
Unknown metric groups

API count

id before after diff
@kbn/ebt-tools 37 38 +1
@kbn/timerange 8 14 +6
total +7

History

@kpatticha kpatticha merged commit 64de070 into elastic:8.x Dec 17, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants