O
observability-edot-dotnet-migrate
About observability-edot-dotnet-migrate
A migration skill for moving .NET applications from classic Elastic APM to Elastic Distribution of OpenTelemetry (EDOT). It identifies legacy configuration to remove and guides package setup, startup registration, and OTLP configuration.
Key features
- 01Remove classic APM packages and settings
- 02Add EDOT NuGet packages
- 03Register EDOT during startup
- 04Set required OTLP environment variables
- 05Avoid running classic APM and EDOT together
Use cases
- 01Migrate a .NET application from classic Elastic APM
- 02Replace legacy APM configuration with EDOT settings
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ elastic/ agent-skills --skill observability-edot-dotnet-migrateAfter installing, type/observability-edot-dotnet-migratein Claude Code to confirm it loaded.
Details
From the project READMEEDOT .NET Migration
Read the migration guide before making changes:
Guidelines
- Remove ALL classic APM references:
Elastic.Apm.*NuGet packages (includingElastic.Apm.NetCoreAll),UseAllElasticApm()/AddAllElasticApm()calls, theElasticApmsection fromappsettings.json, and allELASTIC_APM_*env vars - 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_NAME(replacesELASTIC_APM_SERVICE_NAME/ElasticApm:ServiceName)OTEL_EXPORTER_OTLP_ENDPOINT— must be the managed OTLP endpoint or EDOT Collector URL. Do NOT reuse the oldELASTIC_APM_SERVER_URLSvalue. 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>"(replacesELASTIC_APM_SECRET_TOKEN)
- Do NOT set
OTEL_TRACES_EXPORTER,OTEL_METRICS_EXPORTER, orOTEL_LOGS_EXPORTER— the defaults are already correct - Never run both classic Elastic APM agent (
Elastic.Apm.*) and EDOT on the same application
Examples
See the EDOT .NET migration guide for complete examples.
Comments
Markdown supported