Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.55k stars 2.77k forks source link

azure.monitor.opentelemetry.exporter add support for stable metrics export in opentelemetry 1.12 #25663

Closed jenshnielsen closed 2 years ago

jenshnielsen commented 2 years ago

Is your feature request related to a problem? Please describe.

It looks like the newly released stable version of opentelemetry 1.12.0 broke the telemetry exporter in azure.monitor.opentelemetry.exporter

Describe the solution you'd like

Adapt to match stable api in opentelemetry 1.12

There seems to be two changes required.

AzureMonitorMetricExporter does not implement the abstract method force_flush as defined by opentelemetry.sdk.metrics.export.MetricExporter

BaseExporter.__init__ does not call the base classes __init__ using super causing the two private attributes self._preferred_temporality and self._preferred_aggregation to not be set. PeriodicExportingMetricReader expects these to be present in the exported class given to it.

Describe alternatives you've considered

Continue using unstable api from rc does not seem like a viable solution.

Additional context

xiangyan99 commented 2 years ago

Thanks for the feedback, we’ll investigate asap.

rakshith91 commented 2 years ago

@lzchen can you take a look ?

lzchen commented 2 years ago

https://github.com/Azure/azure-sdk-for-python/pull/25659