Commit e0760b5
authored
fix(spanner): set gauge metric start time to match end time (#14289)
This commit fixes an InvalidArgument error ("One or more points were
written
more frequently than the maximum sampling period") when exporting gauge
metrics
like `open_connections` to Cloud Monitoring.
Previously, the time interval for these gauge metrics started from the
moment
the application booted up. This created long, continuously overlapping
time
intervals. Cloud Monitoring strictly rejected these because it requires
gauges
to be exact, point-in-time measurements, not long durations.
By simply setting the start time equal to the end time (`start = end`),
we
correctly format the data as instantaneous point-in-time snapshots. This
satisfies Cloud Monitoring's requirements and allows the metrics to
export
successfully on every cycle.1 parent 71df27f commit e0760b5
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
0 commit comments