Observability and Logging
Overview
Observability is the ability to understand a system's internal state from its outputs. This skill covers the three telemetry signals — logs, metrics, and traces — instrumented in a vendor-neutral way with OpenTelemetry, and the operational practices Google SRE uses to act on that data (SLIs/SLOs, error budgets, the four golden signals). Read it when adding instrumentation, choosing what to log, or defining what "healthy" means for a service.
Official sources
Core concepts
- Three signals. OpenTelemetry standardizes traces (the path of a request across services), metrics (numeric measurements over time), and logs (timestamped records of discrete events).
- OpenTelemetry is instrumentation, not a backend. It is "a vendor-neutral open source Observability framework for instrumenting, generating, collecting, and exporting telemetry data" — it does not store or visualize data; you send it to a backend.
- The Collector. A vendor-agnostic process to receive, process, and export telemetry, decoupling your app from any specific backend.
- OTLP and vendor neutrality. A common wire protocol and broad vendor support (90+ observability vendors) let you switch tools without re-instrumenting, avoiding lock-in.
- SLIs and SLOs. A Service Level Indicator is a measured quality (e.g. request latency); a Service Level Objective is a target for it. Error budgets quantify allowable unreliability against the SLO (Google SRE).
- The four golden signals. Google SRE recommends monitoring latency, traffic, errors, and saturation as the primary health signals of a user-facing system.
Best practices
- Emit structured logs (e.g. JSON with consistent fields) and correlate them with traces via trace/span IDs so you can pivot between signals.
- Instrument with OpenTelemetry rather than vendor-specific SDKs so the backend stays swappable.
- Define SLOs for the user-facing behaviors that matter and alert on SLO burn / the four golden signals, not on every raw metric (Google SRE).
- Run the OpenTelemetry Collector to centralize processing (batching, attribute scrubbing, routing) instead of exporting directly from every service.
Common pitfalls
- Treating OpenTelemetry as a storage/visualization product → it only generates and ships telemetry; pair it with a backend.
- Logging unstructured free text → emit structured, queryable fields and avoid logging secrets/PII.
- Alerting on raw resource metrics with no SLO → alert on user-impacting symptoms (golden signals / SLO burn) to cut noise (Google SRE).
Examples
A single user request, observed across the three signals:
trace : frontend → orders-api → payments-api (spans with timing)
metric: http.server.duration, error.rate, queue.saturation
log : {"level":"error","trace_id":"abc123","msg":"payment declined"}
Four golden signals to dashboard/alert on:
latency · traffic · errors · saturation
Further reading
Related skills
- ./backend-fundamentals — the "logs" twelve-factor concern and service operation
- ./auth-and-authorization — logging authorization failures for audit
1---2name: backend-observability-logging3description: Observability via the three signals (logs, metrics, traces) with OpenTelemetry, plus SRE practices like SLOs and the four golden signals.4domain: engineering5category: engineering6tags: [observability, logging, metrics, tracing, opentelemetry, sre, slo]7official_sources:8 - https://opentelemetry.io/docs/9 - https://sre.google/books/10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/backend-observability-logging13---1415# Observability and Logging1617## Overview18Observability is the ability to understand a system's internal state from its outputs. This skill covers the three telemetry signals — logs, metrics, and traces — instrumented in a vendor-neutral way with OpenTelemetry, and the operational practices Google SRE uses to act on that data (SLIs/SLOs, error budgets, the four golden signals). Read it when adding instrumentation, choosing what to log, or defining what "healthy" means for a service.1920## Official sources21- OpenTelemetry docs: https://opentelemetry.io/docs/22- Repo (OpenTelemetry org): https://github.com/open-telemetry23- Google SRE books (free online): https://sre.google/books/2425## Core concepts26- **Three signals.** OpenTelemetry standardizes **traces** (the path of a request across services), **metrics** (numeric measurements over time), and **logs** (timestamped records of discrete events).27- **OpenTelemetry is instrumentation, not a backend.** It is "a vendor-neutral open source Observability framework for instrumenting, generating, collecting, and exporting telemetry data" — it does not store or visualize data; you send it to a backend.28- **The Collector.** A vendor-agnostic process to receive, process, and export telemetry, decoupling your app from any specific backend.29- **OTLP and vendor neutrality.** A common wire protocol and broad vendor support (90+ observability vendors) let you switch tools without re-instrumenting, avoiding lock-in.30- **SLIs and SLOs.** A Service Level Indicator is a measured quality (e.g. request latency); a Service Level Objective is a target for it. Error budgets quantify allowable unreliability against the SLO (Google SRE).31- **The four golden signals.** Google SRE recommends monitoring **latency, traffic, errors, and saturation** as the primary health signals of a user-facing system.3233## Best practices34- Emit structured logs (e.g. JSON with consistent fields) and correlate them with traces via trace/span IDs so you can pivot between signals.35- Instrument with OpenTelemetry rather than vendor-specific SDKs so the backend stays swappable.36- Define SLOs for the user-facing behaviors that matter and alert on SLO burn / the four golden signals, not on every raw metric (Google SRE).37- Run the OpenTelemetry Collector to centralize processing (batching, attribute scrubbing, routing) instead of exporting directly from every service.3839## Common pitfalls40- Treating OpenTelemetry as a storage/visualization product → it only generates and ships telemetry; pair it with a backend.41- Logging unstructured free text → emit structured, queryable fields and avoid logging secrets/PII.42- Alerting on raw resource metrics with no SLO → alert on user-impacting symptoms (golden signals / SLO burn) to cut noise (Google SRE).4344## Examples45```text46A single user request, observed across the three signals:47 trace : frontend → orders-api → payments-api (spans with timing)48 metric: http.server.duration, error.rate, queue.saturation49 log : {"level":"error","trace_id":"abc123","msg":"payment declined"}50```51```text52Four golden signals to dashboard/alert on:53 latency · traffic · errors · saturation54```5556## Further reading57- OpenTelemetry — what is observability: https://opentelemetry.io/docs/concepts/observability-primer/58- SRE Book, Monitoring Distributed Systems (golden signals): https://sre.google/sre-book/monitoring-distributed-systems/5960## Related skills61- ./backend-fundamentals — the "logs" twelve-factor concern and service operation62- ./auth-and-authorization — logging authorization failures for audit