Repository navigation
Report audit retention metrics - #6059
Open
warwickschroeder wants to merge 9 commits into
Open
warwickschroeder wants to merge 9 commits into
warwickschroeder wants to merge 9 commits into
Conversation
rbev
approved these changes
Oct 29, 2026
johnsimons
approved these changes
Oct 29, 2026
johnsimons
left a comment
Member
There was a problem hiding this comment.
Looks good, the only thing that may be nice is to also update the dashboard of Grafana in https://github.com/Particular/ServiceControl/blob/master/tools/testing-tool/TestingTool.AppHost/obs/grafana/dashboards/testing-tool.json
Contributor
Author
Will add to this PR. Thanks |
…on logic in AzureQueryTests
…into warwick/audit-retention-telemetry
rbev
enabled auto-merge (squash)
October 30, 2026 01:26
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.
What this adds
The audit instance's SQL Server and PostgreSQL retention sweep now emits retention instruments.
sc.retention.cycle_duration_secondsandsc.retention.consecutive_failures_totalon the audit meter, with the same descriptions, buckets andresultvalues as the error instance.rows_deleted_totalon the audit instance, because PostgreSQL drops whole partitions and a dropped partition reports no row count.retention.entityasaudit_messagesorsaga_snapshots, so a failing table no longer stops the other.failed, as the Audit retention check already counts it.failedfor both, the way an unreachable database shows on the error instance.docs/telemetry.md.Tests
ServiceControl.Audit.Persistence.Tests/EFCore/AuditRetentionMetricsTests(new): the instrument names, kinds, unit, buckets and meter, and how a cycle records success, failure and shutdown.ServiceControl.Audit.Persistence.Tests/EFCore/EFRetentionMetricsTests(new): on SQL Server and PostgreSQL, a sweep records one result per table, keeps the passes isolated, reports deferral, early failure and shutdown, and records nothing when skipped for the lock.ServiceControl.Audit.Persistence.Tests/EFCore/EFRetentionCustomCheckTests: a failing pass in either table turns the check red after three sweeps.