AlgoViz

Inside a logging service

medium 30 min

A logging service carries the log lines of all programs to one place where people can search them.

Remember it

The few things worth knowing cold, and how to make them stick.

Memory hook

Write and sail on: the captain never waits for the office.

Captains write logbooks. A porter collects them, a basket holds them, a clerk reads, and a card says which book has the word storm.

Cheat sheet

Stages
generate, collect, buffer, process, index, query
Batch
100 lines or 1 second
Delivery
at least once, plus an id
100,000 lines/s at 500 B
50 MB/s, 4.3 TB a day
One hour of buffer
180 GB before copies
Near real time
about 1 second in Elasticsearch
Tiers
hot, warm, cold, gone
Join key
trace id
Goals to discuss
fresh in 5 s, search in 1 s
Full buffer
drop debug first, count it

Spot it when you see

  • Many services and one question.
  • Machines that come and go.
  • An error that spans services.
  • Storage costs that grow.

Tricks that stick

  • LOGS: Layers (collect, process, store, query), Ordered by time, Grouped by service, trace and level, Searchable by word.
  • Generate, collect, buffer, store, search.
  • Structured, correlated, batched, limited, deleted.

Do not forget

  • Waiting for the network to log.
  • Secrets in lines.
  • A new trace id per line.
  • No limit per service.
  • Keeping everything forever.