网页 综合 更新时间 2026-11-13 21:49:59

Data model | Prometheus

自动蜘蛛 prometheus.io 正文约 2157 字
Prometheus fundamentally stores all data as time series: streams of timestamped values belonging to the same metric and the same set of labeled dimensions. Besides stored time series, Prometheus may generate temporary derived time series as the result of queries.
Every time series is uniquely identified by its metric name and optional key-value pairs called labels.
Labels let you capture different instances of the same metric name. For example: all HTTP requests that used the method POST to the /api/tracks handler. We refer to this as Prometheus's "dimensional data model". The query language allows filtering and aggregation based on these dimensions. The change of any label's value, including adding or removing labels, will create a new time series.
WARNING: The UTF-8 support for metric and label names was added relatively recently in Prometheus v3.0.0. It might take time for the wider ecosystem (downstream PromQL compatible projects and vendors, tooling, third-party instrumentation, collectors, etc.) to adopt new quoting mechanisms, relaxed validation etc. For the best compatibility it's recommended to stick to the recommended ("SHOULD") character set.
INFO: See also the best practices for naming metrics and labels.
Samples form the actual time series data. Each sample consists of:
Given a metric name and a set of labels, time series are frequently identified using this notation:
For example, a time series with the metric name api_http_requests_total and the labels method="POST" and handler="/messages" could be written like this:
This is the same notation that OpenTSDB uses.
Names with UTF-8 characters outside the recommended set must be quoted, using this notation:
Since metric name are internally represented as a label pair with a special label name (__name__="<metric name>") one could also use the following notation:
© Prometheus Authors 2014-2026 | All components are available under the Apache 2 License on GitHub.
© 2026 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
访问原文 返回搜索 https://prometheus.io/docs/concepts/data_model/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。