The SagaAudit plugin enables the Saga View feature in ServiceInsight. It is built specifically to help developers verify Saga logic during development. It does this by capturing Saga message behavior and changes in Saga data/state as the Saga is being processed. It then sends this information to a ServiceControl endpoint setup in the development environment.
The SagaAudit plugin captures the following information:
- The incoming messages (including timeouts) that initiate change in the saga.
- The outgoing messages that the saga sends.
- A snapshot of the current saga data.
- The saga state
All this information is sent to and stored in ServiceControl. Note that the saga audit data is transmitted to ServiceControl via a message and is serialized using the built in JSON Serializer of NServiceBus.
This plugin results in an increase in load in several areas
- Endpoint load in order to capture the required information
- Network load due to the extra information sent to ServiceControl
- ServiceControl load in the areas of ingestion, correlation and data cleanup.
The increase in load is proportional to size of the saga data multiplied by the number of messages the the saga receives. Since both these variables are dependent on the specific saga implementation it is not possible to give accurate predictions on the impact of this load in a production system.
The following SagaAudit plugin packages have been deprecated and unlisted. If using one of these versions replace package references to use NServiceBus.SagaAudit.
Plugins send messages using the defined endpoint transport to ServiceControl. The plugin must be configured with the location of the ServiceControl input queue. This queue is created during the installation of ServiceControl. The queue name is based on the ServiceControl instance name which is visible in the ServiceControl Management utility.
Configure the ServiceControl queue via config:
<appSettings> <add key="ServiceControl/Queue" value="particular.servicecontrol@machine" /> </appSettings>
Removing the plugin before deployment to production depends on how the plugin is configured.
Disable plugin in production via config:
- Stop the endpoint.
- Delete the SagaAudit plugin dll from the endpoint's bin directory.
- If there is an automated deployment processes in place, ensure that this dll is no longer included.
- Restart the endpoint.
Disabling the SagaAudit plugin will stop sending the saga state change messages to ServiceControl reducing message load to ServiceControl. Turn it back on if or when needed.
To temporarily start visualizing a saga in production, the Saga Audit plugin can be deployed with the endpoint hosting the saga. Deploy the assembly at the same location as the endpoint is running, configure it and restart the endpoint. Use ServiceInsight to view the visualization and when done, follow the steps above to remove the plugin and restart the service.