0Pricing
Vibe Coding · 강의

로그와 지표 추가하기

앱에서 어떤 일이 일어나는지 확인해 보세요.

로그와 지표 추가하기은(는) CoddyKit의 무료 Vibe Coding 강의입니다. 이것은 4개 중 3번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Vibe Coding 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Vibe Coding 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

You Can't Fix What You Can't See

When a vibe-coded app misbehaves in production, you're blind unless you instrumented it. Logs, metrics, and traces are the three lenses that let you see inside a running system.

This lesson uses your AI assistant to add observability that answers real questions instead of producing noise.

Logs, Metrics, Traces

Each pillar answers a different question. Logs tell you what happened in one event. Metrics tell you how often and how much over time. Traces tell you how a single request moved across services.

Knowing which to reach for keeps your instrumentation focused and your bills sane.

Explain for my app which of logs, metrics, or traces best answers each question: 'why did this one checkout fail', 'is error rate rising', and 'which step makes this request slow'. Then recommend what to instrument first.

Make Logs Structured

A wall of free-text print statements is unsearchable. Structured logs emit JSON with consistent fields, so you can filter by user, route, or status in seconds.

Ask the assistant to replace ad-hoc logging with a structured logger and a standard field schema.

Replace all console prints with a structured JSON logger. Every log line should include timestamp, level, request_id, route, and duration_ms where relevant. Show the logger setup and convert three existing log statements as examples.

Correlate With Request IDs

A single user action can touch many log lines and several services. Without a shared identifier you can't tell which lines belong together.

Generate a request ID at the edge and thread it through every log and downstream call so one trace tells the whole story.

Add middleware that assigns a unique request_id to every incoming request, attaches it to all logs for that request, and forwards it as a header to downstream services. Show how I would later filter logs by a single request_id.

Choose Log Levels Wisely

Logging everything at one level is the same as logging nothing useful. Levels let you stay quiet in normal operation and verbose when investigating.

Have the assistant assign sensible levels and make verbosity configurable per environment without a redeploy.

Audit our log statements and assign appropriate levels: debug for development detail, info for business events, warn for recoverable issues, error for failures. Make the active level configurable via an environment variable so production can run at info and drop to debug temporarily.

Never Log Secrets

Logs are read by many people and often shipped to third-party tools. A password, token, or full credit-card number in a log line is a breach waiting to happen.

Ask the assistant to add redaction so sensitive fields are masked before anything is written.

Add automatic redaction to the logger so fields like password, token, authorization, and card_number are masked before output. Scan existing log calls for places that currently log full request bodies and fix them.

Emit the Golden Signals

For metrics, start with the four golden signals: latency, traffic, errors, and saturation. They cover most of what you need to know about service health.

Let the assistant instrument these as counters and histograms you can graph and alert on.

Instrument the four golden signals for the HTTP layer: request latency as a histogram, request count by route and status, error rate, and a saturation gauge like active connections. Expose them on a /metrics endpoint in a format my monitoring stack can scrape.

Track Business Metrics Too

System health is only half the picture. Signups, checkouts, and failed payments tell you whether the product is actually working for users.

Ask for custom metrics on the events that matter to the business so a silent revenue drop becomes visible immediately.

Add custom business metrics: a counter for completed checkouts, a counter for failed payments tagged by failure reason, and a gauge for active subscriptions. Make sure these are cheap to emit and won't slow the request path.

Add Distributed Tracing

When a request fans out across services and a database, a trace shows the timeline of every span so you can see exactly where the time went.

Have the assistant wire up a tracing standard so spans propagate automatically across service boundaries.

Add OpenTelemetry tracing to the API and worker. Auto-instrument HTTP and database calls, propagate trace context across the queue, and export spans to our collector. Show me what a single checkout request's trace would look like.

Build a Dashboard That Answers Questions

Raw metrics are useless until someone can read them at a glance. A good dashboard is organized around the questions you'll ask during an incident.

Ask the assistant to define panels for error rate, p95 latency, and the key business counters, with thresholds marked.

Design a dashboard layout for this service: panels for request rate, error rate, p95 and p99 latency, queue depth, and completed checkouts. For each panel, suggest a threshold line that would indicate trouble worth investigating.

Signal, Not Noise

The goal of observability is fast answers, not data hoarding. Too many logs and metrics cost money and bury the signal you need.

Periodically prune what you never query, keep field names consistent, and make sure every metric maps to a question someone actually asks.

Quick Check

Test your understanding of logging and metrics.

Recap

Observability rests on three pillars: structured, correlated, redacted logs; the golden-signal and business metrics that surface trends; and distributed traces that show a request's full path.

Prompt your assistant to instrument each deliberately, build dashboards around real questions, and prune anything that produces noise instead of answers.

자주 묻는 질문

“로그와 지표 추가하기” 강의는 무료인가요?

네 — “로그와 지표 추가하기” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Vibe Coding 강의 전체를 잠금 해제할 수 있습니다. Vibe Coding 강의에는 총 4개의 강의가 포함되어 있습니다.

“로그와 지표 추가하기”에서 뭘 배우나요?

앱에서 어떤 일이 일어나는지 확인해 보세요. 브라우저에서 직접 실행하는 실습 코드로 Vibe Coding을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Vibe Coding을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Vibe Coding은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 3번째 강의입니다.

“로그와 지표 추가하기” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Vibe Coding 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Vibe Coding 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 프로토타입에서 제품으로
  2. 프롬프트로 성능 개선하기
  3. 로그와 지표 추가하기
  4. 장애에 대응하기
← Vibe Coding(으)로 돌아가기