Allow Otlp*MetricExporter's to publish export stats#7255
Merged
jack-berg merged 4 commits intoopen-telemetry:mainfrom Apr 21, 2025
Merged
Allow Otlp*MetricExporter's to publish export stats#7255jack-berg merged 4 commits intoopen-telemetry:mainfrom
jack-berg merged 4 commits intoopen-telemetry:mainfrom
Conversation
a079a8a to
ce5770a
Compare
Previously there was no way to report stats for otlp metric exporters. Now we can supply a MeterProvider lazily. When export is invoked if the previously provided meter is a noop implementation it will try again, allowing for delayed/lazy initialization.
2bafd3a to
d630c00
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7255 +/- ##
=========================================
Coverage 89.60% 89.61%
- Complexity 6859 6868 +9
=========================================
Files 780 780
Lines 20728 20739 +11
Branches 2018 2018
=========================================
+ Hits 18574 18585 +11
Misses 1514 1514
Partials 640 640 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jack-berg
reviewed
Apr 10, 2025
Member
jack-berg
left a comment
There was a problem hiding this comment.
Thanks!
You'll also want to make sure OtlpMetricExporterProvider implementation follows the pattern of setting the meter provider using the AutoConfigureListener callback, following the example of logs and spans. e.g.: https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpLogRecordExporterProvider.java#L32-L99
jack-berg
approved these changes
Apr 17, 2025
Member
|
Thanks! Will merge after the conflict is resolved |
# Conflicts: # exporters/otlp/all/src/test/java/io/opentelemetry/exporter/otlp/http/metrics/OtlpHttpMetricExporterBuilderTest.java
555806f to
8673ef2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously there was no way to report stats for otlp metric exporters.
Now we can supply a MeterProvider lazily. When export is invoked if the previously provided meter is a noop implementation it will try again, allowing for delayed/lazy initialization.