Repository navigation
refactor: event, idempotency and SSE metrics come from spans, and the last metric classes are gone - #407
Merged
HardMax71 merged 1 commit intoOct 19, 2026
Conversation
… last metric classes are gone events.published and event.processing.duration are defined on the producer's existing publish_event span, which now gets its tracer through the constructor. IdempotencyManager runs each check in an idempotency.check span and leaves spans for blocked duplicates and finished keys; the worker counts the keys in Redis every 30 s instead of every process scanning Redis at each export. SSERedisBus leaves a span per message and per closed stream, and the API reports open streams every 10 s. EventMetrics, IdempotencyMetrics, ConnectionMetrics, BaseMetrics and MetricsProvider go, and app/core/metrics keeps only setup_metrics for the instrumentations. The docs on the queue and idempotency pages still described the old classes and now point at the span metrics. Closes #389.
HardMax71
enabled auto-merge (squash)
October 19, 2026 00:50
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3 of 17 tasks
HardMax71
deleted the
refactor/event-idempotency-sse-metrics-from-spans
branch
October 19, 2026 01:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Closes #389, the last area: the eleven instruments in
EventMetrics,IdempotencyMetricsandConnectionMetricsnow come from spans, so no hand-written metric class is left.app/core/metricskeeps onlysetup_metrics, the OTLPMeterProviderthe instrumentations use.Changes
events.publishedandevent.processing.durationare defined on the producer's existingpublish_eventspan, without an error status, and the dashboards keep theirevent_typelabel. The producer now gets its tracer through the constructor instead of a module-level one.IdempotencyManagerruns each check in anidempotency.checkspan with hit or miss and leaves spans for blocked duplicates and finished keys. The worker counts the keys in Redis every 30 s; before, both processes scanned Redis at every export.SSERedisBusleaves a span per message and per closed stream, and the API reports open streams every 10 s.BaseMetricsandMetricsProvidergo, the contract test checks the span definitions only, and the queue and idempotency pages lose the stale class descriptions.Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)./deploy.sh openapi, then./deploy.sh types), never edited by handValidation: unit 571 passed, contract 3 passed, e2e 489 passed and 1 skipped. After the suite, the worker's series held 263 publishes with 263 durations, 222 reserved and 222 finished keys, and 229 live keys. An SSE probe gave 2 messages, 1 closed stream and 0 open after closing.
Checklist
pre-commit run --all-filesand all checks passSummary by cubic
Closes #389: the last eleven hand-written metric classes are gone. Event, idempotency, and SSE metrics now come from spans translated by the collector's
signaltometricsconnector, andapp/core/metricskeeps onlysetup_metricsfor the OTLPMeterProvider.Behavior changes
events.publishedandevent.processing.durationcome from the producer'spublish_eventspan; failed publishes record error spans and are not counted.sse_endpoint,sse_event_type).Written for commit 101d990. Summary will update on new commits.