- MeterProvider — the entry point and factory for Meters.
- Meter — a factory that creates instruments for a specific instrumentation scope (a library or component).
- Instrument — the metric primitives (counters, histograms, gauges, etc.) used to record measurements.

Core components: MeterProvider, Meter, Instrument
Think of the MeterProvider as the top-level factory and configuration point; it produces Meters for each instrumentation scope. Each Meter then creates and owns Instruments that your code uses to record telemetry.



Using the global default MeterProvider is convenient for most applications. Create a custom MeterProvider only when you need separate configuration or isolation (for example, to separate business metrics from runtime or platform metrics).
MeterProvider in detail
The MeterProvider is the API/SDK entry point that exposesgetMeter(...) to obtain a Meter for an instrumentation scope. Typical getMeter arguments are:
name(required) — identifies the instrumentation scope (usually a library or component name).version(optional) — the version of the library or component.schema_url(optional) — the semantic conventions schema URL.
version and schema_url are optional, but including them gives downstream processors and exporters richer context for interpretation and mapping.


Meter responsibilities
A Meter’s role is instrument creation and lifetime management. Common factory methods include:- Synchronous Counter and UpDownCounter
- Asynchronous counters and gauges (callback-driven)
- Histogram
- Gauge-like instruments

Instruments: properties and typing
An Instrument represents a metric you record and is defined by several properties:- Name (for example,
payments.processed_total,http.server.duration) - Kind (counter, histogram, gauge, asynchronous counter, etc.)
- Unit (for example,
ms,kB,1) - Description (human-readable purpose)
- Data type (integer vs floating point)

Typical instrument types and use cases
| Instrument type | Typical use case | Notes |
|---|---|---|
| Counter | Count events that only increase (e.g., requests processed) | Monotonic |
| UpDownCounter | Track values that can increase/decrease (e.g., concurrent users) | Non-monotonic |
| Histogram | Measure distributions (e.g., request latency) | Produces buckets & summary |
| Asynchronous Gauge | Periodic measurements (e.g., free memory) | Uses callbacks to observe values |
| Asynchronous Counter | Periodic monotonic totals (e.g., cumulative bytes sent) | Uses callbacks |
Example process hierarchy
Below is a concrete example of how a MeterProvider can produce multiple Meters, each with typed, named Instruments. This structure isolates metrics by instrumentation scope and makes them traceable to their origin.How metrics flow (SDK responsibilities)
Once your application records measurements, the SDK handles:- Aggregation (via Aggregators) — summarizing raw measurement points (sum, last value, histograms)
- Views — a configuration layer that can rename metrics, change aggregation, or filter instruments without changing instrumentation code
- Exporting — shipping metrics to a backend using exporters (commonly OTLP)
- Resource detection — adding contextual attributes (service name, host, container)
- Optional sampling and filters — used to reduce cardinality or volume when necessary
- OpenTelemetry API: stable interfaces for metrics, traces, and logs.
- SDK: concrete implementation that collects, aggregates, and exports telemetry.
- MeterProvider: factory + central configuration for metrics.
- Meter: instrumentation scope and instrument factory.
- Instruments: the primitives used to record measurements.
- View: configuration layer to reshape metrics collection and aggregation without changing the code.
- Aggregator: converts raw measurements into summarized metrics.
- Exporter: ships metrics to backends (see OTLP for a common protocol).
- Resource detectors: capture environment/contextual attributes.
- Sampling/filters: reduce cardinality or volume when needed.
