opentelemetry.sdk.metrics.view¶
-
class
opentelemetry.sdk.metrics.view.
Aggregation
[source]¶ Bases:
abc.ABC
Base class for all aggregation types.
-
class
opentelemetry.sdk.metrics.view.
DefaultAggregation
[source]¶ Bases:
opentelemetry.sdk.metrics._internal.aggregation.Aggregation
The default aggregation to be used in a
View
.This aggregation will create an actual aggregation depending on the instrument type, as specified next:
Instrument
Aggregation
-
class
opentelemetry.sdk.metrics.view.
DropAggregation
[source]¶ Bases:
opentelemetry.sdk.metrics._internal.aggregation.Aggregation
Using this aggregation will make all measurements be ignored.
-
class
opentelemetry.sdk.metrics.view.
ExplicitBucketHistogramAggregation
(boundaries=(0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0), record_min_max=True)[source]¶ Bases:
opentelemetry.sdk.metrics._internal.aggregation.Aggregation
This aggregation informs the SDK to collect:
Count of Measurement values falling within explicit bucket boundaries.
Arithmetic sum of Measurement values in population. This SHOULD NOT be collected when used with instruments that record negative measurements, e.g. UpDownCounter or ObservableGauge.
Min (optional) Measurement value in population.
Max (optional) Measurement value in population.
-
class
opentelemetry.sdk.metrics.view.
ExponentialBucketHistogramAggregation
(max_size=160, max_scale=20)[source]¶ Bases:
opentelemetry.sdk.metrics._internal.aggregation.Aggregation
-
class
opentelemetry.sdk.metrics.view.
LastValueAggregation
[source]¶ Bases:
opentelemetry.sdk.metrics._internal.aggregation.Aggregation
This aggregation informs the SDK to collect:
The last Measurement.
The timestamp of the last Measurement.
-
class
opentelemetry.sdk.metrics.view.
SumAggregation
[source]¶ Bases:
opentelemetry.sdk.metrics._internal.aggregation.Aggregation
This aggregation informs the SDK to collect:
The arithmetic sum of Measurement values.
-
class
opentelemetry.sdk.metrics.view.
View
(instrument_type=None, instrument_name=None, meter_name=None, meter_version=None, meter_schema_url=None, name=None, description=None, attribute_keys=None, aggregation=None, instrument_unit=None)[source]¶ Bases:
object
A
View
configuration parameters can be used for the following purposes:Match instruments: When an instrument matches a view, measurements received by that instrument will be processed.
Customize metric streams: A metric stream is identified by a match between a view and an instrument and a set of attributes. The metric stream can be customized by certain attributes of the corresponding view.
The attributes documented next serve one of the previous two purposes.
- Parameters
instrument_type (
Optional
[Type
[Instrument
]]) – This is an instrument matching attribute: the class the instrument must be to match the view.instrument_name (
Optional
[str
]) – This is an instrument matching attribute: the name the instrument must have to match the view. Wild card characters are supported. Wild card characters should not be used with this attribute if the view has also aname
defined.meter_name (
Optional
[str
]) – This is an instrument matching attribute: the name the instrument meter must have to match the view.meter_version (
Optional
[str
]) – This is an instrument matching attribute: the version the instrument meter must have to match the view.meter_schema_url (
Optional
[str
]) – This is an instrument matching attribute: the schema URL the instrument meter must have to match the view.name (
Optional
[str
]) – This is a metric stream customizing attribute: the name of the metric stream. IfNone
, the name of the instrument will be used.description (
Optional
[str
]) – This is a metric stream customizing attribute: the description of the metric stream. IfNone
, the description of the instrument will be used.attribute_keys (
Optional
[Set
[str
]]) – This is a metric stream customizing attribute: this is a set of attribute keys. If notNone
then only the measurement attributes that are inattribute_keys
will be used to identify the metric stream.aggregation (
Optional
[Aggregation
]) – This is a metric stream customizing attribute: the aggregation instance to use when data is aggregated for the corresponding metrics stream. IfNone
an instance ofDefaultAggregation
will be used.instrument_unit (
Optional
[str
]) – This is an instrument matching attribute: the unit the instrument must have to match the view.
This class is not intended to be subclassed by the user.