The Three Pillars of Observability
Understand traces, metrics, and logs.
The Three Pillars of Observability is a free C# Academy lesson on CoddyKit — lesson 1 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.
What Is Observability?
Observability is the ability to understand a system's internal state from the data it emits. For a running service it answers: is it healthy, why is it slow, and what failed? It rests on three pillars: traces, metrics and logs.
What Is OpenTelemetry?
OpenTelemetry (OTel) is a vendor-neutral standard and set of libraries for generating and exporting telemetry. With one instrumentation you can send data to many backends like Jaeger, Prometheus or Grafana.
dotnet add package OpenTelemetry.Extensions.HostingPillar One: Logs
Logs are timestamped records of discrete events ("user 42 logged in", "payment failed"). They give detailed, human-readable context but can be noisy and hard to aggregate alone.
logger.LogInformation("Order {OrderId} placed by {UserId}", orderId, userId);Pillar Two: Metrics
Metrics are numeric measurements aggregated over time (request count, error rate, latency percentiles, CPU usage). They are cheap to store and ideal for dashboards and alerts.
Pillar Three: Traces
Traces follow a single request as it flows through your services, breaking it into timed spans. They reveal where time is spent and which dependency caused a slowdown.
How The Pillars Complement Each Other
Metrics tell you that something is wrong (error rate spiked). Traces tell you where (the payment service). Logs tell you why (a null reference for a specific order). Together they form a full debugging story.
Correlation Is The Key
The real power comes from correlation. A shared trace id stamped onto logs and spans lets you jump from a metric alert to the exact trace and its logs for one failing request.
Signals In OpenTelemetry
OTel calls these pillars signals. .NET maps them to familiar primitives: traces use Activity/ActivitySource, metrics use Meter, and logs use ILogger.
Adding OpenTelemetry To A Host
You opt into signals with AddOpenTelemetry() and configure tracing and metrics. We cover each in detail in the following lessons.
builder.Services.AddOpenTelemetry()
.WithTracing(tracing => { })
.WithMetrics(metrics => { });Resource Attributes
A resource describes the entity producing telemetry (service name, version, environment). Setting it consistently lets backends group and filter your data correctly.
builder.Services.AddOpenTelemetry()
.ConfigureResource(r => r.AddService(
serviceName: "checkout-api",
serviceVersion: "1.4.0"));Auto vs Manual Instrumentation
OTel offers automatic instrumentation for ASP.NET Core, HttpClient and more, plus manual instrumentation where you add your own spans and metrics for business-specific insight.
Quick Check
Test the three pillars.
Recap
Observability rests on three pillars: logs (events, the why), metrics (aggregated numbers, the that), and traces (per-request spans, the where). OpenTelemetry is the vendor-neutral standard that emits all three as signals, mapped in .NET to Activity, Meter and ILogger. Correlation via trace ids and a well-set resource ties them together.
Frequently asked questions
Is the “The Three Pillars of Observability” lesson free?
Yes — the full text of “The Three Pillars of Observability” 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 “The Three Pillars of Observability”?
Understand traces, metrics, and logs. 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 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Three Pillars of Observability” 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