You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(webapp,clickhouse): measure the task events a failed flush loses
Adds two metrics to the task event flush path, and fixes one that could
not be trusted.
`ingest.flush.items_lost` counts the items in a batch abandoned after
its retries are exhausted, so a flush failure is measurable in items
rather than only in batches. Batch counts understate the loss whenever
batch sizes differ between producers: a producer with large batches can
account for almost all the lost items while contributing a fraction of
the failed batches.
`ingest.flush.oldest_pending_age` reports the age of the oldest item not
yet stored, counting a batch waiting in the queue, one waiting on a
concurrency slot, and one being retried, so a flush that has stalled
shows up as a rising age rather than as silence. It reads 0 when nothing
is pending. Both instruments are per-process and carry only a
`scheduler` attribute, so aggregate them with `max` rather than `sum`.
`totalQueuedItems` was decremented only when a flush succeeded, so a
batch abandoned after its retries left the queue-depth gauge permanently
inflated and a leak read as a backlog. The depth is now released on the
abandoned path too, with a regression test.
On the ClickHouse client, a failed insert now increments
`clickhouse.query.errors` with the operation name and the ClickHouse
error type. None of the insert paths recorded to that counter before, so
it only ever saw reads and an insert failure registered nothing at all.
`InsertError` also carries `clickhouseErrorType`, as `QueryError`
already did, so a caller can tell a schema mismatch from a transient
fault without parsing the message.
Mono-RevId: 706c9716b58c1c3016054c837d7744f4de9b9390
0 commit comments