This module provides .NET Aspire integration for VirtoCommerce Platform, enabling OpenTelemetry observability, health checks, and service discovery when running under Aspire AppHost.
- OpenTelemetry Integration: Automatic metrics, tracing, and logging instrumentation
- Health Checks: Additional health check endpoints for Aspire monitoring
- Service Discovery: Automatic service-to-service discovery via Aspire
- HTTP Resilience: Built-in retry and circuit breaker patterns for HTTP clients
- Conditional Activation: Only enabled when running under Aspire or explicitly configured
- .NET 8.0
- VirtoCommerce Platform 3.916.0+
- .NET Aspire (for local development)
- Copy the module to your
modulesdirectory (or reference it from your module discovery path) - The module will be automatically discovered and loaded by VirtoCommerce Platform
The module automatically detects when running under Aspire by checking for:
DOTNET_RESOURCE_SERVICE_ENDPOINT_URLenvironment variable (set by Aspire)
To explicitly enable/disable the module, add to appsettings.json:
{
"Aspire": {
"Enabled": true // Set to true to enable, false to disable
}
}The module automatically uses the OTLP exporter if OTEL_EXPORTER_OTLP_ENDPOINT is configured (which Aspire sets automatically).
- OpenTelemetry Logging: Integrated via Serilog sink using
ILoggerConfigurationService - OpenTelemetry Metrics: ASP.NET Core, HTTP Client, and Runtime instrumentation
- OpenTelemetry Tracing: ASP.NET Core and HTTP Client instrumentation
- Health Checks: Default liveness health check with tag
["live"] - Service Discovery: Automatic service endpoint resolution
- HTTP Client Defaults: Resilience patterns and service discovery
Currently, the module doesn't register additional endpoints as the platform already provides /health endpoint which includes all registered health checks.
When running under Aspire AppHost:
- The module automatically detects Aspire environment variables
- OpenTelemetry data flows to Aspire Dashboard
- Health checks are available for monitoring
- Service discovery enables automatic connection string injection
aspire-integration-module/
└── src/
└── VirtoCommerce.AspireIntegration.Web/
├── Module.cs # Module initialization
├── ServiceCollectionExtensions.cs # Aspire service registration
├── module.manifest # Module metadata
└── VirtoCommerce.AspireIntegration.Web.csproj
- VirtoCommerce.Platform.Core - Module system and ILoggerConfigurationService
- OpenTelemetry packages - Observability (metrics and tracing)
- Serilog.Sinks.OpenTelemetry - Serilog integration for OpenTelemetry logs
- Microsoft.Extensions.ServiceDiscovery - Service discovery
- Microsoft.Extensions.Http.Resilience - HTTP resilience patterns
- This module is designed for local development with Aspire
- It does not modify core VirtoCommerce Platform code
- All Aspire features are conditionally enabled
- The module can be safely included in production builds but will only activate when Aspire environment variables are present
- Check that
Aspire:Enabledis set totruein appsettings.json, OR - Verify that Aspire environment variables are present when running under AppHost
- Ensure
OTEL_EXPORTER_OTLP_ENDPOINTis configured (Aspire sets this automatically) - Check Aspire Dashboard for telemetry data
- Health checks are included in the platform's existing
/healthendpoint - The module adds health checks but doesn't create new endpoints