Skip to content

Conversation

@JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented Jun 16, 2025

Summary

A customer reported that the EDOT JVM metrics tab is broken when his cluster contains both metrics from the classic APM java agent and opentelemetry java agent metrics ingested via the EDOT collector.

Some panels in the dashboard would show the following error:
image

We figured out that this seems to happen due to a metric name clash between the JVM metrics reported by the classic APM agent and the OpenTelemetry Java agent: Both report a jvm.thread.count metric, but the classic agent reports it as double, while the opentelemetry one uses long.

In the EDOT JVM metrics dashboard we use the very wide metrics-* index pattern in the ES|QL queries and later on filter down the data in the query. For the panels using jvm.thread.count this causes ES|QL to rightly complain about the different types for the values found for that column, because we by accident include the classic APM data stream indices.

This PR fixes this behaviour by switching to the more narrow metrics-generic.otel-*metrics-*.otel-* index pattern.

I've manually reproduced the issue and tried the fix using the following setup:

  • Run kibana and an ES-snapshot using [this guide]
  • Run an EDOT-collector locally pointing to the locally running ES instance
  • Run an APM-server locally pointing to the locally running ES instance
  • Start a JVM with the classic agent sending to the APM-server
  • Start a JVM with the EDOT agent sending to the EDOT collector

This setup (without this PR) reproduces the issue, but with a slightly different error message. I assume this is due to some changes in the ES|QL implementation in the snapshot, but the root cause is the same:

Screenshot 2025-06-16 at 12 27 42

With the changes from this PR, the dashboard renders correctly.

This change overall is similar to #223539.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

We need to make sure that the metrics-generic.otel-*metrics-*.otel-* index pattern is actually the correct one to use and is stable to use.
I'd ask @elastic/obs-ds-intake-services to confirm this.

@JonasKunz JonasKunz requested a review from a team as a code owner June 16, 2025 11:00
@botelastic botelastic bot added the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Jun 16, 2025
@elasticmachine
Copy link
Contributor

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

Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a question ⬇️

@jennypavlova
Copy link
Member

Note: I added the same backport/release notes labels as in #223539 :)

@JonasKunz
Copy link
Contributor Author

Got the confirmation from @felixbarny that the metrics-*.otel-* should be good to use.
The only restriction is that it requires the otel mapping mode in the EDOT collector, which however is an acceptable restriction according to his assesment.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
apm 2.6MB 2.6MB +672.0B

History

@rmyz rmyz merged commit 7818df9 into elastic:main Jun 19, 2025
16 checks passed
@kibanamachine
Copy link
Contributor

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 19, 2025
…present (elastic#224052)

Co-authored-by: jennypavlova <[email protected]>
(cherry picked from commit 7818df9)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 19, 2025
…present (elastic#224052)

Co-authored-by: jennypavlova <[email protected]>
(cherry picked from commit 7818df9)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 19, 2025
…present (elastic#224052)

Co-authored-by: jennypavlova <[email protected]>
(cherry picked from commit 7818df9)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.19
9.0

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 19, 2025
…cs are present (#224052) (#224527)

# Backport

This will backport the following commits from `main` to `8.18`:
- [Fix broken EDOT JVM metrics dashboard when classic agent metrics are
present (#224052)](#224052)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Jonas
Kunz","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-19T08:56:56Z","message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0","v9.0.3","v8.18.3"],"title":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are
present","number":224052,"url":"https://github.com/elastic/kibana/pull/224052","mergeCommit":{"message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224052","number":224052,"mergeCommit":{"message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jonas Kunz <[email protected]>
Co-authored-by: jennypavlova <[email protected]>
kibanamachine added a commit that referenced this pull request Jun 19, 2025
…s are present (#224052) (#224529)

# Backport

This will backport the following commits from `main` to `9.0`:
- [Fix broken EDOT JVM metrics dashboard when classic agent metrics are
present (#224052)](#224052)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Jonas
Kunz","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-19T08:56:56Z","message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0","v9.0.3","v8.18.3"],"title":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are
present","number":224052,"url":"https://github.com/elastic/kibana/pull/224052","mergeCommit":{"message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224052","number":224052,"mergeCommit":{"message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jonas Kunz <[email protected]>
Co-authored-by: jennypavlova <[email protected]>
kibanamachine added a commit that referenced this pull request Jun 19, 2025
…cs are present (#224052) (#224528)

# Backport

This will backport the following commits from `main` to `8.19`:
- [Fix broken EDOT JVM metrics dashboard when classic agent metrics are
present (#224052)](#224052)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Jonas
Kunz","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-19T08:56:56Z","message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0","v9.0.3","v8.18.3"],"title":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are
present","number":224052,"url":"https://github.com/elastic/kibana/pull/224052","mergeCommit":{"message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224052","number":224052,"mergeCommit":{"message":"Fix
broken EDOT JVM metrics dashboard when classic agent metrics are present
(#224052)\n\nCo-authored-by: jennypavlova
<[email protected]>","sha":"7818df99305093219006b6d1f8c4b375e0b5a07f"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jonas Kunz <[email protected]>
Co-authored-by: jennypavlova <[email protected]>
Co-authored-by: Sergi Romeu <[email protected]>
@mistic mistic added v8.18.4 and removed v8.18.3 labels Jun 24, 2025
@mistic
Copy link
Member

mistic commented Jun 24, 2025

This PR didn't make it on time for the latest v8.18.3 and v9.0.3 BC. Updating the labels

@mistic mistic added v9.0.4 and removed v9.0.3 labels Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants