You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
There is no way to configure custom metric exporters.
SdkMeterProviderConfigurer provides a hook to register views and set the resource via configure(SdkMeterProviderBuilder meterProviderBuilder). However, this is insufficient for customizing metric exporter configuration since both push (IntervalMetricReader) and pull (PrometheusCollector) based exporters require access to a built SdkMeterProvider. If you were to call SdkMeterProviderBuilder#build() in configure(SdkMeterProviderBuilder), you'd have access to a different instance the one that gets registered globally.
Describe the solution you'd like
I'd like to extend SdkMeterProviderConfigurer with an additional callback method which would be invoked after the SdkMeterProvider has been built and registered globally. This would provide a place to customize metric exporters and IntervalMetricReader in ways not exposed by autoconfigure env vars / system properties.
/** Callback which is invoked after the {@link SdkMeterProvider} has been built and registered globally. */
default void callback(SdkMeterProvider sdkMeterProvider) {}
Describe alternatives you've considered
Also considered adding ConfigurableMetricExporterProvider akin to ConfigureableSpanExporterProvider, but doesn't solve the problem because metric exporters also need an IntervalMetricReader (or in prometheus' case a server to expose the data). Unclear how that would be exposed via SPI and tie in neatly with ConfigurableMetricExporterProvider.
Additional context
I'm trying to use SPI hooks to customize OtlpGrpcMetricExporter to set my own MangedChannel which is configured with retry logic in accordance with the spec but can't. I opened Issue #3271 to separately address adding retry logic to the OTLP exporters.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
There is no way to configure custom metric exporters.
SdkMeterProviderConfigurer
provides a hook to register views and set the resource viaconfigure(SdkMeterProviderBuilder meterProviderBuilder)
. However, this is insufficient for customizing metric exporter configuration since both push (IntervalMetricReader
) and pull (PrometheusCollector
) based exporters require access to a builtSdkMeterProvider
. If you were to callSdkMeterProviderBuilder#build()
inconfigure(SdkMeterProviderBuilder)
, you'd have access to a different instance the one that gets registered globally.Describe the solution you'd like
I'd like to extend
SdkMeterProviderConfigurer
with an additional callback method which would be invoked after theSdkMeterProvider
has been built and registered globally. This would provide a place to customize metric exporters andIntervalMetricReader
in ways not exposed by autoconfigure env vars / system properties.Describe alternatives you've considered
Also considered adding
ConfigurableMetricExporterProvider
akin toConfigureableSpanExporterProvider
, but doesn't solve the problem because metric exporters also need anIntervalMetricReader
(or in prometheus' case a server to expose the data). Unclear how that would be exposed via SPI and tie in neatly withConfigurableMetricExporterProvider
.Additional context
I'm trying to use SPI hooks to customize
OtlpGrpcMetricExporter
to set my ownMangedChannel
which is configured with retry logic in accordance with the spec but can't. I opened Issue #3271 to separately address adding retry logic to the OTLP exporters.The text was updated successfully, but these errors were encountered: