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