opentelemetry-dotnet-contrib
opentelemetry-dotnet-contrib copied to clipboard
What is the difference to `OpenTelemetry.Instrumentation.Runtime`
What is the difference to the OpenTelemetry.Instrumentation.Runtime package and which one should you use to collect runtime metrics.
It seems like those two packages expose some identical metrics.
EventCounter instruemntation is general purpose - it can subscribe to any configured EventCounters, and turn them into OTel metrics.
Runtime instrumentation - is a instrumentation for a set of runtime metrics. The list is documented in the readme file. (A lot of these metrics are also published via EventCounter as well.)
Once ready, EventCounter instrumentation will allow you to get a lot more metrics than runtime. This is simply because a lot more components write metrics using EventCounter.
To add to @cijothomas comment
The recommendation will be to use OpenTelemetry.Instrumentation.Runtime for any metrics it exposes instead of using OpenTelemetry.Instrumentation.EventCounters. The implementation of Runtime will provide more up-to-date values and will likely waste less CPU cycles since it is written in an on-demand way rather than the EventCounters which uses polling.
I am currently working on making the EventCounters instrumentation stable and one part of that is also the exclusion of any metrics that are made available from the Runtime package. Keep in mind the specification here is still not stable, but that is the current plan.