Loki: An OpenSource Zipkin / Prometheus Mashup, Written in Go
summary
A Zipkin-compatible tracer written in Go that reused Prometheus service discovery to pull-based scraping of in-process ring buffers, Loki prototypes a pull model for traces rather than push. Implementation is ~1.5k lines Go: a client with a capped ring buffer (development value 1k traces), a naive in-memory million-trace store, and a Zipkin-compatible API + UI. Used to debug Cortex distributor latency: a protobuf reflection hot path is fixed with gogo/protobuf and unsafe string reuse, dropping 99th-percentile latency from ~80–100ms to ~25ms. Current limits: single-process storage, slow queries, partial traces from scrape jitter.
AI-written summary · about
chapters (12)
- 0:00Start
- 2:41Weave Tracer
- 3:49What Makes Loki Different to Your Standard Distributed Tracer
- 5:00Graphite
- 6:18Prometheus Model
- 6:30Prometheus's Service Discovery Integrations
- 9:22The Prometheus Retrieval Library
- 10:11In Memory Storage
- 10:46Relabeling
- 17:28Demo
- 23:09Why Did I Write My Own Tracer
- 24:45Prometheus Metrics
related talks
31mLoki: Like Prometheus But for Logs
25mLoki: Prometheus-inspired logging for cloud native
05mGrafana Loki Log Aggregation for Incident Investigations
37mGrafana Loki: Like Prometheus, But for logs.
25mTracing Go
44mIntroduction to Grafana Loki
46mPintrace: A Distributed Tracing Pipeline
33mIntro: Prometheus
