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

Set _LastValueAggregation start_time_unix_nano to None #4004

Merged
merged 6 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def collect(

return NumberDataPoint(
attributes=self._attributes,
start_time_unix_nano=0,
start_time_unix_nano=None,
ocelotl marked this conversation as resolved.
Show resolved Hide resolved
time_unix_nano=collection_start_nano,
value=value,
)
Expand Down
4 changes: 4 additions & 0 deletions opentelemetry-sdk/tests/metrics/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def test_collect(self):

self.assertEqual(first_number_data_point.value, 1)

self.assertIsNone(first_number_data_point.start_time_unix_nano)

last_value_aggregation.aggregate(measurement(1))

# CI fails the last assertion without this
Expand All @@ -249,6 +251,8 @@ def test_collect(self):

self.assertEqual(second_number_data_point.value, 1)

self.assertIsNone(second_number_data_point.start_time_unix_nano)

self.assertGreater(
second_number_data_point.time_unix_nano,
first_number_data_point.time_unix_nano,
Expand Down
Loading