Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit d9a74a1

Browse files
songy23c24t
authored andcommitted
Fix start time for Stackdriver Gauge metrics. (#585)
1 parent 49e4cb3 commit d9a74a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • contrib/opencensus-ext-stackdriver/opencensus/ext/stackdriver/stats_exporter

contrib/opencensus-ext-stackdriver/opencensus/ext/stackdriver/stats_exporter/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ def create_time_series_list(self, v_data, option_resource_type,
255255
if timestamp_start == timestamp_end:
256256
# avoiding start_time and end_time to be equal
257257
timestamp_start = timestamp_start - 1
258+
else:
259+
# For LastValue (Gauge), start and end time must be the same.
260+
timestamp_start = timestamp_end
258261

259262
start_time = point.interval.start_time
260263
start_time.seconds = int(timestamp_start)

0 commit comments

Comments
 (0)