Skip to content

[8.12] [APM] Remove usage of internal client when fetching agent config etags metrics (#173001) | [APM] Unskip apm api test suite (#173055)#173120

Merged
sorenlouv merged 2 commits intoelastic:8.12from
sorenlouv:backport/8.12/pr-173001_pr-173055
Dec 12, 2023
Merged

[8.12] [APM] Remove usage of internal client when fetching agent config etags metrics (#173001) | [APM] Unskip apm api test suite (#173055)#173120
sorenlouv merged 2 commits intoelastic:8.12from
sorenlouv:backport/8.12/pr-173001_pr-173055

Conversation

@sorenlouv
Copy link
Copy Markdown
Contributor

@sorenlouv sorenlouv commented Dec 11, 2023

…s metrics (elastic#173001)

Closes: elastic#170031
Replaces: elastic/elasticsearch#101467

**Problem**
We need to know if an agent config has been applied at the edge (by APM
agents). This is determined by comparing the etag (hash) of the config,
with the etag applied at the edges.

Previously the agent config itself contained this information
(`config.applied_by_agent`) but when running with fleet this will
instead be captured in `agent_config` metric documents.

Currently the internal kibana user retrieves the `agent_config` metric
documents from the APM metric index (`metrics-apm-*` by default). This
index is configurable by the end-user so can be changed to something the
internal user doesn't have access to. This is a problem.

**Solution**

This PR replaces the calls made by the internal client with calls made
by the authenticated end user (via `APMEventClient`). This approach
works for requests made from the browser/UI but doesn't work for
background tasks made by fleet. To work around this we only
conditionally query the metric index if the `APMEventClient` is
available.
If `APMEventClient` is not available `applied_by_agent` will be
`undefined`

(cherry picked from commit 58c7958)
APM api test suite was accidentally skipped in
elastic#172772.
This unskips the suite and instead skips just the flaky tests

Blocking: elastic#173038
(cherry picked from commit cd0648c)

# Conflicts:
#	x-pack/test/apm_api_integration/tests/index.ts
@sorenlouv sorenlouv added the backport This PR is a backport of another PR label Dec 11, 2023
@sorenlouv sorenlouv enabled auto-merge (squash) December 11, 2023 22:22
@botelastic botelastic bot added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label Dec 11, 2023
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/apm-ui (Team:APM)

@ghost
Copy link
Copy Markdown

ghost commented Dec 11, 2023

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #80 / aiops log pattern analysis loads the log pattern analysis flyout and shows patterns in discover
  • [job] [logs] FTR Configs #26 / Serverless Common UI - Management Index Templates Create index template "after all" hook for "Creates index template"
  • [job] [logs] FTR Configs #26 / Serverless Common UI - Management Index Templates Create index template Creates index template

Metrics [docs]

✅ unchanged

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

@sorenlouv sorenlouv merged commit 837ecf8 into elastic:8.12 Dec 12, 2023
@sorenlouv sorenlouv deleted the backport/8.12/pr-173001_pr-173055 branch December 12, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:APM - DEPRECATED Use Team:obs-ux-infra_services.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants