website/src/docs/nitro/open-telemetry/service-monitoring.md
Nitro’s OpenTelemetry support extends beyond GraphQL, allowing you to gather and analyze telemetry data from any .NET application. Whether you have REST APIs, background workers, or other services, you can seamlessly centralize logging and tracing in Nitro for a unified observability experience.
Note: If you are looking specifically for GraphQL telemetry, please refer to the Operation Monitoring section.
ChilliCream.Nitro meta-package and the ChilliCream.Nitro.OpenTelemetry package.In your .NET project, install the following NuGet packages if they are not already present:
dotnet add package ChilliCream.Nitro
dotnet add package ChilliCream.Nitro.OpenTelemetry
dotnet add package OpenTelemetry --version <appropriate version>
dotnet add package OpenTelemetry.Extensions.Hosting --version <appropriate version>
Register the Nitro connection and OpenTelemetry exporters. Call AddNitro with your API credentials, then chain AddOpenTelemetry() to register the OTLP exporters for tracing, metrics, and logging. For example, in your Program.cs or Startup.cs:
services
.AddNitro(options =>
{
options.ApiId = apiId; // Replace with your Nitro API ID
options.ApiKey = apiKey; // Replace with your Nitro API Key
options.Stage = stage; // Replace with your environment or stage name
})
.AddOpenTelemetry();
You can continue configuring OpenTelemetry providers for non-Nitro instrumentation as needed, such as for ASP.NET Core or HTTP requests.
dotnet add package OpenTelemetry.Extensions.Hosting
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
services.ConfigureOpenTelemetryTracerProvider(x =>
{
x.AddAspNetCoreInstrumentation();
});
Once your service is running, head over to the Nitro dashboard.
You’ll see a unified view of all the HTTP requests, background worker jobs, or other .NET processes you’re tracking through OpenTelemetry.