Skip to content

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

Merged
SylvainJuge merged 7 commits intoelastic:mainfrom
JonasKunz:otel-1.32-upgrade
Dec 6, 2023
Merged

Upgrade to OpenTelemetry 1.32.0, add support for bucket boundaries metrics API#3447
SylvainJuge merged 7 commits intoelastic:mainfrom
JonasKunz:otel-1.32-upgrade

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
@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

2 participants