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.

Metrics

NuGet Package:
NServiceBus.Metrics 5.x
Target Version:
NServiceBus 9.x

The Metrics plugin collects metric data about the performance of running endpoints. This data can be forwarded to a ServiceControl monitoring instance and viewed in ServicePulse.

To see performance monitoring in action, try the standalone demo.

For a full list of the performance metrics captured and their formal definitions, see Metric definitions.

graph LR subgraph Endpoint Metrics[Metrics<br>Plugin] -- Metric Data --> MetricsSC[Metrics<br>ServiceControl<br>Plugin] end MetricsSC -- Metric Data --> MQ MQ[Monitoring Queue] -- Metric Data --> Monitoring[ServiceControl<br>Monitoring<br>Instance] Monitoring -- Endpoint<br>performance<br>data --> ServicePulse

Set up metrics

To enable collecting metrics in an environment:

  1. Install a ServiceControl monitoring instance
  2. Install and configure the ServiceControl Metrics plugin in each endpoint
  3. (MSMQ Transport only) Install the MSMQ queue length reporter in each endpoint
  4. View the performance data collected for endpoints in ServicePulse

Performance impact on system resources

A ServiceControl monitoring instance is more lightweight than a regular ServiceControl instance. However, hosting a monitoring instance and production endpoint instances on the same machine is not recommended.

Wire usage

Each endpoint instance collects performance metrics, which are buffered and then sent. A single metrics message contains a batch of values written in a compact binary format, making reporting very lightweight.

Storage usage

A Service Control Monitoring instance processes metrics. Metrics data is stored in RAM only, for at most one hour. Logfiles are still written to disk. A 100MB process can hold metrics data for at least 100 endpoint instances.

CPU usage

The metrics service is only performing simple summing aggregation logic. The CPU usage is low.

Reporting metric data to other places

List of Samples

Related Articles