Monitoring
Configure `AddCustomOpenTelemetry`, service name, and connection strings for traces and downstream messaging visibility.
Contents On this page
Overview
Adds logging and tracing capability. By default it uses Azure Application Insights, Jaeger, and console tracing. The system configures MassTransit with RabbitMQ and MongoDB tracing:
- Console
- Jaeger
- Azure AppInsights
Installation
dotnet add package Genocs.Monitoring
Dependencies
- NONE
Usage
Extend Program.cs -> use services and configuration object instance. They are both available in ASP.NET Core framework.
services.AddCustomOpenTelemetry(configuration);
Options
appSettings:serviceName - sets the service name used by Jaeger.
connectionStrings:applicationInsights - sets the Azure Application Insights connection string. Null or empty to disable.
monitoring:jaeger - sets the jaeger url to be used. Null or empty to disable.
appsettings.json
"AppSettings": {
"ServiceName": "Service WebApi",
},
"ConnectionStrings": {
"ApplicationInsights": "InstrumentationKey=<<your instrumentation key>>;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/"
},
"Monitoring": {
"Jaeger": "localhost"
}
Reference documentation
There is no separate Genocs.Monitoring page in the current v9.0 package index; telemetry and logging overlap is covered in Genocs.Logging (v9.0). Library versions for other releases.