Skip to main content

Observability

Monitor Excalibur applications with OpenTelemetry, health checks, and integrations.

Start here

The Production Observability Guide explains which metrics matter, what to alert on, and how to build dashboards that tell you something useful.

Before You Start

  • .NET 8.0+ (or .NET 9/10 for latest features)
  • Install the required package:
    dotnet add package Excalibur.Dispatch
  • For cloud-specific instrumentation, install the provider package (e.g., Excalibur.Dispatch.Observability)
  • Familiarity with OpenTelemetry concepts and Dispatch pipeline

Monitoring Integrations

PlatformGuideDescription
Telemetry ConfigurationSetupConfigure OpenTelemetry meters and tracing
Metric Naming ConventionsReferenceMeter and instrument naming patterns
Metrics ReferenceReferenceComplete metrics catalog
Health ChecksBuilt-inApplication health monitoring
Azure MonitorCloudAzure Application Insights
AWS CloudWatchCloudAWS monitoring and logging
Google CloudCloudGCP monitoring
DatadogAPMDatadog integration
GrafanaDashboardsPre-built dashboards

OpenTelemetry

Dispatch provides native OpenTelemetry support for distributed tracing and metrics. Use the UseOpenTelemetry() convenience method to enable both:

builder.Services.AddDispatch(dispatch =>
{
dispatch.UseOpenTelemetry(); // Enables tracing + metrics (recommended)
});

Or enable them individually for more control:

builder.Services.AddDispatch(dispatch =>
{
dispatch.UseTracing(); // Distributed tracing only
dispatch.UseMetrics(); // Metrics only
});

This registers:

  • TracingMiddleware - Creates OpenTelemetry spans for each message
  • MetricsMiddleware - Records processing duration, success/failure counts
  • IDispatchMetrics - Meter definitions for Excalibur.Dispatch.Core

Meter Registration

Register all framework meters at once using the convenience methods:

builder.Services.AddOpenTelemetry()
.AddAllDispatchMetrics()
.AddAllDispatchTracing();

Or register selectively using meter name patterns:

builder.Services.AddOpenTelemetry()
.WithMetrics(metrics =>
{
metrics.AddMeter("Excalibur.Dispatch.*"); // Core, circuit breaker, streaming
metrics.AddMeter("Excalibur.Dispatch.Transport.*"); // Transport-layer metrics (Kafka, RabbitMQ, etc.)
metrics.AddMeter("Excalibur.Data.*"); // Persistence, CDC, audit metrics
metrics.AddMeter("Excalibur.EventSourcing.*"); // Event store metrics
});

See Telemetry Configuration for the full setup guide and Metrics Reference for the complete catalog of 100+ metrics.

See Also