mcpField
O
observability-edot-dotnet-instrument

observability-edot-dotnet-instrument

github.com/elasticCloud & DevOps6022.7k installsUpdated today
Repository

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

  1. 01Add EDOT NuGet packages
  2. 02Register EDOT during startup
  3. 03Set required OTLP environment variables
  4. 04Use a managed OTLP endpoint or EDOT Collector
  5. 05Avoid classic APM and EDOT together

Use cases

  1. 01Instrument an ASP.NET Core application
  2. 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-instrument

After installing, type/observability-edot-dotnet-instrumentin Claude Code to confirm it loaded.

Details

From the project README

EDOT .NET Instrumentation

Read the setup guide before making changes:

Guidelines

  1. Add NuGet packages: Elastic.OpenTelemetry and OpenTelemetry.Instrumentation.AspNetCore (for ASP.NET Core apps)
  2. Register EDOT in startup: call builder.AddElasticOpenTelemetry() on the IHostApplicationBuilder (in Program.cs or equivalent). Without this, no telemetry is collected
  3. 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>"
  4. Do NOT set OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER, or OTEL_LOGS_EXPORTER — the defaults are already correct
  5. Do NOT manually configure TracerProvider or MeterProvider — AddElasticOpenTelemetry() handles everything
  6. 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