Skip to content
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

opencensusshim - OpenCensus metrics do not use AggregationTemporality from OpenTelemetry MetricExporter #7161

Open
EddeCCC opened this issue Feb 28, 2025 · 0 comments

Comments

@EddeCCC
Copy link

EddeCCC commented Feb 28, 2025

Greetings,

at the moment I am updating opentelemetry-opencensus-shim from 1.30.0-alpha to 1.47.0-alpha.

My application is still using OpenCensus to create metrics. However, I am using the MetricExporter from OpenTelemetry. After the update, I noticed when using a Delta AggregationTemporality for the MetricExporter, OpenCensus sums are still aggregated Cumulative. It worked prior to the update.

Previously, we build the SdkMeterProvider like this:

SdkMeterProvider meterProvider = SdkMeterProvider.builder()
                                                .setResource(resource)
                                                .registerMetricReader(OpenCensusMetrics.attachTo(metricReader))
                                                .build();

After the update, it looks like this:

SdkMeterProvider meterProvider = SdkMeterProvider.builder()
                                                .setResource(resource)
                                                .registerMetricReader(metricReader)
                                                .registerMetricProducer(OpenCensusMetricProducer.create())
                                                .build();

There has been a change, which removed OpenCensusMetrics.attachTo() and introduced the OpenCensusMetricProducer (see #5835).
However, this removes the link between the OpenTelemetry MetricReader and the OpenCensusMetricProducer. Thus, the configured AggregationTemporality of the MetricExporter can not be applied to OpenCensus metrics, as far as I understand.

Is this intended? Is there some workaround?

Thanks for any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant