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

What is the difference to `OpenTelemetry.Instrumentation.Runtime`

Open msschl opened this issue 3 years ago • 1 comments

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.

msschl avatar Jul 26 '22 16:07 msschl

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.

cijothomas avatar Aug 04 '22 00:08 cijothomas

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.

mic-max avatar Aug 31 '22 22:08 mic-max