Add Metrics support for OpenTelemetry.Instrumentation.StackExchangeRedis
Issue with OpenTelemetry.Instrumentation.StackExchangeRedis
List of all OpenTelemetry NuGet packages and version that you are using:
- OpenTelemetry.Exporter.Prometheus.AspNetCore 1.5.0-rc.1
- OpenTelemetry.Extensions.Hosting 1.5.1
- OpenTelemetry.Instrumentation.AspNetCore 1.5.1-beta.1
- OpenTelemetry.Instrumentation.StackExchangeRedis 1.0.0-rc9.10
- OpenTelemetry.Instrumentation.Http 1.5.1-beta.1
Runtime version:
- net6.0
Is this a feature request or a bug?
- Feature Request
What is the expected behavior?
It should be possible to use AddRedisInstrumentation with MeterProviderBuilder.
What is the actual behavior?
It is currently not possible.
What metrics would you like to see emitted?
Note that I have an initial draft PR of using System.Diagnostics.Metrics in StackExchange.Redis directly. Once this work is complete, we wouldn't need an Instrumentation assembly to get these metrics. Instead, the client library will emit them itself.
The metrics in the PR you linked seem OK. It would still be nice to be able to call AddRedisInstrumentation on a MeterProviderBuilder to add all the metrics to the OpenTelemetry exporters used in a project, like you currently can with a TracerProviderBuilder.
It would still be nice to be able to call AddRedisInstrumentation on a MeterProviderBuilder
No reason the native instrumentation cannot provide an extension method like that, though it is not needed to enable metrics from - just need to call AddMeter(name of meter used by the library.)
Closing the issue here, as there is some work going on to make this occur natively.