Send Metrics data to ServiceControl

Component: Metrics.ServiceControl
NuGet Package NServiceBus.Metrics.ServiceControl (1.1)
Target NServiceBus Version: 5.x

The component NServiceBus.Metrics.ServiceControl enables sending monitoring data gathered with NServiceBus.Metrics to an instance of ServiceControl.Monitoring service.

Configuration

After adding the package to the project, metrics are sent to ServiceControl once enabled.

It can be enabled via:

1.x NServiceBus.Metrics.ServiceControl
const string SERVICE_CONTROL_METRICS_ADDRESS = "particular.monitoring";

busConfiguration.SendMetricDataToServiceControl(
    serviceControlMetricsAddress: SERVICE_CONTROL_METRICS_ADDRESS,
    instanceId: "INSTANCE_ID_OPTIONAL");

Service Control Metrics Address

The default instance name is particular.monitoring which is also used as the input queue for ServiceControl monitoring.

Interval

Specifies maximum delay for sending metrics report.

Instance Id

An override for $.diagnostics.hostid and $.diagnostics.hostdisplayname.

It is recommended to override the host id and host display name via NServiceBus core and to use the API without the InstanceId argument. By default, the monitoring plug-in will use these values to identify the monitored endpoint instances in the user-interface.

Make sure that the InstanceId value is logically unique and human readable.

A human readable value can be passed like in the following example:

1.x NServiceBus.Metrics.ServiceControl
const string SERVICE_CONTROL_METRICS_ADDRESS = "particular.monitoring";

var endpointName = "MyEndpoint";
var machineName = $"{Dns.GetHostName()}.{IPGlobalProperties.GetIPGlobalProperties().DomainName}";
var instanceIdentifier = $"{endpointName}@{machineName}";

busConfiguration.SendMetricDataToServiceControl(
    serviceControlMetricsAddress: SERVICE_CONTROL_METRICS_ADDRESS,
    instanceId: instanceIdentifier);
It is not required to add a process identification. The InstanceId does not require to be physically identifying the running instance uniquely. The plugin uses its own internal unique session identifier for this.

Azure host

The value of $.diagnostics.hostdisplayname is expected to be human readable. This might be problematic when using the Azure Host as it uses Role Name for the $.diagnostics.hostdisplayname, which results in the same display name for all instances.

Samples


Last modified