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

fix: do not overwrite registries when publishing otel metrics to beats #15517

Merged
merged 4 commits into from
Feb 4, 2025

Conversation

kruskall
Copy link
Member

@kruskall kruskall commented Jan 31, 2025

Motivation/summary

update apm-server registry mapping logic to avoid overwriting onkey handlers

discovered while backporting the otel changes. Already added in 8.x

if metrics have similar paths the onkey handler is overwritten. To avoid this process all the metrics path first to build a tree and produce them in order.

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

Related issues

update apm-server registry mapping logic to avoid overwriting
onkey handlers
@kruskall kruskall added the backport-skip Skip notification from the automated backport with mergify label Jan 31, 2025
@kruskall kruskall requested a review from a team as a code owner January 31, 2025 20:06
@kruskall kruskall added backport-9.0 Automated backport to the 9.0 branch and removed backport-skip Skip notification from the automated backport with mergify labels Jan 31, 2025
Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

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

Can you please add a unit test for this logic.

@kruskall kruskall requested a review from simitt February 3, 2025 20:29
@kruskall
Copy link
Member Author

kruskall commented Feb 3, 2025

Thank you for the feedback! 🙇

Added 👍

Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

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

Thank you!

@kruskall kruskall enabled auto-merge (squash) February 4, 2025 08:40
@kruskall kruskall merged commit 9350ef5 into elastic:main Feb 4, 2025
12 checks passed
@kruskall kruskall deleted the fix/apm-server-metrics branch February 4, 2025 08:50
mergify bot pushed a commit that referenced this pull request Feb 4, 2025
#15517)

* fix: do not overwrite registries when publishing otel metrics to beats

update apm-server registry mapping logic to avoid overwriting
onkey handlers

* test: add unit test for apm-server mapping logic

(cherry picked from commit 9350ef5)
mergify bot added a commit that referenced this pull request Feb 4, 2025
#15517) (#15537)

* fix: do not overwrite registries when publishing otel metrics to beats

update apm-server registry mapping logic to avoid overwriting
onkey handlers

* test: add unit test for apm-server mapping logic

(cherry picked from commit 9350ef5)

Co-authored-by: kruskall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9.0 Automated backport to the 9.0 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants