Repository navigation
fix(telemetry): a Job pod exports its metrics while it runs - #5926
Conversation
A long command exports its metrics every OTEL_METRIC_EXPORT_INTERVAL ms (default 60000) through flush(), and SIGTERM exports once more before the process stops as it did with no handler.
0145f5b to
57d914a
Compare
|
Vet: SAFE. A thread exports the buffered metrics every |
🤖 I have created a release *beep* *boop* --- ## [0.160.1](v0.160.0...v0.160.1) (2026-11-16) ### Bug Fixes * **monitoring:** read AI spend from the gateway counter ([#5924](#5924)) ([f391129](f391129)) * **telemetry:** a Job pod exports its metrics while it runs ([#5926](#5926)) ([00bfc49](00bfc49)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
A long command, such as the command of a Job pod, exports its metrics every
OTEL_METRIC_EXPORT_INTERVALms (default 60000) from a thread that callsflush(). The DELTA reader, the OTLP/JSON encoding and_send_payloadstay.flush()holds collection and export under one lock, so a tick and the round flush of the Service do not pass each other. The SDKPeriodicExportingMetricReadercollects outside its export lock, so it is not used.devops_cli.entrysets a SIGTERM handler. It exports for at most 5 s, then does what the handler before did. The images rundevopsas PID 1, where the kernel dropped SIGTERM, so a runner ran on to SIGKILL and exported nothing.Concurrent Job pods keep the shared
service.instance.id.deltatocumulativedrops out-of-order and older-start points (812 and 363 of about 702000 in 7 days). A drop now loses one interval, not a run.Closes #5916
Change:
openspec/changes/archive/2026-11-16-5916-job-pod-metrics-export/