Replies: 1 comment
-
This will work for some, but not others, which makes it problematic. For Redis for instance, you need access to the There is an Otel SIG ongoing about how this might work to enable standardisation of these. Right now, you can enable Metrics this way (since there is nothing that needs configuring), it's part of the core of how .NET IMetricsBuilder works. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is convenient for all the instrumentation libraries to provide nice helpers such as
.AddRedisInstrumentation()
or.AddHttpClientInstrumentation()
etc. In other cases I may want to provide a list of sources or meters from configuration. The reason for this is you may want to enable or disable certain meters or trace sources differently per environment. Also, you may find your production environment is missing or have too many traces or metrics (you know you can never have enough metrics :-). Having to recompile/create a new runtime image to adjust the list is undesirable.It would be nice to have something like the following code. I can see there could be more overloads of the configuration extensions. This code could be included in the core dotnet sdk, or I could see another opt in contrib library like
OpenTelemetry.Extensions.Configuration
appsettings.Production.json
and loading the sources like:
Sample usage:
Beta Was this translation helpful? Give feedback.
All reactions