AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/monitoring/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Consume raw data from Metrics

Component:
Metrics
NuGet Package:
NServiceBus.Metrics 6.x
Target Version:
NServiceBus 10.x

When Performance Counters reporting and ServiceControl reporting are not enough, it's possible to consume raw metrics data by directly attaching them to the public API provided by the package. First, the Metrics themselves need to be enabled. Then, a custom reporter can be attached to send data to any collector e.g. Service Control, Azure Application Insights, etc.

Enabling NServiceBus.Metrics

var metrics = endpointConfiguration.EnableMetrics();

Reporting metrics data

Metrics can be reported in a few different ways.

To any external storage

Custom observers might be registered to access every value reported by probes.

var durationsLog = LogManager.GetLogger("Durations");
var signalsLog = LogManager.GetLogger("Signals");

metrics.RegisterObservers(
    register: context =>
    {
        foreach (var duration in context.Durations)
        {
            duration.Register(
                observer: (ref DurationEvent @event) =>
                {
                    durationsLog.DebugFormat("{0} = {1}", duration.Name, @event.Duration);
                });
        }
        foreach (var signal in context.Signals)
        {
            signal.Register(
                observer: (ref SignalEvent @event) =>
                {
                    signalsLog.DebugFormat("{0} = {1}", signal.Name, @event.MessageType);
                });
        }
    });

List of Samples

Related Articles