fix: name audit logger service for health checks - #23582
Open
exocognosis wants to merge 1 commit into
Open
Conversation
product-security-plaid-production
Bot
requested review from
bolekk and
russell-stern
August 28, 2026 17:29
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
注册 for free
to join this conversation on GitHub.
Already have an account?
登录 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
Fixes #23571.
Enabling
AuditLoggercreated anAuditLoggerServicewith the unnamed application logger. The service returned an empty value fromName(). The health checker rejects services with empty names, so application construction failed before the audit logger could start or contact its configured endpoint.Proposed solution
Assign the canonical
AuditLoggername inside新建AuditLoggerbefore applying the caller helper offset. Service naming is a health-reporting invariant, so the constructor now guarantees that every enabled audit logger can be registered regardless of how its caller configured the parent logger.The existing audit flow test now passes an unnamed logger, which matches the production call path. A focused regression test creates an enabled audit logger from an unnamed logger and registers it with the real health checker. The test verifies both the canonical service name and successful registration.
The change also includes a patch changeset with the
#bugfixand#nopsrelease tags.Behavior after this change
When audit logging is enabled:
AuditLoggeras its health-check name.Validation
go test ./core/logger/audit -run '^TestAuditLoggerRegistersForHealthChecks$' -count=1go test -race ./core/logger/audit -run '^TestAuditLoggerRegistersForHealthChecks$' -count=1go vet ./core/logger/auditgolangci-lint v2.13.1 run ./core/logger/audit/... --new-from-rev=origin/develop --max-same-issues=0 --max-issues-per-linter=0bash .github/scripts/check-changeset-tags.sh .changeset/fix-audit-logger-startup.mdgit diff --checkThe database-backed
TestCheckLoginAuditLogtest was compiled but not executed locally because the required PostgreSQL test database was not configured. 仓库 CI will run that test with its database environment.Requires
None.
Supports