Dela via


Microsoft.VisualStudio.Telemetry.Metrics Namespace

Classes

HistogramBuckets<T>

The set of buckets within the histogram.

HistogramConfiguration

Specifies the configuration of a histogram - which statistics to collect and which buckets to use.

HistogramStatistics<T>

Tracks the statistics for a histogram for a given scope (all-up or bucketized).

Instrument<T>

The base class for all non-observable instruments. Mirrored from: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.instrument-1?view=net-6.0.

Meter

Meter is the class responsible for creating and tracking the Instruments. Mirrored from: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.meter?view=net-6.0.

VSTelemetryMeterProvider

The MeterProvider is responsible for creating new meters with valid names + versions for the VS telemetry context.

Interfaces

ICounter<T>

A Counter, as defined by the OpenTelemetry standard. OpenTelemetry Spec: https://opentelemetry.io/docs/reference/specification/metrics/api/ .NET API spec: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.counter-1?view=net-6.0

This interface permits coding to the OpenTelemetry standard without upgrading our .NET Framework. Since it's the same standard, we can update implementations to a thin wrapper around OTel when ready. This also permits us to avoid re-instrumentation for developers.

IHistogram<T>

A Histogram, as defined by the OpenTelemetry standard. OpenTelemetry Spec: https://opentelemetry.io/docs/reference/specification/metrics/api/ .NET API spec: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.histogram-1?view=net-6.0

This interface permits coding to the OpenTelemetry standard without upgrading our .NET Framework. Since it's the same standard, we can update implementations to a thin wrapper around OTel when ready. This also permits us to avoid re-instrumentation for developers.

IInstrument

The base interface for all non-observable instruments. Mirrored from: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.instrument-1?view=net-6.0.

IMeter

Meter is the class responsible for creating and tracking the Instruments. Mirrored from: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.meter?view=net-6.0.

IMeterProvider

The MeterPRovider is responsible for creating new meters with valid names + versions for the context.

IVSCounter<T>

A Counter with support for exposing Sum + Count, which are not supported directly by OpenTelemetry counters. Taking a dependency on this histogram allows developers to use more convenient types. The cost of taking a dependency on the VS type is that it it can require additional dev work to move to OpenTelemetry.

IVSHistogram<T>

A Histogram with exposed Statistics + Buckets