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

[APM] Use excluded data tiers setting #192373

Merged

Conversation

crespocarlos
Copy link
Contributor

@crespocarlos crespocarlos commented Sep 9, 2024

closes #190559

Summary

This PR updates the ES clients in APM to respect the excluded tier configuration. When this config is set, the ES clients will automatically add a filter to exclude the specified tiers from queries.

image

All queries in APM should have the _tier filter (via get_apm_events_client)
image

This change also affects alerting (via alerting_es_client)
image

And it impacts the alerts column (via get_apm_alert_client)
image

What won't automatically add a filter for _tier

  • Embeddables
  • ML queries

How to test

  • Set the config in Advanced Settings to exclude data_frozen and data_cold (optional)
  • Navigate to APM and check the query Inspect to see if the filter is present.
  • Click through APM to confirm things still work.
  • Create one of each type of APM alerts
  • Without the config set, queries should not include the _tier filter`

@obltmachine
Copy link

🤖 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!)

@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos crespocarlos force-pushed the 190559-apm-use-excluded_data_tiers-setting branch 5 times, most recently from 5144b69 to 495b445 Compare September 11, 2024 12:41
@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos crespocarlos force-pushed the 190559-apm-use-excluded_data_tiers-setting branch 5 times, most recently from c4f2334 to e612deb Compare September 16, 2024 15:20
@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos crespocarlos force-pushed the 190559-apm-use-excluded_data_tiers-setting branch from 91190f2 to d46ee97 Compare September 17, 2024 12:13
@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos crespocarlos force-pushed the 190559-apm-use-excluded_data_tiers-setting branch from d46ee97 to 0860b34 Compare September 17, 2024 14:32
@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos crespocarlos added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0 apm and removed backport:skip This commit does not require backporting labels Sep 18, 2024
@crespocarlos crespocarlos marked this pull request as ready for review September 18, 2024 13:47
@crespocarlos crespocarlos requested a review from a team as a code owner September 23, 2024 07:42
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Sep 23, 2024
@elasticmachine
Copy link
Contributor

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

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 23, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 75c328d
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-192373-75c328d4c862

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observabilityShared 208 209 +1

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
observabilityShared 469 472 +3

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.4MB 3.4MB +73.0B
profiling 405.9KB 406.1KB +230.0B
total +303.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
apm 119 118 -1
apmDataAccess 1 3 +2
total +1

Page load bundle

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

id before after diff
observabilityShared 70.8KB 71.1KB +336.0B
profiling 17.3KB 17.4KB +149.0B
total +485.0B
Unknown metric groups

API count

id before after diff
observabilityShared 474 477 +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@smith smith enabled auto-merge (squash) September 23, 2024 14:16
@smith smith merged commit ee5ef81 into elastic:main Sep 23, 2024
26 checks passed
@crespocarlos crespocarlos deleted the 190559-apm-use-excluded_data_tiers-setting branch September 23, 2024 16:01
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.15 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.15:
- [ObsUX][APM] Rename observability setting apmEnableMultiSignal to entityCentricExperience (#188097)
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [APM] Turn 'fast filter' on by default and ensure tech preview badge shows when turned on (#193710)

Manual backport

To create the backport manually run:

node scripts/backport --pr 192373

Questions ?

Please refer to the Backport tool documentation

cauemarcondes pushed a commit to cauemarcondes/kibana that referenced this pull request Sep 24, 2024
closes [elastic#190559](elastic#190559)

## Summary

This PR updates the ES clients in APM to respect the excluded tier
configuration. When this config is set, the ES clients will
automatically add a filter to exclude the specified tiers from queries.

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/9b0de76d-242c-4343-bc30-d5c787316f59">

All queries in APM should have the `_tier` filter (via
`get_apm_events_client`)
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/c525602f-f239-4be8-99c4-65d617962656">

This change also affects alerting (via `alerting_es_client`)
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/750df4d7-5b49-4de5-9294-7afedf11d7e5">

And it impacts the alerts column (via `get_apm_alert_client`)
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/44bd9129-1e72-4a3a-af32-d42a9cd9164d">

### What won't automatically add a filter for `_tier`

- Embeddables
- ML queries

### How to test
- Set the config in Advanced Settings to exclude `data_frozen` and
`data_cold` (optional)
- Navigate to APM and check the query `Inspect` to see if the filter is
present.
- Click through APM to confirm things still work.
- Create one of each type of APM alerts
- Without the config set, queries should not include the `_tier` filter`

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit ee5ef81)
@cauemarcondes
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x
8.15

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

Questions ?

Please refer to the Backport tool documentation

cauemarcondes pushed a commit to cauemarcondes/kibana that referenced this pull request Sep 24, 2024
closes [elastic#190559](elastic#190559)

## Summary

This PR updates the ES clients in APM to respect the excluded tier
configuration. When this config is set, the ES clients will
automatically add a filter to exclude the specified tiers from queries.

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/9b0de76d-242c-4343-bc30-d5c787316f59">

All queries in APM should have the `_tier` filter (via
`get_apm_events_client`)
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/c525602f-f239-4be8-99c4-65d617962656">

This change also affects alerting (via `alerting_es_client`)
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/750df4d7-5b49-4de5-9294-7afedf11d7e5">

And it impacts the alerts column (via `get_apm_alert_client`)
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/44bd9129-1e72-4a3a-af32-d42a9cd9164d">

### What won't automatically add a filter for `_tier`

- Embeddables
- ML queries

### How to test
- Set the config in Advanced Settings to exclude `data_frozen` and
`data_cold` (optional)
- Navigate to APM and check the query `Inspect` to see if the filter is
present.
- Click through APM to confirm things still work.
- Create one of each type of APM alerts
- Without the config set, queries should not include the `_tier` filter`

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit ee5ef81)

# Conflicts:
#	x-pack/packages/observability/observability_utils/es/queries/exclude_frozen_query.ts
#	x-pack/plugins/cloud_integrations/cloud_experiments/public/launch_darkly_client/index.ts
#	x-pack/plugins/observability_solution/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts
#	x-pack/plugins/observability_solution/apm/server/lib/helpers/get_apm_event_client.ts
#	x-pack/plugins/observability_solution/apm/server/lib/helpers/tier_filter.ts
#	x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/create_es_client/create_apm_event_client/index.ts
#	x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/index.ts
#	x-pack/plugins/observability_solution/apm_data_access/tsconfig.json
#	x-pack/plugins/observability_solution/observability/server/ui_settings.ts
cauemarcondes added a commit that referenced this pull request Sep 24, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[APM] Use excluded data tiers setting
(#192373)](#192373)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T15:59:08Z","message":"[APM]
Use excluded data tiers setting (#192373)\n\ncloses
[#190559](https://github.com/elastic/kibana/issues/190559)\r\n\r\n##
Summary\r\n\r\nThis PR updates the ES clients in APM to respect the
excluded tier\r\nconfiguration. When this config is set, the ES clients
will\r\nautomatically add a filter to exclude the specified tiers from
queries.\r\n\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9b0de76d-242c-4343-bc30-d5c787316f59\">\r\n\r\nAll
queries in APM should have the `_tier` filter
(via\r\n`get_apm_events_client`)\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c525602f-f239-4be8-99c4-65d617962656\">\r\n\r\nThis
change also affects alerting (via `alerting_es_client`)\r\n<img
width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/750df4d7-5b49-4de5-9294-7afedf11d7e5\">\r\n\r\nAnd
it impacts the alerts column (via `get_apm_alert_client`)\r\n<img
width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/44bd9129-1e72-4a3a-af32-d42a9cd9164d\">\r\n\r\n###
What won't automatically add a filter for `_tier`\r\n\r\n-
Embeddables\r\n- ML queries\r\n\r\n### How to test\r\n- Set the config
in Advanced Settings to exclude `data_frozen` and\r\n`data_cold`
(optional)\r\n- Navigate to APM and check the query `Inspect` to see if
the filter is\r\npresent.\r\n- Click through APM to confirm things still
work.\r\n- Create one of each type of APM alerts\r\n- Without the config
set, queries should not include the `_tier`
filter`\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"ee5ef8166b74041f359862f3f22e0eb491f1443c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","apm","backport:prev-major","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-ux-management","v8.16.0"],"number":192373,"url":"https://github.com/elastic/kibana/pull/192373","mergeCommit":{"message":"[APM]
Use excluded data tiers setting (#192373)\n\ncloses
[#190559](https://github.com/elastic/kibana/issues/190559)\r\n\r\n##
Summary\r\n\r\nThis PR updates the ES clients in APM to respect the
excluded tier\r\nconfiguration. When this config is set, the ES clients
will\r\nautomatically add a filter to exclude the specified tiers from
queries.\r\n\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9b0de76d-242c-4343-bc30-d5c787316f59\">\r\n\r\nAll
queries in APM should have the `_tier` filter
(via\r\n`get_apm_events_client`)\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c525602f-f239-4be8-99c4-65d617962656\">\r\n\r\nThis
change also affects alerting (via `alerting_es_client`)\r\n<img
width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/750df4d7-5b49-4de5-9294-7afedf11d7e5\">\r\n\r\nAnd
it impacts the alerts column (via `get_apm_alert_client`)\r\n<img
width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/44bd9129-1e72-4a3a-af32-d42a9cd9164d\">\r\n\r\n###
What won't automatically add a filter for `_tier`\r\n\r\n-
Embeddables\r\n- ML queries\r\n\r\n### How to test\r\n- Set the config
in Advanced Settings to exclude `data_frozen` and\r\n`data_cold`
(optional)\r\n- Navigate to APM and check the query `Inspect` to see if
the filter is\r\npresent.\r\n- Click through APM to confirm things still
work.\r\n- Create one of each type of APM alerts\r\n- Without the config
set, queries should not include the `_tier`
filter`\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"ee5ef8166b74041f359862f3f22e0eb491f1443c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192373","number":192373,"mergeCommit":{"message":"[APM]
Use excluded data tiers setting (#192373)\n\ncloses
[#190559](https://github.com/elastic/kibana/issues/190559)\r\n\r\n##
Summary\r\n\r\nThis PR updates the ES clients in APM to respect the
excluded tier\r\nconfiguration. When this config is set, the ES clients
will\r\nautomatically add a filter to exclude the specified tiers from
queries.\r\n\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9b0de76d-242c-4343-bc30-d5c787316f59\">\r\n\r\nAll
queries in APM should have the `_tier` filter
(via\r\n`get_apm_events_client`)\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c525602f-f239-4be8-99c4-65d617962656\">\r\n\r\nThis
change also affects alerting (via `alerting_es_client`)\r\n<img
width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/750df4d7-5b49-4de5-9294-7afedf11d7e5\">\r\n\r\nAnd
it impacts the alerts column (via `get_apm_alert_client`)\r\n<img
width=\"600\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/44bd9129-1e72-4a3a-af32-d42a9cd9164d\">\r\n\r\n###
What won't automatically add a filter for `_tier`\r\n\r\n-
Embeddables\r\n- ML queries\r\n\r\n### How to test\r\n- Set the config
in Advanced Settings to exclude `data_frozen` and\r\n`data_cold`
(optional)\r\n- Navigate to APM and check the query `Inspect` to see if
the filter is\r\npresent.\r\n- Click through APM to confirm things still
work.\r\n- Create one of each type of APM alerts\r\n- Without the config
set, queries should not include the `_tier`
filter`\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"ee5ef8166b74041f359862f3f22e0eb491f1443c"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not allow APM UI to query frozen tier