Skip to content

Commit 5ce889f

Browse files
author
Alex Boten
authored
[docs] adding documentation for aggregation types (#2630)
1 parent 7647a11 commit 5ce889f

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

docs/sdk/metrics.aggregation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
opentelemetry.sdk._metrics.aggregation
2-
==========================================
2+
======================================
33

44
.. automodule:: opentelemetry.sdk._metrics.aggregation
55
:members:
66
:undoc-members:
7-
:show-inheritance:
7+
:no-show-inheritance:

docs/sdk/metrics.point.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ opentelemetry.sdk._metrics.point
44
.. automodule:: opentelemetry.sdk._metrics.point
55
:members:
66
:undoc-members:
7-
:show-inheritance:
7+
:no-show-inheritance:

opentelemetry-sdk/src/opentelemetry/sdk/_metrics/aggregation.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,19 @@ def _convert_aggregation_temporality(
419419

420420

421421
class ExplicitBucketHistogramAggregation(_AggregationFactory):
422+
"""This aggregation informs the SDK to collect:
423+
424+
- Count of Measurement values falling within explicit bucket boundaries.
425+
- 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.
426+
- Min (optional) Measurement value in population.
427+
- Max (optional) Measurement value in population.
428+
429+
430+
Args:
431+
boundaries: Array of increasing values representing explicit bucket boundary values.
432+
record_min_max: Whether to record min and max.
433+
"""
434+
422435
def __init__(
423436
self,
424437
boundaries: Sequence[float] = (
@@ -446,6 +459,11 @@ def _create_aggregation(self, instrument: Instrument) -> _Aggregation:
446459

447460

448461
class SumAggregation(_AggregationFactory):
462+
"""This aggregation informs the SDK to collect:
463+
464+
- The arithmetic sum of Measurement values.
465+
"""
466+
449467
def _create_aggregation(self, instrument: Instrument) -> _Aggregation:
450468

451469
temporality = AggregationTemporality.UNSPECIFIED
@@ -461,6 +479,13 @@ def _create_aggregation(self, instrument: Instrument) -> _Aggregation:
461479

462480

463481
class LastValueAggregation(_AggregationFactory):
482+
"""
483+
This aggregation informs the SDK to collect:
484+
485+
- The last Measurement.
486+
- The timestamp of the last Measurement.
487+
"""
488+
464489
def _create_aggregation(self, instrument: Instrument) -> _Aggregation:
465490
return _LastValueAggregation()
466491

opentelemetry-sdk/src/opentelemetry/sdk/_metrics/point.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Metric:
6363
"""Represents a metric point in the OpenTelemetry data model to be exported
6464
6565
Concrete metric types contain all the information as in the OTLP proto definitions
66-
(https://tinyurl.com/7h6yx24v) but are flattened as much as possible.
66+
(https://github.com/open-telemetry/opentelemetry-proto/blob/b43e9b18b76abf3ee040164b55b9c355217151f3/opentelemetry/proto/metrics/v1/metrics.proto#L37) but are flattened as much as possible.
6767
"""
6868

6969
# common fields to all metric kinds

0 commit comments

Comments
 (0)