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.12] [APM] Remove usage of internal client when fetching agent config etags metrics (#173001) #173038

Closed

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.12:

Questions ?

Please refer to the Backport tool documentation

@elasticmachine
Copy link
Contributor

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

…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)
@sorenlouv sorenlouv force-pushed the backport/8.12/pr-173001 branch from a8dd08e to e5507d5 Compare December 11, 2023 13:17
@kibana-ci
Copy link
Collaborator

kibana-ci commented Dec 11, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Detection Engine - Security Solution Cypress Tests #6 / Alert user assignment - ESS & Serverless Basic rendering alert with many assignees (collapsed into badge) in alerts table alert with many assignees (collapsed into badge) in alerts table
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #6 / Alert user assignment - ESS & Serverless Basic rendering alert with some assignees in alert's details flyout alert with some assignees in alert's details flyout
  • [job] [logs] FTR Configs #65 / APM API tests inspect/inspect.spec.ts trial apm_8.0.0 Inspect feature when passing _inspect as query param elasticsearch calls made with internal user are not return for agent configs
  • [job] [logs] FTR Configs #65 / APM API tests inspect/inspect.spec.ts trial apm_8.0.0 Inspect feature when passing _inspect as query param elasticsearch calls made with internal user are not return for agent configs

Metrics [docs]

✅ unchanged

History

  • 💔 Build #182908 failed a8dd08e4b4b9bac81ce4f370d475ee3dbc36624d

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

cc @sqren

@sorenlouv
Copy link
Member

Pending on #173055

sorenlouv added a commit that referenced this pull request Dec 11, 2023
APM api test suite was accidentally skipped in
#172772.
This unskips the suite and instead skips just the flaky tests

Blocking: #173038
sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Dec 11, 2023
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 closed this May 2, 2024
auto-merge was automatically disabled May 2, 2024 15:10

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:APM All issues that need APM UI Team support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants