Skip to content

Why can 'System.Diagnostics.Metrics' instruments be created with invalid names as per the OpenTelemetry spec? #3250

Answered by cijothomas
julealgon asked this question in Q&A
Discussion options

You must be logged in to vote

Within OTel, instrument creation is not considered a Startup thing. i.e Instruments can be created any time in the application lifetime. And the general principle in OpenTelemetry, is NOT to throw exceptions at runtime. (The only time OTel will throw exception is at the startup i.e when building the OTel providers, and for any other time - only option is to log and move on..)

Also, " Meter's CreateCounter" , is part of the .NET's runtime (https://github.com/dotnet/runtime), and it can be used even outside of OpenTelemetry. So it is unlikely that it can do validations based on OpenTelemetry rules and throw.

I think it'd be good to point users to the troubleshooting guide right from the get…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@cijothomas
Comment options

@julealgon
Comment options

@cijothomas
Comment options

@ejsmith
Comment options

@cijothomas
Comment options

Answer selected by cijothomas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants