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.

Writing Custom Checks

NuGet Package:
NServiceBus.CustomChecks 6.x
Target Version:
NServiceBus 10.x

To create a custom check, create a new custom check class:

public class MyCustomCheck :
    CustomCheck
{
    public MyCustomCheck()
        : base("SomeId-StartUp", "SomeCategory")
    {

    }

    public override Task<CheckResult> PerformCheck(CancellationToken cancellationToken = default)
    {
        if (SomeService.GetStatus())
        {
            return CheckResult.Pass;
        }

        return CheckResult.Failed("Some service is not available.");
    }
}

When the custom check executes, it should return a pass or fail status and, in the case of failure, a descriptive message. This status and descriptive message will be sent to ServiceControl and will appear in the ServicePulse UI and in ServiceControl integration events.

All custom checks are executed when the endpoint starts up. If the optional interval is specified, the custom check will be executed periodically.

public class MyPeriodicCheck :
    CustomCheck
{
    public MyPeriodicCheck()
        : base("SomeId-Periodic", "SomeCategory", TimeSpan.FromSeconds(5))
    {
    }

    public override Task<CheckResult> PerformCheck(CancellationToken cancellationToken = default)
    {
        if (SomeService.GetStatus())
        {
            return CheckResult.Pass;
        }

        return CheckResult.Failed("Some service is not available.");
    }
}