<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx" -->

---
title: OpenTelemetry ASP.NET Core: Setup, Auto-Instrumentation,...
description: A practical guide to integrating OpenTelemetry into ASP.NET Core applications using AddOpenTelemetry(). Covers all three signals (tracing, metrics, logging),...
canonical: https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: OpenTelemetry ASP.NET Core: Setup, Auto-Instrumentation, and Configuration | daily.dev
og:description: A practical guide to integrating OpenTelemetry into ASP.NET Core applications using AddOpenTelemetry(). Covers all three signals (tracing, metrics, logging),...
og:url: https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx
og:image: https://api.daily.dev/og/posts/TiYdmWRgX.png
og:image:alt: OpenTelemetry ASP.NET Core: Setup, Auto-Instrumentation, and Configuration
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenTelemetry ASP.NET Core: Setup, Auto-Instrumentation, and Configuration

**[We Are .NET](https://daily.dev/sources/wearedotnet)** · 16 min read · 1 upvotes · 0 comments

## Summary

A practical guide to integrating OpenTelemetry into ASP.NET Core applications using AddOpenTelemetry(). Covers all three signals (tracing, metrics, logging), auto-instrumentation via AddAspNetCoreInstrumentation(), OTLP exporter configuration from environment variables, sampling strategies (ParentBasedSampler + TraceIdRatioBasedSampler), health check filtering, W3C TraceContext propagation, and local validation techniques. Includes complete code examples for .NET 9/10 and a shared OTLP configuration pattern for multi-signal setups.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.devleader.ca/2026/07/29/opentelemetry-aspnet-core-setup-autoinstrumentation-and-configuration>

## Questions this post answers

### What NuGet packages do I need to set up OpenTelemetry in ASP.NET Core?

You need OpenTelemetry.Extensions.Hosting for AddOpenTelemetry(), OpenTelemetry.Instrumentation.AspNetCore for AddAspNetCoreInstrumentation(), and either OpenTelemetry.Exporter.Console or OpenTelemetry.Exporter.OpenTelemetryProtocol for export. For runtime metrics like GC and thread pool stats, also add OpenTelemetry.Instrumentation.Runtime. All packages are available on NuGet and follow semantic versioning.

_Teams wiring up observability in ASP.NET Core can track setup patterns like this on daily.dev._

### What is a reasonable sample rate for production distributed tracing?

A starting point of 10 percent using TraceIdRatioBasedSampler(0.1) works for moderate-traffic APIs, while high-traffic services processing thousands of requests per second might use 1 percent or lower, and low-traffic internal services can often afford 100 percent. The right value depends on traffic volume and backend storage costs, so monitor ingestion costs and adjust the sample rate configuration accordingly.

_Anyone tuning tracing costs against traffic volume can compare sampling approaches on daily.dev._

### How do I filter health check endpoints out of ASP.NET Core OpenTelemetry tracing?

Set the Filter delegate on AddAspNetCoreInstrumentation() options to return false for paths like /health, /metrics, and /ready, checked with StartsWith on the request path. The filter runs before the span is started, so filtered paths incur minimal overhead since span creation is skipped entirely rather than created and discarded.

_Developers cutting tracing noise from health checks can find configuration details like this on daily.dev._

## Similar posts on daily.dev

- [Logging, Metrics, and Distributed Tracing in .NET with OpenTelemetry and ClickStack](https://daily.dev/posts/logging-metrics-and-distributed-tracing-in-net-with-opentelemetry-and-clickstack-ohkhm2db1) · ClickHouse · 4 upvotes · 0 comments
- [OpenTelemetry Logging .NET: ILogger Integration and Structured Log Export](https://daily.dev/posts/opentelemetry-logging-net-ilogger-integration-and-structured-log-export-5b3h28qfa) · We Are .NET · 1 upvotes · 0 comments
- [How OpenTelemetry Works: A Complete Guide](https://daily.dev/posts/how-opentelemetry-works-a-complete-guide-56tcccdpu) · freeCodeCamp · 6 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#.net](https://daily.dev/tags/.net), [#observability](https://daily.dev/tags/observability), [#aspnet](https://daily.dev/tags/aspnet), [#opentelemetry](https://daily.dev/tags/opentelemetry)

[View this post on daily.dev](https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"OpenTelemetry ASP.NET Core: Setup, Auto-Instrumentation, and Configuration","url":"https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx"},"datePublished":"2026-07-29T22:49:14.360Z","dateModified":"2026-09-14T06:28:17.510Z","description":"A practical guide to integrating OpenTelemetry into ASP.NET Core applications using AddOpenTelemetry(). Covers all three signals (tracing, metrics, logging),...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/12d8a90a6cc2fe4ba9376d80398e9828?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/12d8a90a6cc2fe4ba9376d80398e9828?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"We Are .NET","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"We Are .NET","logo":"https://media.daily.dev/image/upload/s--BsnVOa3i--/f_auto/v1718347410/logos/wearedotnet","url":"https://daily.dev/sources/wearedotnet"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,.net,observability,aspnet,opentelemetry","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"We Are .NET","item":"https://daily.dev/sources/wearedotnet"},{"@type":"ListItem","position":3,"name":"OpenTelemetry ASP.NET Core: Setup, Auto-Instrumentation, and Configuration"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/opentelemetry-asp-net-core-setup-auto-instrumentation-and-configuration-tiydmwrgx#faq","mainEntity":[{"@type":"Question","name":"What NuGet packages do I need to set up OpenTelemetry in ASP.NET Core?","acceptedAnswer":{"@type":"Answer","text":"You need OpenTelemetry.Extensions.Hosting for AddOpenTelemetry(), OpenTelemetry.Instrumentation.AspNetCore for AddAspNetCoreInstrumentation(), and either OpenTelemetry.Exporter.Console or OpenTelemetry.Exporter.OpenTelemetryProtocol for export. For runtime metrics like GC and thread pool stats, also add OpenTelemetry.Instrumentation.Runtime. All packages are available on NuGet and follow semantic versioning. Teams wiring up observability in ASP.NET Core can track setup patterns like this on daily.dev."}},{"@type":"Question","name":"What is a reasonable sample rate for production distributed tracing?","acceptedAnswer":{"@type":"Answer","text":"A starting point of 10 percent using TraceIdRatioBasedSampler(0.1) works for moderate-traffic APIs, while high-traffic services processing thousands of requests per second might use 1 percent or lower, and low-traffic internal services can often afford 100 percent. The right value depends on traffic volume and backend storage costs, so monitor ingestion costs and adjust the sample rate configuration accordingly. Anyone tuning tracing costs against traffic volume can compare sampling approaches on daily.dev."}},{"@type":"Question","name":"How do I filter health check endpoints out of ASP.NET Core OpenTelemetry tracing?","acceptedAnswer":{"@type":"Answer","text":"Set the Filter delegate on AddAspNetCoreInstrumentation() options to return false for paths like /health, /metrics, and /ready, checked with StartsWith on the request path. The filter runs before the span is started, so filtered paths incur minimal overhead since span creation is skipped entirely rather than created and discarded. Developers cutting tracing noise from health checks can find configuration details like this on daily.dev."}}]}
```

