Learn
WebsiteLoginFree Trial
  • Incident Management
    • What is Incident Management? Beginner's Guide
    • Severity Levels
    • How to calculate MTTR and Other Common Incident Recovery Metrics
    • On-Call
    • SLA vs SLO vs SLI: What's The Difference?
    • Data Aggregation and Aggregators
  • DevOps
    • Best DevOps Tools for Each Phase of the DevOps Lifecycle
      • Best DevOps Planning Tools
      • Best DevOps Coding Tools
      • Best DevOps Build Tools
      • Best DevOps Testing Tools
      • Best DevOps Release Tools
      • Best DevOps Deployment Tools
      • Best DevOps Operations Tools
      • Best DevOps Monitroing Tools
    • What is DevOps?
      • Best CI/CD Tools
      • DevOps Infrastructure and Automation
      • What is a DevOps Pipeline?
      • DevOps Vs. Agile
      • Top 25 DevOps Interview Questions
      • What Are the Benefits of DevOps?
      • What is CI/CD?
      • What is a DevOps Engineer?
      • What is DevSecOps?
    • What is Observability?
      • USE and RED Method
    • What is Site Reliability Engineering (SRE)?
      • Four Golden Signals: SRE Monitoring
      • What is A Canary Deployment?
      • What is Blue-Green Deployment?
  • Docker
    • Overview
    • Dockerfile
    • Images
    • Containers
    • Storage
    • Network
    • Compose
    • Swarm
    • Resources
  • prometheus
    • Overview
    • Data Model
    • Metric Types
    • PromQL
      • Series Selection
      • Counter Rates & Increases
    • Pushgateway
    • Alertmanager
    • Remote Storage
Powered by GitBook
On this page
  • Time Series
  • What is a Metric?
  • What is a Label?
  • Samples
  • Naming Conventions
  • Base Units

Was this helpful?

  1. prometheus

Data Model

Learn about the Prometheus time series data model. Understand what metrics and labels are. Learn best practices for naming conventions and base units.

PreviousOverviewNextMetric Types

Last updated 1 year ago

Was this helpful?

Time Series

Prometheus stores all data as : streams of numeric values sampled at ongoing timestamps.

| Series                                           | Value |
| ------------------------------------------------ | ----- |
| http_requests_total{method="POST", status="200"} | 4130  |
| http_requests_total{method="POST", status="500"} | 2     |

What is a Metric?

In Prometheus, everything revolves around metrics. A metric is a feature (i.e., a characteristic) of a system being measured. Typical examples of metrics are:

  • http_requests_total

  • http_request_size_bytes

  • system_memory_used_bytes

  • node_network_receive_bytes_total

What is a Label?

In Prometheus, metric labels are sets of key-value pairs that help categorize and differentiate subdimensions.

Typical examples of labels for the http_requests_total metric include:

  • method: GET|PUT|POST|DELETE

  • status: 100..599

  • path: /api/v4/alerts

CAUTION: Remember that every unique combination of key-value label pairs represents a new time series, which can dramatically increase the amount of data stored. Do not use labels to store dimensions with high cardinality (many different label values), such as user IDs, IP addresses, email addresses, or other unbounded values.

Samples

  • Timestamps - 64-bit integers in millisecond precision.

  • Sample values - 64-bit floating point numbers.

Naming Conventions

Metric names should follow these rules:

  1. Use a single-word application prefix ("namespace") for the application's domain (e.g., pagertree_notifications_total, process_cpu_seconds_total, http_request_duration_seconds).

  2. Use a suffix describing the unit (e.g., pagertree_notifications_total, node_memory_usage_bytes, process_cpu_seconds_total).

  3. Represent a logical thing being measured (e.g., number of notifications sent, bytes of data transfer, request duration).

Base Units

Prometheus does not have any hard-coded units. Base units should be used for better compatibility. The following lists some metrics families with their base units. The list is not exhaustive.

Category
Base Unit

Time

seconds

Temperature

celcius

Length

meters

Bytes

bytes

Bits

bytes

Percent

ratio

Voltage

volts

Electric current

amperes

Energy

joules

Mass

grams

Every time series is uniquely identified by its and .

Samples form the bulk data and are appended to a over time.

Use a single unit specified in .

metric name
optional labels
series
base units
time series
Prometheus Time Series Data Model
Prometheus Time Series Data Model