Skip to content

Commit 4881cc1

Browse files
fix(spanner): use current export time for gauge intervals instead of static meter start time
1 parent 2c99011 commit 4881cc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spanner/metrics_monitoring_exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func toNonemptyTimeIntervalpb(start, end time.Time, isGauge bool) (*monitoringpb
359359
// previous interval, for all non-gauge types.
360360
// https://cloud.google.com/monitoring/api/ref_v3/rpc/google.monitoring.v3#timeinterval
361361
if isGauge {
362-
end = start
362+
start = end
363363
} else if end.Sub(start).Milliseconds() <= 1 {
364364
end = start.Add(time.Millisecond)
365365
}

0 commit comments

Comments
 (0)