-
Notifications
You must be signed in to change notification settings - Fork 941
Add metrics for PeriodicMetricReader #8038
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
Add metrics for PeriodicMetricReader #8038
Conversation
|
|
||
| /** | ||
| * Sets the {@link MeterProvider} to export metrics about this {@link PeriodicMetricReader} to. | ||
| * Automatically called by the meter provide the reader is registered to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't think of a reason to not do this
sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/export/PeriodicMetricReader.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8038 +/- ##
============================================
+ Coverage 90.16% 90.24% +0.07%
- Complexity 7478 7608 +130
============================================
Files 834 839 +5
Lines 22559 22846 +287
Branches 2239 2276 +37
============================================
+ Hits 20341 20618 +277
- Misses 1515 1519 +4
- Partials 703 709 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| private Scheduled() {} | ||
|
|
||
| void setMeterProvider(MeterProvider meterProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void setMeterProvider(MeterProvider meterProvider) { | |
| private void setMeterProvider(MeterProvider meterProvider) { |
sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java
Outdated
Show resolved
Hide resolved
|
|
||
| /** | ||
| * Sets the {@link MeterProvider} to export metrics about this {@link PeriodicMetricReader} to. | ||
| * Automatically called by the meter provider the reader is registered to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes me think that SdkTracerProvider, SdkLoggerProvider should cascade set meter provider on all child components (i.e. BatchSpanProcessor, exporters, etc). Problem is, the setMeterProvider methods on child components are on the builders... Probably could have had something more elegant with some foresight. Too bad.
This adds the last SDK metric, for the metric reader. Been a while since previous PR since I forgot about it 😅
https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#metric-otelsdkmetric_readercollectionduration