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

Upgrade to OpenTelemetry 1.32.0, add support for bucket boundaries metrics API #3447

Merged
merged 7 commits into from Dec 6, 2023

Conversation

JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented Nov 29, 2023

What does this PR do?

Upgrades to OpenTelemetry 1.32.0. Superseeds #3433.

Looks like our unit tests are doing their job and detected a new OpenTelemetry default method for which we need to add support:

AssertionFailedError: Expected bridge type 'co.elastic.apm.agent.opentelemetry.metrics.bridge.v1_14.BridgeLongHistogramBuilder' to implement default method 'public default io.opentelemetry.api.metrics.LongHistogramBuilder io.opentelemetry.api.metrics.LongHistogramBuilder.setExplicitBucketBoundariesAdvice(java.util.List)' from type 'interface io.opentelemetry.api.metrics.LongHistogramBuilder'

OpenTelemetry 1.32.0 adds the capability to define histogram bucket boundaries via the OpenTelemetry API.
Unfortunately this feature only works for exporters which rely on the default aggregation.

For our custom_metrics_histogram_boundaries however we needed to provide a custom aggregation from our exporter.
I've fixed this by changing the approach:

  • Our exporter uses the default aggregation
  • Whenever a new HistogramBuilder is created, we initialize it's bucket boundaries to custom_metrics_histogram_boundaries via the new setExplicitBucketBoundariesAdvice method.

Unfortunately this will not work in use-cases where we instrument the SDK instead of the API.

I would however say that this is acceptable and clarified the behaviour in the documentation.

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
    • Added an API method or config option? Document in which version this will be introduced
    • I have made corresponding changes to the documentation

@JonasKunz JonasKunz requested a review from a team November 29, 2023 14:21
@SylvainJuge SylvainJuge merged commit 129a318 into elastic:main Dec 6, 2023
13 checks passed
APM-Agents (OLD) automation moved this from In Progress to Done Dec 6, 2023
@JonasKunz JonasKunz deleted the otel-1.32-upgrade branch December 6, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants