3つの柱:ログ、メトリクス、トレース
可観測性を構成する、異なる役割を持ちながら相互に補完し合う3つのシグナル、ログ、メトリクス、トレースについて学びます。それぞれの強みと連携方法を理解します。
「3つの柱:ログ、メトリクス、トレース」はCoddyKit上の無料System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)レッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはSystem Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)コースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
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.
よくある質問
「3つの柱:ログ、メトリクス、トレース」レッスンは無料ですか?
はい。「3つの柱:ログ、メトリクス、トレース」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)コースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)コースには全4レッスンが含まれています。
「3つの柱:ログ、メトリクス、トレース」で何を学びますか?
可観測性を構成する、異なる役割を持ちながら相互に補完し合う3つのシグナル、ログ、メトリクス、トレースについて学びます。それぞれの強みと連携方法を理解します。 ブラウザで直接実行するハンズオンコードでSystem Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)を演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)を始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのSystem Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)は初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「3つの柱:ログ、メトリクス、トレース」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このSystem Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)レッスンでコードを書いて実行できますか?
はい。すべてのSystem Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)レッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- システムの可観測性とは
- 3つの柱:ログ、メトリクス、トレース
- 今、可観測性が重要な理由
- モニタリングとオブザーバビリティ:既知と未知