Repository navigation
refactor: replay metrics come from spans, and ReplayMetrics is gone - #401
Merged
Merged
Conversation
EventReplayService leaves a span where it used to record each metric (replay.session_created, replay.session_started, replay.status_change, replay.event, replay.batch, replay.session_completed, replay.target), and the API's scheduler runs report_sessions every 10 s for the sessions per status and the loaded events still to send. The queue size gauge loses its session_id label (fixes #318), and the active sessions panel sums running and paused from the per-status gauge instead of a separate counter. Part of #389.
HardMax71
enabled auto-merge (squash)
October 18, 2026 23:36
|
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❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes
🚀 New features to boost your workflow:
|
6 of 17 tasks
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
Part of #389, the replay area, and fixes #318: the replay queue size gauge carried a
session_idlabel, so every session left its own series behind. The fifteen instruments inReplayMetricsnow come from spans.Changes
EventReplayServiceleaves a span where it used to record each metric:replay.session_created,replay.session_started,replay.status_change,replay.event,replay.batch,replay.session_completedandreplay.target. The collector'ssignaltometricsconnector turns them into the same series. The API's scheduler gets one more job: every 10 sreport_sessionsreports the sessions held per status, zeros included, and the loaded events still to send, summed over sessions.replay_sessions_activegoes, since running plus paused from the per-status gauge is the same number, and the dashboard panel now sums those. Labels take the span attribute names (replay_status,replay_target, ...).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 570 passed, contract 3 passed, e2e 488 passed and 1 skipped. Four real sessions run from the API container gave exactly the expected totals at the collector (4 created, 4 batches of 10, speed multipliers summing to 398). Duration and throughput are only unit-tested: no live session could complete, since main's dispatch job skips its own next run when the delay is short.
Checklist
pre-commit run --all-filesand all checks passSummary by cubic
Moves replay metrics from the
ReplayMetricsinstruments to spans that the collector'ssignaltometricsconnector turns into the same series, deletingReplayMetricsas part of #389. Fixes #318 by dropping thesession_idlabel from the queue size gauge, which had created a series per session.EventReplayServicenow recordsreplay.session_created,replay.session_started,replay.status_change,replay.event,replay.batch,replay.session_completed, andreplay.targetspans.report_sessionsevery 10 s to report sessions per status (zeros included) and loaded events still to send.replay_sessions_activeis gone; the dashboard panel sums running and paused from the per-status gauge instead.replay_status,replay_target, ...).Written for commit a56db99. Summary will update on new commits.