Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small fixes
  • Loading branch information
ocelotl committed Mar 28, 2022
commit 8e475ffec4b48d4e8fa6d887a6b014b8cfdfa81f
18 changes: 11 additions & 7 deletions opentelemetry-sdk/src/opentelemetry/sdk/_metrics/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ class DefaultAggregation(_AggregationFactory):
This aggregation will create an actual aggregation depending on the
instrument type, as specified next:

`Counter` → `SumAggregation`
`UpDownCounter` → `SumAggregation`
`ObservableCounter` → `SumAggregation`
`ObservableUpDownCounter` → `SumAggregation`
`Histogram` → `ExplicitBucketHistogramAggregation`
`ObservableGauge` → `LastValueAggregation`
========================= ====================================
Instrument Aggregation
========================= ====================================
`Counter` `SumAggregation`
`UpDownCounter` `SumAggregation`
`ObservableCounter` `SumAggregation`
`ObservableUpDownCounter` `SumAggregation`
`Histogram` `ExplicitBucketHistogramAggregation`
`ObservableGauge` `LastValueAggregation`
========================= ====================================
"""

def _create_aggregation(self, instrument: Instrument) -> _Aggregation:
Expand Down Expand Up @@ -125,7 +129,7 @@ def _create_aggregation(self, instrument: Instrument) -> _Aggregation:
if isinstance(instrument, ObservableGauge):
return _LastValueAggregation()

raise Exception("Invalid aggregation type found")
raise Exception("Invalid instrument type found")


class _SumAggregation(_Aggregation[Sum]):
Expand Down