Spec says:
Different Meters MUST be treated as separate namespaces. The names of the Instruments under one Meter SHOULD NOT interfere with Instruments under another Meter.
Usecase: I have an app that has a request_count
instrument to count requests. I consume an external library that also has a request_count
under a meter that it controls internally. I want to get metrics from both my app and from the external library.
Another example:
Meter Instrument Unit
My.Database.Instrumentation response_size 1 (= number of rows returned)
My.HttpClient.Instrumentation response_size Byte
Actual behavior: The instrument from the external library is ignored, even though it is from a different meter.
Usecase: I have an app that has a request_count
instrument to count requests. I consume a library that also has a request_count
under a meter that it controls internally. I add both meters with AddMeter
on my MeterProvider
. I want to create a view, to sum up both counters from the two meters
Actual behavior: It is not adding two counters together
The view name is saved into a dictionary, and upon the second instrument, the same view name is checked and the instrument is dropped.
Sample: https://github.com/dynatrace-oss-contrib/opentelemetry-dotnet/blob/metrics_tryout/docs/metrics/getting-started/Program.cs
(Uncoment the AddView
code)