Lecture Notes for Metrics - A Short, Practical Primer

Outline

First Principles

what is a metric

in terms of data

it is a label, a number and a timestamp. so, a time-indexed kv pair. some other details about the number can be kept for fun sometimes.

in terms of use

it is a single piece of information you want to have about a "running" "system" ie. anything that you can measure, the output of the measurement is a metric.

in terms of "why"

well, the scientific method.

debugging something? have a target to meet? need to know how to provision a resource? need to know if you're wasting a resource? metrics to the rescue! find a way to

  1. quantify your targets

  2. measure your world

and you have the panaceaic answers to all your questions!

(further reading: How to Measure Anything, Douglas Hubbard)

data challenges

collection and storage timestamps, how do they work storage optimization

use challenges

querying and analysis cardinality size bucketing: the ultimate shitty tradeoff between storage and analysis requirements

motivation challenges

use cases:

System metrics

Collectd

get them to install collectd show them what it collects

Graphite

somebody else gotta step in to discuss; pls no practical.

a graphite endpoint they can push to and navigate to the dashboard of?

whisperdb

carbon-relay

carbon-ng? or something the go rewrite

Prometheus

wouldn't minda practical here. prom is smol.

promtsdb

pull-based arch (and the consequences)

exporters

get them to install node exporter

prom web endpoint

alertmanager

alerting rules

Grafana

unified graphs and queries frontend originally mostly for graphite but it can talk to EVERYTHING muhahahaha somewhat heavy webapp tho

dashboard

panel

panel query editing

useful walkthrough here to discuss how and why to use various display features

Duncan method informed class structure

Core skill