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

[Feature]: Implement MetricProducer #2505

Open
divergentdave opened this issue Jan 10, 2025 · 0 comments
Open

[Feature]: Implement MetricProducer #2505

divergentdave opened this issue Jan 10, 2025 · 0 comments
Labels
enhancement New feature or request triage:todo Needs to be traiged.

Comments

@divergentdave
Copy link
Contributor

Related Problems?

This was removed in #2105 to reduce scope prior to 1.0.

Describe the solution you'd like:

I wanted to file a feature request for the eventual re-implementation of this part of the spec, and share my use case for it.

I'm using MetricProducer from opentelemetry_sdk v0.24.1 to adapt runtime metrics from the Tokio async runtime library, and to export them alongside application-defined metrics that use the OpenTelemetry SDK in a more traditional way. My main reason for using a MetricProducer is that it lets me create a HistogramDataPoint from already-aggregated histogram counter values produced by the Tokio library. Each Tokio worker thread has an array of histogram counters representing different buckets, and these counters are incremented during performance-sensitive operations by the library. When MetricProducer::produce() is called, my implementation reads those per-thread bucket counts, and outputs a HistogramDataPoint. I cannot use SDK histogram instruments, because Tokio does not expose the elapsed time underlying this histogram to user code, only the already-aggregated histogram, and the only API that SDK histogram instruments provide is record().

For reference, here's the source: https://github.com/divviup/janus/blob/e21f8663ad33902b03f5cf627b9cb6223646ad1f/aggregator/src/metrics/tokio_runtime.rs

Considered Alternatives

No response

Additional Context

MetricProducer is defined in the specification.

@divergentdave divergentdave added enhancement New feature or request triage:todo Needs to be traiged. labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage:todo Needs to be traiged.
Projects
None yet
Development

No branches or pull requests

1 participant