Skip to content

RabbitMQ usage reports generated by the platform do not include VHost scope information #5642

Description

@PhilBastian

Describe the bug

Description

The scope value recorded against a queue in the usage report is used by Particular's internal validation tooling to assist in grouping queues into endpoints. This value is missing from reports generated by the platform against a RabbitMQ transport, whereas it is recorded correctly when running the standalone tool.

Expected behavior

Scope value of the VirtualHost is recorded against every RabbitMQ queue reported in a usage report, as per the behaviour in the standalone tool.

Actual behavior

Scope value of empty string is recorded

Versions

Please list the version of the relevant packages or applications in which the bug exists.
all

Steps to reproduce

  • run ServiceControl against a RabbitMQ broker with a VirtualHost other than the default
  • Generate a usage report. Scope is set to "" instead of the VirtualHost name

Relevant log output

Additional Information

Workarounds

Possible solutions

We have issues with any potential solution:

  • the EndpointDocumentId is currently formed from the QueueName and ThroughputSource (Audit/Monitoring/Broker).
  • Currently a user could stop ServiceControl, change the connection string to point to another VirtualHost, restart ServiceControl and any existing records will take on throughput values from any queues which happen to match the name of queues in the old VirtualHost
  • Attempting to add Scope to the EndpointDocumentId will work for RabbitMQ, since SC can only run against a single VHost, but could potentially cause issues with SQL transports where multiple schemas can exist in a single catalog.
    • SQL transports also prepend the scope (catalog & schema) to the queue name

Additional information

The EndpointDocument records are used for storing the throughput against a queue, sourced from Audit, Monitoring and Broker where available. Part of the metadata against the EndpointDocument record is the Scope of the queue. In the standalone throughput collection tool, scope is used for our SQL transports to capture the Catalog and Schema and for RabbitMQ transport to capture the VirtualHost. In ServiceControl throughput collection however, the RabbitMQ transport always sets the Scope to null.

It's possible that this behaviour was a deliberate decision (since it's explicitly set to null) based on ServiceControl only being able to connect to a single RabbitMQ VirtualHost. If this is the case, then the reason for the different behaviour in the throughput tool should be investigated. The Scope value is useful for Particular's internal validation tooling.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions