MeterProvider class

SDK implementation of the APIMeterProvider interface.

The MeterProvider is the entry point to the metrics API. It is responsible for creating and managing Meters, as well as configuring the metric pipeline via MetricReaders and Views.

This implementation delegates some functionality to the API MeterProvider implementation while adding SDK-specific behaviors.

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

Implemented types

Properties

delegate → APIMeterProvider
The underlying API MeterProvider implementation.
final
enabled ↔ bool
Gets whether this meter provider is enabled.
getter/setter pairoverride
endpoint ↔ String
Gets the endpoint URL where metrics data is sent.
getter/setter pairoverride
exemplarFilter ↔ ExemplarFilter
The ExemplarFilter used by this provider's meters.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isShutdown ↔ bool
Gets whether this meter provider has been shut down.
getter/setter pairoverride
metricReaders → List<MetricReader>
Gets all metric readers associated with this MeterProvider.
no setter
resource ↔ Resource?
The resource associated with this MeterProvider.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serviceName ↔ String
Gets the name of the service being instrumented.
getter/setter pairoverride
serviceVersion ↔ String?
Gets the version of the service being instrumented.
getter/setter pairoverride
views → List<View>
Gets all views configured for this MeterProvider.
no setter

Methods

addMetricReader(MetricReader reader) → void
Adds a MetricReader to this MeterProvider.
addView(View view) → void
Adds a View to this MeterProvider.
collectAllMetrics() → Future<List<Metric>>
Collects all metrics from all instruments across all meters.
forceFlush() → Future<bool>
Force flushes metrics through all associated MetricReaders.
override
getMeter({required String name, String? version, String? schemaUrl, Attributes? attributes}) → APIMeter
Returns a APIMeter with the given name and version.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerInstrument(String instrumentName, SDKInstrument instrument) → void
Registers an instrument with this provider.
shutdown() → Future<bool>
Shuts down this MeterProvider and all associated resources.
override
toString() → String
A string representation of this object.
inherited

Operators

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