opentelemetry-dotnet-contrib icon indicating copy to clipboard operation
opentelemetry-dotnet-contrib copied to clipboard

Add Metrics support for OpenTelemetry.Instrumentation.StackExchangeRedis

Open TotallyNotASecret opened this issue 2 years ago • 2 comments

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.

TotallyNotASecret avatar Aug 28 '23 11:08 TotallyNotASecret

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.

eerhardt avatar Sep 06 '23 16:09 eerhardt

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.

TotallyNotASecret avatar Sep 11 '23 08:09 TotallyNotASecret

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.

cijothomas avatar Feb 25 '24 18:02 cijothomas