OpenTelemetry Quick Reference
yaml
# Minimal Collector pipeline — traces in via OTLP, out to one backend
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317 # gRPC — common SDK default
http:
endpoint: 0.0.0.0:4318 # HTTP — easy to confuse the port with grpc's
processors:
batch: {} # almost every pipeline includes this
exporters:
otlphttp/backend:
endpoint: http://backend:4318
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp/backend]text
# Signal types and what they're for
Traces — a request's path across services, built from parent/child spans
Metrics — aggregated numeric measurements (counter, updowncounter, histogram)
Logs — discrete timestamped events, enrichable with trace/span IDs
# Metric instrument cheat-sheet
Counter -- only increases (total requests, total errors)
UpDownCounter -- can go either way (active connections right now)
Histogram -- a distribution of values (request duration -> percentiles later)
# Sampling
Head sampling -- decide at the start, before the outcome is known (cheap)
Tail sampling -- decide after the trace completes (can target errors specifically)
# Common Collector processors
batch -- group telemetry for efficient export
filter -- drop telemetry matching a condition
attributes -- add / rename / redact fields in flight
tail_sampling -- implements tail sampling at the Collector
memory_limiter -- sheds load before the Collector itself runs out of memory
# Debugging a missing-telemetry issue, in order
1. Confirm the SDK emits at all (temporary debug/console exporter, checked locally)
2. Confirm the Collector receives it (receiver's own accepted-span/metric count)
3. Check for a sampler or filter processor silently dropping it
4. Check the exporter endpoint/port -- grpc (4317) vs http (4318) is a common typo
# Verify against the current spec before relying on these
- W3C Trace Context header name/format (propagation across a network hop)
- OTel semantic convention attribute names (renamed across versions before)
