Skip to content

Commit d054dff

Browse files
ocelotlaabmass
andauthored
Fix SumAggregation (#3390)
Co-authored-by: Aaron Abbott <[email protected]>
1 parent 0660924 commit d054dff

File tree

5 files changed

+698
-89
lines changed

5 files changed

+698
-89
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Fix `SumAggregation`
11+
 ([#3390](https://github.com/open-telemetry/opentelemetry-python/pull/3390))
1012
- Fix handling of empty metric collection cycles
1113
([#3335](https://github.com/open-telemetry/opentelemetry-python/pull/3335))
1214
- Fix error when no LoggerProvider configured for LoggingHandler
@@ -24,7 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2426
- Prometheus exporter support for auto instrumentation
2527
([#3413](https://github.com/open-telemetry/opentelemetry-python/pull/3413))
2628

27-
2829
## Version 1.20.0/0.41b0 (2023-09-04)
2930

3031
- Modify Prometheus exporter to translate non-monotonic Sums into Gauges

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def conflicts(self, other: "_ViewInstrumentMatch") -> bool:
7474
result
7575
and self._aggregation._instrument_is_monotonic
7676
== other._aggregation._instrument_is_monotonic
77-
and self._aggregation._instrument_temporality
78-
== other._aggregation._instrument_temporality
77+
and self._aggregation._instrument_aggregation_temporality
78+
== other._aggregation._instrument_aggregation_temporality
7979
)
8080

8181
return result
@@ -124,15 +124,15 @@ def consume_measurement(self, measurement: Measurement) -> None:
124124

125125
def collect(
126126
self,
127-
aggregation_temporality: AggregationTemporality,
127+
collection_aggregation_temporality: AggregationTemporality,
128128
collection_start_nanos: int,
129129
) -> Optional[Sequence[DataPointT]]:
130130

131131
data_points: List[DataPointT] = []
132132
with self._lock:
133133
for aggregation in self._attributes_aggregation.values():
134134
data_point = aggregation.collect(
135-
aggregation_temporality, collection_start_nanos
135+
collection_aggregation_temporality, collection_start_nanos
136136
)
137137
if data_point is not None:
138138
data_points.append(data_point)

0 commit comments

Comments
 (0)