
Observability Edot Dotnet Instrument
Wire a .NET service to Elastic’s OpenTelemetry (EDOT) SDK for traces, metrics, and logs without an existing APM agent.
Overview
observability-edot-dotnet-instrument is an agent skill most often used in Build (also Operate) that adds Elastic OpenTelemetry instrumentation to .NET apps via NuGet and startup registration.
Install
npx skills add https://github.com/elastic/agent-skills --skill observability-edot-dotnet-instrumentWhat is this skill?
- NuGet: Elastic.OpenTelemetry plus AspNetCore instrumentation when applicable
- Register via builder.AddElasticOpenTelemetry() on IHostApplicationBuilder or telemetry stays off
- Three required env vars: OTEL_SERVICE_NAME, OTLP endpoint (managed OTLP/EDOT Collector—not APM Server :8200), OTEL_EXPOR
- Explicit guardrails: do not override default OTEL_*_EXPORTER settings
- Points to official Elastic EDOT .NET setup and configuration docs
- 3 required environment variables (service name, OTLP endpoint, OTLP headers)
- 2 core NuGet packages cited (Elastic.OpenTelemetry, AspNetCore instrumentation when applicable)
Adoption & trust: 936 installs on skills.sh; 502 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your .NET service ships blind—you need Elastic-compatible traces, metrics, and logs but no APM agent is configured yet.
Who is it for?
New or unmetered ASP.NET Core services targeting Elastic Observability with OpenTelemetry defaults.
Skip if: Apps already fully instrumented with another APM stack you must keep, or teams that cannot use OTLP/Elastic endpoints.
When should I use this skill?
Adding observability to a .NET service with the Elastic Distribution of OpenTelemetry when no existing APM agent is present.
What do I get? / Deliverables
The app emits OTLP telemetry to Elastic with required service name, endpoint, and auth headers after AddElasticOpenTelemetry registration.
- NuGet references and startup registration for EDOT
- Documented OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS configuration
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Instrumenting a service is integration work done while building or hardening the app before production traffic. Integrations subphase covers OTLP exporters, NuGet packages, and startup registration that connect the app to Elastic observability.
Where it fits
Add Elastic.OpenTelemetry packages and Program.cs registration while scaffolding a new minimal API.
Set OTEL_SERVICE_NAME and OTLP headers in staging so launch checklist includes working trace export.
Instrument a legacy .NET worker that never had APM so on-call can see errors in Elastic.
How it compares
Step-by-step .NET instrumentation skill—not a hosted collector; you still provision Elastic OTLP endpoint and credentials.
Common Questions / FAQ
Who is observability-edot-dotnet-instrument for?
Solo builders and small teams on .NET who want agents to apply Elastic EDOT OpenTelemetry correctly on ASP.NET Core or generic .NET hosts.
When should I use observability-edot-dotnet-instrument?
During Build when adding observability to a new API, before Ship when validating staging telemetry, or in Operate when extending monitoring to a service that had none.
Is observability-edot-dotnet-instrument safe to install?
It guides configuration that touches secrets and export endpoints—review the Security Audits panel here and validate URLs and API keys in your own Elastic tenant before deploy.
SKILL.md
READMESKILL.md - Observability Edot Dotnet Instrument
# EDOT .NET Instrumentation Read the setup guide before making changes: - [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) - [OpenTelemetry .NET instrumentation](https://opentelemetry.io/docs/zero-code/net/) ## Guidelines 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` - `OTEL_EXPORTER_OTLP_ENDPOINT` — must be the **managed OTLP endpoint** or **EDOT Collector** URL. 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>"` 1. Do NOT set `OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, or `OTEL_LOGS_EXPORTER` — the defaults are already correct 1. Do NOT manually configure `TracerProvider` or `MeterProvider` — `AddElasticOpenTelemetry()` handles everything 1. Never run both classic Elastic APM agent (`Elastic.Apm.*`) and EDOT on the same application ## Examples See the [EDOT .NET setup guide](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/setup) for complete examples.