Skip to content

Read the audit instance name from instance_name when collecting audit queues - #5973

Merged
rbev merged 2 commits into
masterfrom
john/audit_instance_name_queue
Oct 14, 2026
Merged

rbev merged 2 commits into
masterfrom
john/audit_instance_name_queue

Conversation

@johnsimons

@johnsimons johnsimons commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

AuditQuery.GetAuditRemotes reads each audit instance's GET /api/configuration response and collects the queues that belong to that instance. It looked for the instance name under host.service_name. Audit 5.5.0 renamed the setting from ServiceName to InstanceName (#4313), and the response has carried host.instance_name since then, so the lookup has not matched any audit instance from 5.5.0 on.

Effect

The collected queues end up in AuditThroughputCollectorHostedService.AuditQueues, which PlatformEndpointHelper.IsPlatformEndpoint uses to keep ServiceControl's own queues out of throughput data. The instance name is the audit instance's input queue. An audit instance whose name starts with the primary's queue name and a dot, such as the default Particular.ServiceControl.Audit, is still excluded by a separate prefix rule. An audit instance with any other name has had its input queue included in broker throughput as if it were an endpoint.

Change

Read host.instance_name, and fall back to host.service_name for audit instances older than 5.5.0.

Testing

  • New test Should_include_the_input_queue_named_after_the_audit_instance, built on the shape of a real /api/configuration response captured from an audit instance. One case uses instance_name (6.21.0) and one uses service_name (5.4.0). The instance_name case fails without the fix.
  • Particular.LicensingComponent.UnitTests: 91/91.

Newer ServiceControl Audit versions (6.21.0+) expose the instance name as
"instance_name" in the host configuration instead of "service_name". Check
for "instance_name" first and fall back to "service_name" for older
instances, so the input queue is still added to the remote's queue list.
@johnsimons johnsimons self-assigned this Oct 9, 2026
@johnsimons johnsimons changed the title Prefer instance_name over service_name for the audit queue Read the audit instance name from instance_name when collecting audit queues Oct 9, 2026
Comment thread src/Particular.LicensingComponent.UnitTests/AuditQuery_Tests.cs
@rbev
rbev enabled auto-merge (squash) October 14, 2026 05:52
@rbev
rbev merged commit b4b09d1 into master Oct 14, 2026
36 checks passed
@rbev
rbev deleted the john/audit_instance_name_queue branch October 14, 2026 06:02
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.

3 participants