ServiceControl is the backend for ServicePulse. It is a background process that collects useful information about an NServiceBus system. This includes:
- Messages that cannot be processed, along with their exceptions
- Every message flowing through the system
- Saga state changes
- Endpoint heartbeats
- Detailed performance metrics
ServiceControl can also be used to perform custom checks. All this information is exposed to ServicePulse via an HTTP API.
Refer to the Particular Service Platform article for more information on how ServiceControl and ServicePulse work together. Refer to the how does ServiceControl work article for a quick overview of the different instances, what they do, and how to configure endpoints.
ServiceControl instance types
There are three types of instances that can be created:
- Error instances are the most commonly used ServiceControl instance and are indispensable to ensure the smooth operation of an NServiceBus system. Together with ServicePulse (which can be hosted by a ServiceControl Error instance), they provide the ability to visualize and retry failed messages.
- Audit instances provide valuable information about the message flow through a system. These instances are used by ServicePulse to help visualize a distributed system.
- Monitoring instances provide performance monitoring and metrics analytics that are useful for keeping track of the health of a distributed system.
Connecting endpoints to ServiceControl
NServiceBus endpoints must be configured to send data about their operations to a set of centralized queues. ServiceControl monitors these queues, then collects and processes the data from the NServiceBus endpoints.
Data is sent to queues even when ServiceControl is down. When ServiceControl becomes available, it will process the messages that were stored in the queue while it was offline.
To enable ServiceControl to gather this information, configure the endpoints appropriately:
- Configure recoverability to collect failed messages.
- Enable auditing to collect all messages.
- Install plugins to monitor endpoint health, collect saga state changes, and use custom checks.
See Optimizing ServiceControl for use in different environments for more information about practical considerations.