O
observability-edot-dotnet-instrument
About observability-edot-dotnet-instrument
A setup skill for instrumenting .NET applications with Elastic Distribution of OpenTelemetry (EDOT). It covers package installation, startup registration, and required OTLP settings without manually configuring providers.
Key features
- 01Add EDOT NuGet packages
- 02Register EDOT during startup
- 03Set required OTLP environment variables
- 04Use a managed OTLP endpoint or EDOT Collector
- 05Avoid classic APM and EDOT together
Use cases
- 01Instrument an ASP.NET Core application
- 02Configure telemetry export for a .NET service
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ elastic/ agent-skills --skill observability-edot-dotnet-instrumentAfter installing, type/observability-edot-dotnet-instrumentin Claude Code to confirm it loaded.
Details
From the project READMEEDOT .NET Instrumentation
Read the setup guide before making changes:
Guidelines
- Add NuGet packages:
Elastic.OpenTelemetryandOpenTelemetry.Instrumentation.AspNetCore(for ASP.NET Core apps) - Register EDOT in startup: call
builder.AddElasticOpenTelemetry()on theIHostApplicationBuilder(inProgram.csor equivalent). Without this, no telemetry is collected - Set exactly three required environment variables:
OTEL_SERVICE_NAMEOTEL_EXPORTER_OTLP_ENDPOINT— must be the managed OTLP endpoint or EDOT Collector URL. Never use an APM Server URL (noapm-server, no:8200, no/intake/v2/events)OTEL_EXPORTER_OTLP_HEADERS—"Authorization=ApiKey <key>"or"Authorization=Bearer <token>"
- Do NOT set
OTEL_TRACES_EXPORTER,OTEL_METRICS_EXPORTER, orOTEL_LOGS_EXPORTER— the defaults are already correct - Do NOT manually configure
TracerProviderorMeterProvider—AddElasticOpenTelemetry()handles everything - Never run both classic Elastic APM agent (
Elastic.Apm.*) and EDOT on the same application
Examples
See the EDOT .NET setup guide for complete examples.
Comments
Markdown supported