watch -n1 'curl -s localhost:9090/metrics | grep up'

Observability &
SRE Toolkit

Filterable reference for the full observability stack: metrics, logs, traces, profiling, eBPF system analysis, and incident response.

17 tools
6 phases
Prometheus, Loki, OpenTelemetry
Phase 17 tools shown
ToolPhaseKey commandsUse case
promtool metrics
promtool check config prometheus.yml promtool check rules rules/*.yml promtool query instant http://localhost:9090 'up == 0' promtool query range --start=2h --end=now --step=5m http://localhost:9090 'rate(http_requests_total[5m])' promtool test rules tests/alert_tests.yml
Validate Prometheus config and alerting rules before reload. Unit-test alert expressions with test rules: catches false positives/negatives without a live cluster.
amtool metrics
amtool alert --alertmanager.url=http://localhost:9093 amtool alert query alertname=HighLatency amtool silence add alertname=~".*" --duration=2h --comment "planned maintenance" amtool silence expire <id> amtool config check
Alertmanager CLI: query firing alerts, manage silences during incidents, validate config. Faster than the UI for bulk silence operations.
mimirtool metrics
mimirtool rules lint rules/ mimirtool rules push --address=http://mimir:8080 --id=tenant1 rules/ mimirtool analyze prometheus --address=http://localhost:9090 mimirtool analyze rule-file rules/*.yml
Grafana Mimir / Cortex rule management and cardinality analysis. analyze identifies unused metrics and high-cardinality labels: critical for controlling Prometheus scale costs.
vector metrics
vector validate --config vector.toml vector tap --config vector.toml --component-id my_transform vector top vector generate --schema # test a transform against sample events: vector test --config vector.toml
High-performance observability pipeline: collect, transform, route logs/metrics/traces. tap lets you observe live events through any component. Replaces Logstash with lower overhead.
logcli logs
logcli query '{app="api"} |= "error"' logcli query '{app="api"} | json | status >= 500' --limit=100 logcli query '{namespace="prod"}' --from=2h --to=now --follow logcli labels logcli series '{app=~".+"}' logcli stats '{app="api"}' --range=1h
Loki CLI: query, tail, and explore logs using LogQL without the Grafana UI. labels and series reveal what's actually indexed before writing queries.
lnav logs
lnav /var/log/syslog lnav /var/log/*.log kubectl logs <pod> | lnav # inside lnav: / search, ; SQL query, i index, TAB next file # :filter-in ERROR | :filter-out healthcheck
Terminal log file navigator with SQL querying, filtering, and multi-file merging by timestamp. Underused: handles mixed-format log files better than grep | less chains.
jq (log parsing) logs
kubectl logs <pod> | jq 'select(.level=="error")' cat app.log | jq -r 'select(.latency_ms > 500) | [.timestamp, .path, .latency_ms] | @tsv' cat app.log | jq -s 'group_by(.status) | map({status: .[0].status, count: length})' cat app.log | jq '[.timestamp, .level, .message] | @csv' -r | sort -t, -k2
Structured log triage without a log aggregator. select filters, group_by aggregates, @tsv/@csv pipes to awk or spreadsheets. No additional tooling needed.
otel-cli traces
otel-cli exec --service my-script --name "run backup" -- ./backup.sh otel-cli span --service deploy --name "terraform apply" --start $(date -u +%s%N) otel-cli exec --endpoint http://otel-collector:4317 --name "db migration" -- flyway migrate # propagate trace context across shell steps: eval $(otel-cli span background --service ci --name pipeline)
Emit OpenTelemetry spans from shell scripts and CI pipelines. Wraps any command in a trace: makes deploy pipelines, cron jobs, and migrations visible in your tracing backend.
jaeger (query CLI) traces
curl "http://jaeger:16686/api/services" | jq '.data[]' curl "http://jaeger:16686/api/traces?service=api&limit=20&lookback=1h" | jq '.data[].traceID' curl "http://jaeger:16686/api/traces/<traceID>" | jq '.data[0].spans[] | {op: .operationName, dur: .duration}' # find slow spans: duration in microseconds curl "http://jaeger:16686/api/traces?service=api&minDuration=1s" | jq '.'
Query Jaeger over its HTTP API without the UI. Useful in CI for asserting trace presence, or in automated root-cause pipelines where the UI isn't accessible.
pprof (Go) profiling
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30 go tool pprof http://localhost:6060/debug/pprof/heap go tool pprof -http=:8080 profile.pb.gz # inside pprof: top10, web, list <func>, peek <func> curl -s http://localhost:6060/debug/pprof/goroutine?debug=2 | head -50
CPU, heap, goroutine, and block profiling for Go services. -http opens an interactive flame graph browser. Exposes /debug/pprof in your app with import _ "net/http/pprof".
py-spy profiling
py-spy top --pid <pid> py-spy record -o profile.svg --pid <pid> --duration 30 py-spy dump --pid <pid> py-spy record -o profile.svg -- python myscript.py # inside container (needs --privileged or SYS_PTRACE): py-spy top --pid <pid> --nonblocking
Sampling profiler for Python: zero instrumentation, attaches to a running process. record produces a flame graph SVG. Works inside Docker with SYS_PTRACE capability.
async-profiler profiling
./asprof -d 30 -f profile.html <pid> ./asprof -d 30 -e alloc -f alloc.html <pid> ./asprof -d 30 -e lock -f lock.html <pid> ./asprof start <pid> && sleep 30 && ./asprof stop -f out.jfr <pid>
Low-overhead JVM profiler (CPU, allocation, lock) without safepoint bias. Produces interactive HTML flame graphs. Outputs JFR for IntelliJ/JMC analysis.
bpftrace ebpf / system
bpftrace -e 'tracepoint:syscalls:sys_enter_openat { printf("%s %s\n", comm, str(args->filename)); }' bpftrace -e 'kprobe:tcp_connect { printf("connect: %s\n", comm); }' bpftrace -e 'profile:hz:99 /pid == <pid>/ { @[ustack] = count(); }' bpftrace -l 'tracepoint:syscalls:*' bpftrace /usr/share/bpftrace/tools/biolatency.bt
High-level eBPF tracing language: trace syscalls, kernel functions, network events with minimal overhead. No kernel recompile needed. Essential for diagnosing production issues that don't reproduce in dev.
bcc tools ebpf / system
execsnoop-bpfcc opensnoop-bpfcc -p <pid> tcplife-bpfcc biolatency-bpfcc -D runqlat-bpfcc funccount-bpfcc 'tcp_*'
Pre-built eBPF tools: process exec tracing, file open tracing, TCP connection lifecycle, disk I/O latency histograms, run-queue latency. Each answers a specific production question immediately.
strace ebpf / system
strace -p <pid> strace -p <pid> -e trace=network strace -p <pid> -e trace=openat,read,write -T strace -c -p <pid> strace -f -o strace.log ./myapp
Syscall-level process tracing. -c gives a syscall frequency/time summary. -T adds per-call latency. Higher overhead than bpftrace. Use for targeted short captures only.
perf ebpf / system
perf stat -p <pid> sleep 10 perf record -F 99 -p <pid> -g -- sleep 30 perf report --stdio perf script | stackcollapse-perf.pl | flamegraph.pl > flame.svg perf top -p <pid>
Linux hardware and software performance counters: CPU cycles, cache misses, branch mispredictions. record + script pipeline into Brendan Gregg's flamegraph.pl for CPU flame graphs.
vegeta incident
echo "GET http://localhost:8080/health" | vegeta attack -rate=100 -duration=30s | vegeta report echo "GET http://localhost:8080/" | vegeta attack -rate=500 -duration=60s | vegeta report -type=hist[0,5ms,10ms,50ms,100ms] echo "GET http://localhost:8080/" | vegeta attack -rate=200 -duration=60s | vegeta plot > plot.html vegeta attack -targets=targets.txt -rate=100 -duration=30s | vegeta encode | vegeta report
Constant-rate HTTP load testing with latency histograms and time-series plots. Composable via pipes: attack → encode → report. More rigorous than hey for SLO validation.
hey incident
hey -n 10000 -c 100 http://localhost:8080/ hey -z 30s -c 50 -m POST -H "Content-Type: application/json" -d '{"key":"val"}' http://localhost:8080/api hey -n 1000 -c 10 -o csv http://localhost:8080/ | awk -F, '{print $8}' | sort -n | tail -20
Quick HTTP benchmarking: simpler than vegeta for ad-hoc load checks. Good for smoke-testing a new deployment or confirming a latency regression before a full load test.
No tools match this filter.