0Pricing
System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) · Lesson

The Pillars: Logs, Metrics, Traces

Explore the three distinct but complementary signals of observability: logs, metrics, and traces. Understand their individual strengths and how they work together.

The Pillars: Logs, Metrics, Traces is a free System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) lesson on CoddyKit — lesson 2 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 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Observability's Core Pillars

Observability rests on three pillars: logs, metrics, and traces. Each gives a different view, and together they paint a full picture of your system.

Logs: The Event Diary

Logs are your system's diary — text records of discrete events like a login or an error. They tell you exactly what happened and when.

What Logs Tell Us

Logs are gold for debugging and auditing. When something breaks, they hand you the error message, stack trace, and context right up to the failure.

Logs in Action (Code)

Even a print statement is a primitive log. Real apps use logging libraries for structure, but this snippet shows the basic idea of log output.

public class LogDemo {
  public static void main(String[] args) {
    System.out.println("INFO: Application started.");
    int userCount = 10;
    System.out.println("DEBUG: Current users: " + userCount);
    // Imagine an error occurring here
    System.out.println("ERROR: Failed to connect to database.");
  }
}

Metrics: Measuring Performance

Metrics are numbers measured over time — CPU, memory, request rate, error count. They tell you how much or how often, stored as time-series data.

Metrics for Trends & Health

Metrics reveal trends and health. A sudden request drop or CPU spike shows up instantly, making them perfect for spotting bottlenecks and firing alerts.

Metrics in Action (Concept)

Real metrics need libraries, but the core idea is simple: a counter that increments and gets reported periodically. This snippet sketches that out.

public class MetricDemo {
  static int successfulRequests = 0;
  static int failedRequests = 0;

  public static void processRequest(boolean success) {
    if (success) {
      successfulRequests++;
    } else {
      failedRequests++;
    }
    // In a real system, these counts would be
    // reported to a metrics system periodically.
  }

  public static void main(String[] args) {
    processRequest(true);
    processRequest(true);
    processRequest(false);
    System.out.println("Simulated request counts:");
    System.out.println("Successful: " + successfulRequests);
    System.out.println("Failed: " + failedRequests);
  }
}

Traces: Following a Request

A trace follows one request end-to-end across services. It's built from spans — each span an operation — revealing timing and relationships between components.

Traces for Distributed Systems

Traces are essential for microservices. When a request is slow, a trace pinpoints exactly which service or DB call caused the delay, even hops away.

Pillars: Stronger Together

The pillars are strongest together: traces show the path and timing, logs add context per span, metrics give aggregate trends. Correlate all three for the full view.

Check Your Understanding

Let's check what you've learned about the three pillars of observability.

Recap: The Observability Pillars

You've met all three pillars: logs for debugging, metrics for trends, traces for distributed request journeys. Next: why observability is so crucial today.

Frequently asked questions

Is the “The Pillars: Logs, Metrics, Traces” lesson free?

Yes — the full text of “The Pillars: Logs, Metrics, Traces” is free to read here on the web, and the System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 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 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) course, upgrade to CoddyKit PRO.

What will I learn in “The Pillars: Logs, Metrics, Traces”?

Explore the three distinct but complementary signals of observability: logs, metrics, and traces. Understand their individual strengths and how they work together. You practise System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 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 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)?

No prior experience is required. System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “The Pillars: Logs, Metrics, Traces” 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 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) lesson?

Yes. Every System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 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

  1. What is System Observability?
  2. The Pillars: Logs, Metrics, Traces
  3. Why Observability Matters Today
  4. Monitoring vs Observability: Knowns and Unknowns
← Back to System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)