Meter class

SDK implementation of the APIMeter interface.

A Meter is the entry point for creating instruments that collect measurements for a specific instrumentation scope. Meters are obtained from a MeterProvider, and each Meter is associated with a specific instrumentation library, version, and optional schema URL.

The Meter follows the OpenTelemetry metrics data model which consists of instruments that record measurements, which are then aggregated into metrics. This implementation delegates to the API implementation while adding SDK-specific behaviors.

More information: https://opentelemetry.io/docs/specs/otel/metrics/api/ https://opentelemetry.io/docs/specs/otel/metrics/sdk/

Implemented types

Properties

attributes → Attributes?
Gets the attributes associated with this meter.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
name → String
Gets the name of the instrumentation scope.
no setteroverride
provider → MeterProvider
Gets the MeterProvider that created this Meter.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemaUrl → String?
Gets the schema URL of the instrumentation scope.
no setteroverride
version → String?
Gets the version of the instrumentation scope.
no setteroverride

Methods

createCounter<T extends num>({required String name, String? unit, String? description, InstrumentAdvisory? advisory}) → APICounter<T>
Creates a Counter instrument for recording cumulative, monotonically increasing values.
override
createGauge<T extends num>({required String name, String? unit, String? description, InstrumentAdvisory? advisory}) → APIGauge<T>
Creates a Gauge instrument for recording the current value at the time of measurement.
override
createHistogram<T extends num>({required String name, String? unit, String? description, List<double>? boundaries, InstrumentAdvisory? advisory}) → APIHistogram<T>
Creates a Histogram instrument for recording a distribution of values.
override
createObservableCounter<T extends num>({required String name, String? unit, String? description, InstrumentAdvisory? advisory, List<ObservableCallback<T>> callbacks = const [], ObservableCallback<T>? callback}) → APIObservableCounter<T>
Creates an ObservableCounter instrument for asynchronously recording cumulative, monotonically increasing values.
override
createObservableGauge<T extends num>({required String name, String? unit, String? description, InstrumentAdvisory? advisory, List<ObservableCallback<T>> callbacks = const [], ObservableCallback<T>? callback}) → APIObservableGauge<T>
Creates an ObservableGauge instrument for asynchronously recording the current value at collection time.
override
createObservableUpDownCounter<T extends num>({required String name, String? unit, String? description, InstrumentAdvisory? advisory, List<ObservableCallback<T>> callbacks = const [], ObservableCallback<T>? callback}) → APIObservableUpDownCounter<T>
Creates an ObservableUpDownCounter instrument for asynchronously recording cumulative values that can increase or decrease.
override
createUpDownCounter<T extends num>({required String name, String? unit, String? description, InstrumentAdvisory? advisory}) → APIUpDownCounter<T>
Creates an UpDownCounter instrument for recording cumulative values that can increase or decrease.
override
isEnabled() → bool
Indicates whether this meter is enabled.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerBatchCallback(BatchObservableCallback callback, Set<APIObservableInstrument> instruments) → APIBatchCallbackRegistration
Registers one callback that observes several of this meter's asynchronous instruments at once.
override
runBatchCallbacks() → void
Invokes every registered batch callback once, queuing its observations on the instruments it covers for their next collect().
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited