Commit 9db9693
committed
fix(spanner): set gauge metric start time to match end time
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 370e0ed commit 9db9693
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