Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SumAggregation #3390

Merged
merged 40 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a72aac2
Fix SumAggregation for delta temporality
ocelotl Jul 18, 2023
ae3ec6e
Use InMemoryMetricReader
ocelotl Aug 18, 2023
ad63075
Remove sleep
ocelotl Aug 22, 2023
ea299e6
Add test for the first collection cycle
ocelotl Aug 22, 2023
05d7e9b
Update opentelemetry-sdk/tests/metrics/integration_test/test_delta.py
ocelotl Aug 22, 2023
635ee2e
Remove unnecessary setup
ocelotl Aug 22, 2023
251da81
Fix lint
ocelotl Aug 22, 2023
1d22503
Move generator to specific test
ocelotl Aug 22, 2023
afb64f0
Rename to current_value_delta
ocelotl Aug 24, 2023
ea955ac
Create point directly inside condition
ocelotl Aug 24, 2023
002581d
Use previous_collection_start_nano
ocelotl Aug 24, 2023
1032fa7
Move common code out
ocelotl Aug 24, 2023
ad65dd2
Add previous_value_cumulative
ocelotl Aug 24, 2023
b7d9b46
Refactor comments.
ocelotl Aug 24, 2023
802af18
Remove use of current_point.value
ocelotl Aug 24, 2023
92fd0d4
Remove use of current_point.time_unix_nano
ocelotl Aug 24, 2023
199ea82
Remove use of previous_point.time_unix_nano
ocelotl Aug 24, 2023
e5e750b
Remove use of self._previous_point.value
ocelotl Aug 24, 2023
77be9a3
Separate case for synchronous instruments
ocelotl Aug 31, 2023
d0ce337
Rename current_value_delta to current_value
ocelotl Aug 31, 2023
b816549
Refactor remaining cases
ocelotl Aug 31, 2023
18cc8eb
Remove old code
ocelotl Aug 31, 2023
96592c2
Remove unused variables
ocelotl Aug 31, 2023
212f08b
Cleanup some variables
ocelotl Aug 31, 2023
fa78334
Add integration test cases
ocelotl Aug 31, 2023
8a1f022
Add another test case
ocelotl Aug 31, 2023
c12d50c
Add another test case
ocelotl Aug 31, 2023
21feafa
Add test case
ocelotl Aug 31, 2023
4cbb36f
Fix test cases
ocelotl Aug 31, 2023
6cc9c8d
Fix lint
ocelotl Aug 31, 2023
f26dd73
Rename test file
ocelotl Aug 31, 2023
a77697c
Add shutdown
ocelotl Aug 31, 2023
894484a
Skip windows test cases
ocelotl Aug 31, 2023
c0f33e0
Update changelog
ocelotl Sep 6, 2023
d8fc159
Udate integration tests
ocelotl Sep 8, 2023
289871e
Rename variables and add explanation
ocelotl Oct 5, 2023
d638fba
Use sleep to avoid resolution errors in Windows
ocelotl Oct 5, 2023
48a3e09
Revert "Use sleep to avoid resolution errors in Windows"
ocelotl Oct 5, 2023
1f0beab
Revert fix for the case when a measurement is None
ocelotl Oct 13, 2023
b1addb7
Fix test case callbacks for asynchronous instruments
ocelotl Oct 13, 2023
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

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


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

- Modify Prometheus exporter to translate non-monotonic Sums into Gauges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def conflicts(self, other: "_ViewInstrumentMatch") -> bool:
result
aabmass marked this conversation as resolved.
Show resolved Hide resolved
and self._aggregation._instrument_is_monotonic
== other._aggregation._instrument_is_monotonic
and self._aggregation._instrument_temporality
== other._aggregation._instrument_temporality
and self._aggregation._instrument_aggregation_temporality
== other._aggregation._instrument_aggregation_temporality
)

return result
Expand Down Expand Up @@ -124,15 +124,15 @@ def consume_measurement(self, measurement: Measurement) -> None:

def collect(
self,
aggregation_temporality: AggregationTemporality,
collection_aggregation_temporality: AggregationTemporality,
collection_start_nanos: int,
) -> Optional[Sequence[DataPointT]]:

data_points: List[DataPointT] = []
with self._lock:
for aggregation in self._attributes_aggregation.values():
data_point = aggregation.collect(
aggregation_temporality, collection_start_nanos
collection_aggregation_temporality, collection_start_nanos
)
if data_point is not None:
data_points.append(data_point)
Expand Down
Loading
Loading