Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

OpenTelemetry in .NET: Stop Guessing What Your Application Is Doing

Add OpenTelemetry to .NET with ASP.NET Core instrumentation, understand traces, metrics, and logs, and move from console output to a suitable telemetry receiver.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OpenTelemetry helps a .NET application show what it is doing through traces, metrics, and logs. In an ASP.NET Core app, you can start by adding the OpenTelemetry SDK and ASP.NET Core instrumentation, then send telemetry to the console while developing. For operational use, configure an exporter to send it to a receiver or observability backend; the console is a learning and debugging destination, not a shared production system.

What OpenTelemetry adds to a .NET application

OpenTelemetry is a set of APIs, SDK components, and exporters for producing and sending telemetry. Its three signals answer different questions:

As an Amazon Associate I earn from qualifying purchases.

  • Traces show the path and timing of work, such as an incoming HTTP request and the operations it triggers.
  • Metrics record numeric measurements over time, such as request duration, which can be aggregated to reveal trends.
  • Logs add event-oriented records and context that help explain what happened.

OpenTelemetry’s .NET overview lists traces, metrics, and logs as stable. It says support covers officially supported .NET and .NET Framework versions, except .NET Framework 3.5 SP1. That is the documentation’s state as of its January 27, 2026 update; check the current .NET overview against the runtime version you plan to deploy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Instrumentation creates telemetry; an exporter sends it somewhere; a receiver or backend stores, processes, and helps you inspect it. Those are related but separate parts of the setup.

Decide whether you are instrumenting an application or a library

An application typically initializes the OpenTelemetry SDK and uses the API to create its own telemetry. A library should generally depend on the API and expose useful instrumentation, rather than initializing an SDK or choosing where data is sent. The host application can then collect that telemetry if it uses an SDK.

In .NET, tracing builds on familiar System.Diagnostics types, notably ActivitySource and Activity. You do not need to replace them with an unrelated tracing model. See the OpenTelemetry guidance on instrumenting applications and libraries.

Start with automatic ASP.NET Core instrumentation

The official ASP.NET Core starter uses three NuGet packages: OpenTelemetry.Exporter.Console, OpenTelemetry.Extensions.Hosting, and OpenTelemetry.Instrumentation.AspNetCore. It registers OpenTelemetry through the host’s dependency injection, sets a service resource, enables ASP.NET Core instrumentation, and adds the console exporter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For traces, that instrumentation can capture incoming HTTP request duration and request and network attributes without adding code to each controller or middleware component. The ASP.NET Core tracing guide provides the corresponding setup. Use a meaningful service.name so the telemetry identifies the service producing it.

The equivalent ASP.NET Core metrics guide registers metrics and ASP.NET Core instrumentation, with examples of inbound request duration, method, route, status code, and network data. Automatic instrumentation is a useful baseline; it will not know every application-specific question you want answered.

Add OpenTelemetry to the existing logging pipeline

OpenTelemetry logging integrates with .NET’s logging pipeline. The official ASP.NET Core logging tutorial clears default logging providers to make verbose OpenTelemetry console output easy to demonstrate. That is a tutorial choice, not a general production recommendation: most development and production applications can retain the normal console provider and add OpenTelemetry alongside it.

Choose an exporter and destination

The console exporter is the simplest route for local learning and debugging. For telemetry that a team needs to collect and inspect beyond a developer’s process, select an exporter and a compatible receiver or backend. The official exporter documentation describes OTLP over HTTP/protobuf or gRPC and names destinations including the OpenTelemetry Collector, Jaeger, Prometheus, and vendor-specific backends.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Option What it does Key consideration
Console exporter Writes telemetry to the console. Simplest for development and debugging; it is not a durable, shared production destination.
OTLP exporter Sends telemetry to OTLP endpoints using HTTP/protobuf or gRPC. Check which protocol and endpoint the receiver supports and configure the matching destination.
Prometheus OTLP push Sends metrics to a Prometheus OTLP receiver. The documentation recommends OTLP push for production metrics; it describes this route as stable and supporting exemplars.
Prometheus scrape exporter Exposes a metrics endpoint for Prometheus to scrape. The documentation describes this exporter as still under development and says it lacks exemplars.

Exporter choice is not a product ranking. Start with the signals you need and the receiver your operations team already runs, then verify its endpoint and protocol requirements. The documentation’s recommendation for Prometheus production metrics is specifically OTLP push; the scrape integration remains a separate option with the maturity and feature qualifications above.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Add custom telemetry for questions automatic instrumentation cannot answer

Automatic HTTP instrumentation can show request-level behavior, but it may not identify which business or internal operation accounts for a delay. Add application-specific spans or measurements where those details matter, and use them alongside automatic instrumentation. For tracing, register every ActivitySource name used by your application so the SDK collects the activities it creates. The instrumentation guidance covers combining automatic and manual instrumentation.

A practical setup sequence

  1. Identify the target. For an application, initialize the SDK; for a library, provide API-based instrumentation for an SDK-enabled host.
  2. Register OpenTelemetry early in ASP.NET Core startup. Set a useful service.name, then add the signal-specific instrumentation and providers your application needs.
  3. Use console output while learning or debugging locally. Inspect the emitted data before deciding where operational telemetry should go.
  4. Choose the receiver and exporter for deployment. Confirm whether the destination accepts OTLP over HTTP/protobuf or gRPC, or requires another documented integration.
  5. Fill the gaps with application-specific instrumentation. Add spans or measurements that answer questions automatic framework instrumentation does not, and register your activity sources.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.