Skip to content

avoid JVM metric conflicts with explicit cast#244151

Merged
SylvainJuge merged 5 commits intoelastic:mainfrom
SylvainJuge:jvm-metrics-cast
Dec 10, 2025
Merged

avoid JVM metric conflicts with explicit cast#244151
SylvainJuge merged 5 commits intoelastic:mainfrom
SylvainJuge:jvm-metrics-cast

Conversation

@SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Nov 25, 2025

In JVM runtime metrics, when micrometer is used in the application, the following metrics are also produced by micrometer, which creates a conflict with the OpenTelemetry metrics that are produced with the instrumentation agent (EDOT and upstream).

Adding a proper cast allows to work-around this issue for metrics where this issue is known to happen, for now two metrics are impacted:

  • jvm.memory.used
  • jvm.memory.committed

The only change applied by this PR is adding an explicit type cast ::long to those metrics when they are referenced in ES|QL queries. Reviewing this PR can be done by using git diff --color-words to highlight the changes.

@SylvainJuge SylvainJuge requested a review from a team November 25, 2025 11:46
@botelastic botelastic bot added the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Nov 25, 2025
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

🌔

@SylvainJuge SylvainJuge self-assigned this Dec 1, 2025
@jennypavlova jennypavlova added the Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation label Dec 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-presentation-team (Team:obs-presentation)

@jennypavlova jennypavlova self-requested a review December 4, 2025 14:26
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 one question ⬇️

@SylvainJuge SylvainJuge requested a review from a team as a code owner December 10, 2025 08:57
@rmyz rmyz removed the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Dec 10, 2025
@SylvainJuge SylvainJuge added backport:version Backport to applied version labels release_note:fix v9.2.3 labels Dec 10, 2025
@SylvainJuge SylvainJuge enabled auto-merge (squash) December 10, 2025 09:13
@SylvainJuge SylvainJuge merged commit 77b5c55 into elastic:main Dec 10, 2025
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.2

https://github.com/elastic/kibana/actions/runs/20096836408

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #148 / Standard Product intercept on initial page load presents all available navigable 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.8MB 2.8MB +576.0B

History

cc @SylvainJuge

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Dec 10, 2025
In JVM runtime metrics, when micrometer is used in the application, the
following metrics are also produced by micrometer, which creates a
conflict with the OpenTelemetry metrics that are produced with the
instrumentation agent (EDOT and upstream).

Adding a proper cast allows to work-around this issue for metrics where
this issue is known to happen, for now two metrics are impacted:
- `jvm.memory.used`
- `jvm.memory.committed`

The only change applied by this PR is adding an explicit type cast
`::long` to those metrics when they are referenced in ES|QL queries.
Reviewing this PR can be done by using `git diff --color-words` to
highlight the changes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 77b5c55)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

@SylvainJuge SylvainJuge deleted the jvm-metrics-cast branch December 10, 2025 12:31
kibanamachine added a commit that referenced this pull request Dec 10, 2025
# Backport

This will backport the following commits from `main` to `9.2`:
- [avoid JVM metric conflicts with explicit cast
(#244151)](#244151)

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

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

<!--BACKPORT
[{"author":{"name":"SylvainJuge","email":"763082+SylvainJuge@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-12-10T11:20:08Z","message":"avoid
JVM metric conflicts with explicit cast (#244151)\n\nIn JVM runtime
metrics, when micrometer is used in the application, the\nfollowing
metrics are also produced by micrometer, which creates a\nconflict with
the OpenTelemetry metrics that are produced with the\ninstrumentation
agent (EDOT and upstream).\n\nAdding a proper cast allows to work-around
this issue for metrics where\nthis issue is known to happen, for now two
metrics are impacted:\n- `jvm.memory.used`\n-
`jvm.memory.committed`\n\nThe only change applied by this PR is adding
an explicit type cast\n`::long` to those metrics when they are
referenced in ES|QL queries.\nReviewing this PR can be done by using
`git diff --color-words` to\nhighlight the
changes.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"77b5c5570f56f1c0c13154825ceebc3728ba6c44","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:version","v9.3.0","Team:obs-presentation","v9.2.3"],"title":"avoid
JVM metric conflicts with explicit
cast","number":244151,"url":"https://github.com/elastic/kibana/pull/244151","mergeCommit":{"message":"avoid
JVM metric conflicts with explicit cast (#244151)\n\nIn JVM runtime
metrics, when micrometer is used in the application, the\nfollowing
metrics are also produced by micrometer, which creates a\nconflict with
the OpenTelemetry metrics that are produced with the\ninstrumentation
agent (EDOT and upstream).\n\nAdding a proper cast allows to work-around
this issue for metrics where\nthis issue is known to happen, for now two
metrics are impacted:\n- `jvm.memory.used`\n-
`jvm.memory.committed`\n\nThe only change applied by this PR is adding
an explicit type cast\n`::long` to those metrics when they are
referenced in ES|QL queries.\nReviewing this PR can be done by using
`git diff --color-words` to\nhighlight the
changes.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"77b5c5570f56f1c0c13154825ceebc3728ba6c44"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/244151","number":244151,"mergeCommit":{"message":"avoid
JVM metric conflicts with explicit cast (#244151)\n\nIn JVM runtime
metrics, when micrometer is used in the application, the\nfollowing
metrics are also produced by micrometer, which creates a\nconflict with
the OpenTelemetry metrics that are produced with the\ninstrumentation
agent (EDOT and upstream).\n\nAdding a proper cast allows to work-around
this issue for metrics where\nthis issue is known to happen, for now two
metrics are impacted:\n- `jvm.memory.used`\n-
`jvm.memory.committed`\n\nThe only change applied by this PR is adding
an explicit type cast\n`::long` to those metrics when they are
referenced in ES|QL queries.\nReviewing this PR can be done by using
`git diff --color-words` to\nhighlight the
changes.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"77b5c5570f56f1c0c13154825ceebc3728ba6c44"}},{"branch":"9.2","label":"v9.2.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: SylvainJuge <763082+SylvainJuge@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation v9.2.3 v9.3.0

7 participants