What are Prometheus metric naming conventions?
IntermediateConceptObservability Fundamentals & Signals
Answer
snake_case, prefixed with the domain or app:myapp_jobs_processed_total.- Base units in the name:
_seconds,_bytes,_ratio(never milliseconds or MB). - Counters end in
_total; histograms produce_bucket,_sum,_count. - Labels describe dimensions, not the metric itself:
http_requests_total{code="500"}, nothttp_500_requests_total.
Prometheus 3.x supports UTF-8 metric and label names (to interoperate with OpenTelemetry dotted names), but we still use the classic convention for portability.
More on Observability Fundamentals & Signals
What is the difference between monitoring and observability?BeginnerWhat are the "three pillars" of observability, and what is the fourth signal people now add?BeginnerWhen would you reach for metrics, logs, traces or profiles during an incident?BeginnerWhat are the four Prometheus metric types?BeginnerWhy should you never use a gauge to count requests?BeginnerHistogram vs summary: what is the real difference, and which do you choose?Intermediate