Skip to content

fix(telemetry): seconds bucket bounds on every *_seconds histogram - #92

Merged
braghettos merged 1 commit into
mainfrom
fix/seconds-histogram-buckets
Nov 15, 2026
Merged

braghettos merged 1 commit into
mainfrom
fix/seconds-histogram-buckets

Conversation

@braghettos

Copy link
Copy Markdown
Collaborator

The 13 duration histograms were created with no bucket bounds, and
telemetry.Setup's provider has no View, so the SDK's defaults applied:
[0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000].
Those bounds suit milliseconds. On a seconds metric, everything under 5 s
lands in one bucket, so a quantile is only a coarse upper bound.
observability found it on krateo-057 (2026-11-15): reconcile means of
2.8-7.9 s all reported their p95 in the 75-250 s buckets.

Each histogram now carries explicit bounds, from 1 ms to 10000 s: the
list the composition-dynamic-controller's own histograms already use, so
the two families compare bucket for bucket. The bounds are set on the
instrument (metric.WithExplicitBucketBoundaries), so they apply under any
provider, including a caller's own via NewWithMeter. A provider View
still overrides them. Names and units are unchanged; only the bucket
boundaries a consumer sees change.

Test: every collected histogram (13, counted) carries the bounds, and a
0.3 s and a 2.8 s reconcile land in two different buckets. Mutants, each
killed (3/3): reconcile.duration on the defaults; oldest_item_age on the
defaults; the old millisecond list. Unit tests (18 packages) and vet
under every tag pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N8HNbBzRpE6rUjMRzosAjG

The 13 duration histograms were created with no bucket bounds, and
telemetry.Setup's provider has no View, so the SDK's defaults applied:
[0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000].
Those bounds suit milliseconds. On a seconds metric, everything under 5 s
lands in one bucket, so a quantile is only a coarse upper bound.
observability found it on krateo-057 (2026-11-15): reconcile means of
2.8-7.9 s all reported their p95 in the 75-250 s buckets.

Each histogram now carries explicit bounds, from 1 ms to 10000 s: the
list the composition-dynamic-controller's own histograms already use, so
the two families compare bucket for bucket. The bounds are set on the
instrument (metric.WithExplicitBucketBoundaries), so they apply under any
provider, including a caller's own via NewWithMeter. A provider View
still overrides them. Names and units are unchanged; only the bucket
boundaries a consumer sees change.

Test: every collected histogram (13, counted) carries the bounds, and a
0.3 s and a 2.8 s reconcile land in two different buckets. Mutants, each
killed (3/3): reconcile.duration on the defaults; oldest_item_age on the
defaults; the old millisecond list. Unit tests (18 packages) and vet
under every tag pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N8HNbBzRpE6rUjMRzosAjG
@braghettos
braghettos merged commit 9d4caf9 into main Nov 15, 2026
16 checks passed
braghettos added a commit to krateo-platformops/core-provider that referenced this pull request Nov 15, 2026
v1.20.1 carries krateo-platformops/unstructured-runtime#92 alone: the 13
unstructured_runtime.*_seconds histograms used the OTel SDK's default
bounds, which suit milliseconds. On seconds values, every reconcile under
5 s fell in one bucket, so a p95 read 75-250 s against means of 2.8-7.9 s
(observability, krateo-057, 2026-11-15). They now use 1 ms .. 10000 s, the
list the cdc's own composition_*_duration_seconds histograms already use.

Consumer-visible: only ExplicitBounds on those histograms; names, units
and attributes are unchanged. observability checked 057's readers: the
only bucket readers are on span metrics, and obs-reconcile-perf reads UR
histograms as Sum/Count only. The cutover is per pod, at the cdc roll.

Only the cdc moves. chart-inspector pins unstructured-runtime v1.7.5 and
records its own metrics. cdc unit tests (18 packages), vet under every
tag, and the image-style build pass.


Claude-Session: https://claude.ai/code/session_01N8HNbBzRpE6rUjMRzosAjG

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant