
Observability Edot Dotnet Migrate
Migrate a .NET app from Elastic.Apm.* to Elastic.OpenTelemetry (EDOT) with correct OTLP export and startup registration.
Overview
observability-edot-dotnet-migrate is an agent skill most often used in Operate (also Ship and Build) that migrates .NET apps from Elastic APM packages to the EDOT .NET OpenTelemetry SDK with OTLP export.
Install
npx skills add https://github.com/elastic/agent-skills --skill observability-edot-dotnet-migrateWhat is this skill?
- Removes all Elastic.Apm.* packages, UseAllElasticApm/AddAllElasticApm, ElasticApm config, and ELASTIC_APM_* env vars
- Adds Elastic.OpenTelemetry plus OpenTelemetry.Instrumentation.AspNetCore for ASP.NET Core
- Requires builder.AddElasticOpenTelemetry() on IHostApplicationBuilder—no registration means no telemetry
- Exactly three required env vars: OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT (managed OTLP or EDOT Collector), OTEL_E
- Points to official Elastic migration, setup, and configuration docs before code changes
- Three required environment variables for EDOT OTLP export after migration
- Guideline list covers full removal of Elastic.Apm.* references before adding Elastic.OpenTelemetry
Adoption & trust: 932 installs on skills.sh; 502 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your .NET service still runs Elastic.Apm.* but you need Elastic’s OpenTelemetry-based EDOT SDK without conflicting agents or wrong export endpoints.
Who is it for?
Solo maintainers of ASP.NET Core or .NET host apps on Elastic who are standardizing on OpenTelemetry export.
Skip if: Greenfield apps with no APM installed, non-.NET runtimes, or teams staying on classic Elastic APM indefinitely.
When should I use this skill?
Switching a .NET application from Elastic.Apm.* packages to the EDOT .NET SDK and Elastic.OpenTelemetry.
What do I get? / Deliverables
Classic APM is fully removed, EDOT is registered at startup, and OTLP env vars point at the managed endpoint or EDOT Collector with a defined service name.
- Program.cs (or host builder) registering AddElasticOpenTelemetry
- Updated csproj without Elastic.Apm.* and with Elastic.OpenTelemetry packages
- OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, and OTEL_EXPORTER_OTLP_HEADERS configuration
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Observability migration is shelved under Operate/monitoring because it sustains production telemetry after the app exists. Monitoring subphase matches replacing APM agents, OTLP endpoints, and service naming for ongoing trace and metric export.
Where it fits
Replace classic APM packages in a live API so traces flow to Elastic via OTLP without duplicate instrumentation.
Verify OTEL_SERVICE_NAME and OTLP headers before a release so launch checks see the new EDOT pipeline.
Scaffold Program.cs with AddElasticOpenTelemetry while removing NetCoreAll from a forked template project.
How it compares
Opinionated Elastic EDOT migration checklist—not a generic OpenTelemetry tutorial for every vendor.
Common Questions / FAQ
Who is observability-edot-dotnet-migrate for?
.NET solo builders and small teams responsible for production telemetry who are moving from Elastic APM agents to Elastic.OpenTelemetry.
When should I use observability-edot-dotnet-migrate?
Use in Operate/monitoring when switching packages and env vars; also during Ship/security or launch prep when validating observability before go-live, and in Build/backend when scaffolding a migrated service.
Is observability-edot-dotnet-migrate safe to install?
It guides dependency and config edits that affect production signals; review the Security Audits panel on this Prism page and test migrations in staging first.
SKILL.md
READMESKILL.md - Observability Edot Dotnet Migrate
# EDOT .NET Migration Read the migration guide before making changes: - [Migration guide](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/migration) - [EDOT .NET setup](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/setup) - [EDOT .NET configuration](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/configuration) ## Guidelines 1. Remove ALL classic APM references: `Elastic.Apm.*` NuGet packages (including `Elastic.Apm.NetCoreAll`), `UseAllElasticApm()` / `AddAllElasticApm()` calls, the `ElasticApm` section from `appsettings.json`, and all `ELASTIC_APM_*` env vars 1. Add NuGet packages: `Elastic.OpenTelemetry` and `OpenTelemetry.Instrumentation.AspNetCore` (for ASP.NET Core apps) 1. Register EDOT in startup: call `builder.AddElasticOpenTelemetry()` on the `IHostApplicationBuilder` (in `Program.cs` or equivalent). Without this, no telemetry is collected 1. Set exactly three required environment variables: - `OTEL_SERVICE_NAME` (replaces `ELASTIC_APM_SERVICE_NAME` / `ElasticApm:ServiceName`) - `OTEL_EXPORTER_OTLP_ENDPOINT` — must be the **managed OTLP endpoint** or **EDOT Collector** URL. Do NOT reuse the old `ELASTIC_APM_SERVER_URLS` value. Never use an APM Server URL (no `apm-server`, no `:8200`, no `/intake/v2/events`) - `OTEL_EXPORTER_OTLP_HEADERS` — `"Authorization=ApiKey <key>"` or `"Authorization=Bearer <token>"` (replaces `ELASTIC_APM_SECRET_TOKEN`) 1. Do NOT set `OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, or `OTEL_LOGS_EXPORTER` — the defaults are already correct 1. Never run both classic Elastic APM agent (`Elastic.Apm.*`) and EDOT on the same application ## Examples See the [EDOT .NET migration guide](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/migration) for complete examples.