Skip to content

feat(event_queue): get_many outcome metrics + wider get latency buckets - #215

Merged
extreme4all merged 2 commits into
developfrom
feat/queue-get-many-outcome-metrics
Sep 29, 2026
Merged

extreme4all merged 2 commits into
developfrom
feat/queue-get-many-outcome-metrics

Conversation

@extreme4all

Copy link
Copy Markdown
Contributor

What

  • Widen event_queue_get_seconds histogram buckets from a 10s cap up to 30s (adds 15/20/30s, lower buckets untouched)
  • Add event_queue_get_many_outcomes_total{queue, outcome} counter recording every successful get_many as full, partial, or empty
  • Grafana queue dashboard: new stacked "get_many outcomes per second" panel

Why

  • The latency histogram capped at 10s, so get_one idle waits (aiokafka getone() blocks until a record exists) all collapsed into the overflow bucket
  • For get_many we want to know whether calls came back with the desired records or hit the consume timeout. len(result) < count exactly identifies timeout-driven returns in the kafka batcher loop (a full batch always reaches size >= count first), so no protocol or adapter changes were needed
  • outcome distinguishes fully-empty polls from partial batches

Notes

  • No config, interface, or adapter changes; memory backend empty polls count as empty outcomes
  • kafka get_many can overshoot count across partitions, so >= count maps to full

Testing

  • uv run mypy clean
  • uv run ruff check / uv run ruff format --check . clean
  • uv run pytest — 200 passed (new: parametrized _get_many_outcome classification + outcome/error metric tests)

@extreme4all
extreme4all merged commit 81149d9 into develop Sep 29, 2026
14 checks passed
@extreme4all
extreme4all deleted the feat/queue-get-many-outcome-metrics branch September 29, 2026 14:41
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