Exporting to Backends
Send telemetry to OTLP collectors and tools.
Exporting to Backends is a free C# Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the C# Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Getting Telemetry Out
Generating traces and metrics is only half the job; you must export them to a backend that stores, queries and visualizes the data. OpenTelemetry uses exporters for this.
Exporters
An exporter sends telemetry to a destination. Different exporters target different systems: console (for dev), OTLP (the standard protocol), and vendor-specific exporters.
The Console Exporter
The console exporter prints telemetry to the terminal, perfect for verifying instrumentation during development.
builder.Services.AddOpenTelemetry()
.WithTracing(t => t.AddConsoleExporter())
.WithMetrics(m => m.AddConsoleExporter());What Is OTLP?
OTLP (OpenTelemetry Protocol) is the vendor-neutral wire format for shipping telemetry. Exporting via OTLP means you can send to any OTLP-compatible backend without changing app code.
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocolConfiguring The OTLP Exporter
Add AddOtlpExporter and point it at your collector or backend endpoint.
builder.Services.AddOpenTelemetry()
.WithTracing(t => t.AddOtlpExporter(o =>
{
o.Endpoint = new Uri("http://localhost:4317");
}))
.WithMetrics(m => m.AddOtlpExporter());The OpenTelemetry Collector
The Collector is a separate process that receives telemetry, processes it (batching, filtering, enrichment), and forwards it to one or more backends. It decouples your app from specific vendors.
Why Use A Collector?
Sending directly to a vendor couples your app to it. A collector lets you switch or fan out to multiple backends, apply sampling and redaction centrally, and reduce load on your services.
Common Backends
Traces often go to Jaeger or Tempo, metrics to Prometheus, and dashboards to Grafana. Logs can flow to Loki or an ELK stack. All can receive OTLP via the collector.
Wiring It All Together
A typical setup configures resource, sources, meters and an OTLP exporter in one block, giving you traces and metrics flowing to your collector.
builder.Services.AddOpenTelemetry()
.ConfigureResource(r => r.AddService("checkout-api"))
.WithTracing(t => t
.AddAspNetCoreInstrumentation()
.AddSource("Checkout.Orders")
.AddOtlpExporter())
.WithMetrics(m => m
.AddAspNetCoreInstrumentation()
.AddMeter("Checkout.Orders")
.AddOtlpExporter());Exporting Logs
OTel also exports logs. Hook it into the logging pipeline so log records carry the same trace context and reach your backend over OTLP.
builder.Logging.AddOpenTelemetry(o =>
{
o.AddOtlpExporter();
});Batching And Reliability
Exporters batch telemetry to reduce overhead and retry on failure. Tune batch size and timeouts for your volume, and prefer the collector to absorb spikes so app threads are never blocked exporting.
Quick Check
Test exporting to backends.
Recap
Exporters ship telemetry to backends. The console exporter aids development; OTLP is the vendor-neutral protocol used with AddOtlpExporter. Sending OTLP to an OpenTelemetry Collector decouples your app, centralizes batching, sampling and routing, and fans out to backends like Jaeger, Prometheus and Grafana. Logs export the same way, carrying trace context.
Frequently asked questions
Is the “Exporting to Backends” lesson free?
Yes — the full text of “Exporting to Backends” is free to read here on the web, and the C# Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the C# Academy course, upgrade to CoddyKit PRO.
What will I learn in “Exporting to Backends”?
Send telemetry to OTLP collectors and tools. You practise C# Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start C# Academy?
No prior experience is required. C# Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Exporting to Backends” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this C# Academy lesson?
Yes. Every C# Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Three Pillars of Observability
- Distributed Tracing
- Collecting Metrics
- Exporting to Backends