Prometheus metric naming conventions for teams shipping their first metrics
A naming standard gives every team the same rules for metric names and label names, so queries, dashboards and alert rules work across services that were instrumented by different people. Without one, one team exports http_requests in seconds, another exports requestLatencyMs, and a single PromQL query or alert rule quietly misses half the estate. The standard is a written team agreement, not a product feature: Prometheus is licensed under Apache-2.0 and does not enforce naming, so the cost of the standard is the time to write it, review it and keep it current.
Prometheus collects metrics by pulling them over HTTP from targets, then stores each sample against a metric name and a set of labels. Every unique combination of metric name and label values becomes a separate time series, which means a label carrying user IDs, request paths or other unbounded values multiplies storage, memory and query cost with each new value. Names and labels are also what PromQL selects on, so a name that changes between versions breaks the dashboards and alert rules that depend on it. Before the first metrics ship, agree on prefixes per application, base units such as seconds and bytes, the _total suffix for counters, and a short list of allowed label keys.
Put the standard in a shared document and check new metrics against it before they reach production. Run promtool check metrics against the exposition output of each service during code review, and ask reviewers to confirm that each new label has a bounded set of values. Confirm with your own platform team which label keys are already in use across services, and record exceptions with an owner and an expiry date. Treat the standard as versioned: when a name must change, plan a period where old and new names are both exposed, and check the alert rules and dashboards that reference the old name.
Metric types and naming choices and when each fits
This table compares the four Prometheus metric types by what they measure, the naming pattern each takes, and the typical use. Read each row as a naming decision your team makes before a metric ships, and check the unit and _total rows first because they apply to almost every metric. The main takeaway is that the type chosen at creation determines the suffix and how queries must treat the metric later.
| Decision | What it measures and naming pattern | Typical use and when it fits |
|---|---|---|
| Counter | Value that only goes up and resets on restart. Name ends in _total, for example http_requests_total. | Events such as requests, errors or jobs processed. Query with rate() or increase(), never the raw value. |
| Gauge | Value that can rise and fall. Name has no _total suffix, for example queue_depth or temperature_celsius. | Current state such as queue length, open connections or memory in use. Read it directly or with aggregation. |
| Histogram | Counts observations in buckets plus a sum and count. Base name gets _bucket, _sum and _count suffixes. | Latency and size distributions that need aggregation across instances. See the sibling topic on histograms versus summaries for latency. |
| Summary | Pre-computed quantiles plus sum and count, with _sum and _count suffixes. Quantiles cannot be aggregated across instances. | Single-instance quantiles where aggregation is not needed. Confirm the trade-off against your query needs before choosing it. |
| Unit suffix | Name the base unit in the metric name, such as _seconds, _bytes or _celsius, and avoid scaled units like milliseconds. | Use for any measured quantity so dashboards and alerts share one unit. Confirm the base unit list in the official naming guidance. |
| _total suffix on counters | Required on counters so readers can spot cumulative values. Do not add _total to gauges. | Keeps counters recognizable in review and tooling. Check that exporters and client libraries apply the suffix consistently. |
| Label names | Use lowercase snake_case names that describe the dimension, such as method or status_code, not the value itself. | Keeps series counts bounded. Avoid user IDs, request IDs or raw URLs as label values. |
Which labels keep cardinality low
Every unique combination of label values creates a separate time series that Prometheus must hold in memory and store on disk. The cards below cover the label decisions that keep that count bounded, so a metric stays useful as traffic and users grow.
Keep unbounded values out
Values such as user IDs, request IDs, session tokens, raw URLs and email addresses have no upper limit, so each new value creates another series. Put these identifiers in logs or traces instead. Before shipping a metric, ask whether the label's set of values could keep growing with traffic, and if so, remove it.
Prometheus overviewUse route templates, not paths
Label HTTP metrics with the route template, such as /orders/{id}, rather than the full path that includes the identifier. The template comes from your router or framework, so the value set stays fixed. Check a sample of label values during review to confirm that no concrete IDs reach the label.
Keep label names consistent
Use the same label name for the same meaning across every metric, for example service everywhere rather than a mix of service, svc and app. Consistent names let teams join and aggregate metrics in PromQL without translation. Agree the shared names in a short written standard and check new metrics against it.
Avoid duplicate label information
Do not record the same fact in two labels, such as both a region and a zone label that always map one to one, or a pod label alongside a pod_ip label. Each duplicate multiplies the series count without adding information. Ask of each label whether another label already determines its value.
Use fixed outcome enumerations
Record status or outcome as a small fixed set, such as success, error and timeout, instead of raw error messages or free-text reasons. Map unexpected values to an other bucket in code. A closed list keeps the series count predictable and makes alert rules easier to write and test.
Measure series before release
Estimate the series count of each new metric by multiplying the number of values across its labels, then check the figure against your monitoring budget. Review this estimate in code review and confirm the live count after deployment. Your team should confirm the memory and retention limits set for the Prometheus server before adding large label sets.
- Default retention
- 15 days
How a new metric moves from proposal to release
A new metric starts as a proposal from the author and passes through a name check, a label check for bounded values, and a promtool check metrics run on the exposition output. The reviewer then estimates the expected series count before the change is merged and shipped. Any failed check returns the metric to the author with the specific fault, so the naming standard and cardinality limits are enforced before the metric reaches production scrapes.
Review gates a new metric passes before it ships, with the return path to the author.
Set up a naming standard and review process
This sequence turns naming rules into a working control: existing metrics are inventoried, the standard is agreed and written down, automated checks stop drift in CI, and new or renamed metrics pass a review before they reach dashboards and alerts.
Inventory existing metric names and labels
Collect every metric name and label key exposed by services, exporters and batch jobs, including the scrape endpoints they come from. Run a query against a live Prometheus server or read each
/metricsoutput directly, and group results by owning team. Record metric type, label keys and any label that carries user IDs, request paths or other unbounded values. The step is done when each service owner has a list they have confirmed as complete, and the list shows the high-cardinality labels that need attention first.Agree prefix and unit rules with owners
Hold a short working session with platform engineering and the service owners who expose metrics. Decide the namespace prefix each team or system uses, the base units (seconds, bytes, ratios) and the suffixes for counters and totals. Confirm which exceptions are allowed and who approves them. The output is a list of decisions, each with an owner, and a note of any existing metric that will be kept under its current name for compatibility. Ask the Prometheus naming guidance and the official exporter guidelines to settle any point the group cannot decide.
Write the standard in a shared document
Turn the agreed decisions into one versioned document that lives in the same repository as the platform configuration or in a shared documentation space. Include worked examples of correct and incorrect names, a label policy with the allowed label keys, and the list of approved exceptions with reasons. Give the document a named maintainer and a change process. The step is complete when a service engineer who has not attended the working session can name a new counter from the document alone, and a reviewer can confirm the answer.
Add promtool and a label allow-list to CI
Add
promtool check metricsto the pipeline for each exporter or service that exposes metrics, so that naming and format problems fail the build before release. Pair it with a label allow-list check that compares the label keys in the test output against the approved list and fails on unknown keys. Keep the allow-list in version control next to the standard so changes to it are reviewed. The check is working when a deliberately misnamed test metric fails the build and the corrected version passes.Define a review step for new metrics
Add a review step to the change process for any merge request that adds or changes a metric, a label or an alert rule. The reviewer checks the name against the standard, confirms every new label has a bounded set of values, and asks what question the metric answers. Record the decision in the merge request. Agree which team can approve exceptions so reviews do not stall. The step is complete when a test merge request with an unbounded label is blocked by the reviewer and the author has a documented way to fix it.
Re-check dashboards and alert rules after renames
Every renamed metric or removed label breaks the queries that depend on it. Before the old name is removed, search dashboards, recording rules and alert rules for references to it, and update them in the same change. Keep the old and new names exposed in parallel for a period the owning team agrees, then remove the old one. The check is done when a search for the old metric name returns no results across dashboards, rule files and alert definitions, and the alerts that depend on it have fired or been tested with a known condition.
Operational and security considerations for label content
Every label value is stored in the time series database and shown to anyone who can query it, so label content is a security and operations decision as well as a naming one. The cards below cover what must stay out of labels, who can read them, and how label growth can be abused or break the server.
Keep personal data out of labels
Label values such as user emails, names, IP addresses or account numbers become stored personal data in the time series database. Prometheus keeps them for the retention period, which is 15 days by default, and copies them to any remote storage you configure. Review new metrics for fields that identify a person, and ask your privacy team whether those retention and access rules fit your data protection obligations.
Storage docsNever put secrets or tokens in labels
API keys, session tokens, bearer tokens and database passwords sometimes end up in label values, for example when a URL with a query string is used as a label. Anyone with query access can then read the secret, and it persists in storage and in any backup taken of the data. Strip query strings and path parameters before they become labels, and scan metric output in CI for token-like patterns.
Restrict who can read metrics
Prometheus has no built-in per-user read control, so metric labels are readable by every user who reaches the web UI or HTTP API. Confirm what your access layer provides: a reverse proxy with authentication, network segmentation, or separate Prometheus servers per audience. Treat label content as sensitive when deciding who gets query access, and document that decision.
Security modelGuard admin and lifecycle endpoints
Admin HTTP APIs are disabled by default, and enabling them allows destructive operations such as deleting series. The lifecycle endpoints allow reload and shutdown. A user who can reach these endpoints can remove the evidence of what a label recorded. Keep both flags off unless a runbook needs them, and limit network access to the API paths that remain open.
Cap label growth from bugs and attackers
An attacker who controls a value that becomes a label, such as a request path or user agent, can create a new series for every distinct input. A bug that puts a timestamp or request ID into a label has the same effect. Growth like this exhausts memory and disk and can make queries slow. Enforce an allowlist of label values for user-controlled input, and set sample and series limits so one bad release cannot take the server down.
Protect exporters from target abuse
Exporters such as SNMP and Blackbox take their targets from URL parameters. Anyone with HTTP access to them can make the exporter send requests to arbitrary endpoints, which can reach internal systems. Labels copied from those parameters carry the same risk. Bind exporters to localhost or a scrape-only network, and do not let users set probe targets through the exporter's public interface.
Questions teams ask before standardizing metric names
How much effort does a Prometheus metric naming standard take?
The effort depends on how many services and exporters emit metrics, how much metric sprawl already exists, and how many teams must agree on the result. Writing the standard itself is the smallest part. The larger costs are auditing current metric names and labels, deciding how to handle exceptions, and wiring checks into the review process so new metrics follow the rules. Expect the work to grow with each team that owns a service, because every team needs to review and adopt the naming rules. Cost depends on the written scope, so ask for the scope to list the services, exporters and review groups included before comparing quotes.
Can our own team write and enforce a naming standard without a partner?
Yes, many teams do this internally, especially when one platform group owns the monitoring stack and a small number of services. A partner is most useful when metric sprawl is large, several teams have built their own conventions, or the standard must be enforced in CI and reviewed against compliance evidence needs. The main internal requirements are an owner who can make naming decisions, engineers who will apply the rules to their own code, and time to review existing metrics. Ask yourself whether those three exist before deciding.
How long does it take to standardize metric names?
Duration depends on the number of metric families in use, the number of teams that must agree, and whether dashboards and alert rules depend on current names. A single team with a modest set of exporters can usually finish a first pass faster than an estate with several languages, libraries and owners. Build in time for review cycles with each team and for updating dashboards and alerts after names change. Ask for a timeline tied to the written scope, and check which milestones depend on access to repositories, CI systems and a sample of current metrics.
What do we need to provide before the naming work starts?
The work needs named owners for each service or exporter who can approve naming changes, a sample of current metrics exported from your Prometheus servers, and read access to the repositories that define instrumentation. CI access is needed if checks should run on pull requests. You should also provide the list of dashboards and alert rules that query existing names, so the team can see what a rename would affect. Missing any of these items usually stretches the timeline because the work stops while someone locates the answer.
Is renaming existing Prometheus metrics risky?
Renaming is risky when dashboards, recording rules, alert rules or external systems query the old name, because those queries return no data after the change. The safer approach is to plan renames in stages: add the new name alongside the old one, update queries and alerts, verify that both series match during a transition period, and then remove the old name. Keep a record of each rename so that alerts and reports can be traced. Dashboard and alert inventories are the most important input for judging the risk, so confirm that they exist before any rename starts.
How do we check that new metrics follow the naming standard?
Start with the rules the Prometheus project publishes for naming and use a linter such as promtool check metrics on exporter output, then add a review step for label choices that the tool cannot judge. Engineers should verify that label values come from bounded sets, since unbounded values such as user IDs raise cardinality and cost. Automated checks in CI catch most naming errors before a release, while review handles design questions. Confirm with your team which checks can run in your existing pipeline and who signs off exceptions.
Do naming conventions affect compliance evidence?
Consistent names make monitoring evidence easier to review, because an assessor can trace a control's metrics, dashboards and alert rules without interpreting local naming habits. Naming standards do not make a system compliant by themselves, and DeployOpen does not issue audit reports or certifications. Ask your compliance lead which evidence they expect and whether the naming rules, review records and rename history should be retained as part of the monitoring control set.
How the scope of a naming review is agreed
Scope is agreed in writing before any review starts, and for a naming review it usually covers four things: which services and exporters are in scope, whether the team wants a new naming standard written or an existing one reviewed, which checks run automatically in continuous integration, and how new metrics move through review once the standard is in place. Name the services explicitly. A list such as the payments API, the batch reconciliation jobs and the internal admin console is far more useful than "all our services", because it determines which codebases, dashboards and alert rules are read during the work.
On the standard itself, ask for a written decision on the parts that are easy to leave vague: the metric prefix per team or product, the base units used for durations and sizes, the rule that counters end in _total, and the list of label names that are allowed to carry unbounded values. For the automated side, agree which validation runs in the pipeline, for example promtool check metrics on exported output, and whether a failing check blocks a merge or only warns. Confirm the current promtool behavior against the version your team pins, since the tooling evolves.
Your team must provide access to the repositories and a sample of live metric output from a non-production Prometheus, a named owner who can approve naming decisions, and the dashboards and alert rules that consume the metrics, because renaming a metric breaks them. The written scope should state what you receive: the standard document, the reviewed list of metrics with proposed changes, the CI configuration and a short guide for authors. It should also state what is out of scope, such as renaming series already stored in long-term storage. Ask for the review timeline and the retest approach in the quote, not as a separate estimate.
How DeployOpen works on this
DeployOpen treats Prometheus metric and label naming as a written standard that your teams can review, build against and keep following after handover. The work is scoped in writing before it starts, so the naming rules, the review process and the deliverables are agreed up front.
How we scope
- Inventory the metrics, exporters and client libraries your services already expose, and note where names and labels already diverge.
- Agree a written naming standard covering prefixes, base units, suffixes, _total counters and label rules for your estate.
- Define which label keys are allowed, which are banned, and who approves new label values before they ship.
How we build
- Write the naming guide and a reviewable checklist that engineers can apply to new metrics in code review.
- Test sample metrics and exporters with promtool check metrics and review cardinality impact before changes are merged.
- Rename or relabel existing metrics where needed, with a plan for dashboards and alert rules that reference old names.
How we hand over
- Deliver the naming standard, review checklist and a list of renamed metrics with the dashboards and alerts affected.
- Document the decisions behind each rule so future teams can understand trade-offs rather than only follow the list.
- Walk your platform and service owners through the review process and the questions to ask before adding a metric.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing review of new metrics, exporter changes and Prometheus upgrades can be covered by a retainer.
- Confirm the Prometheus version and exporter set in your environment with DeployOpen before the scope is written.

