Skip to content

Commit 74bd60e

Browse files
committed
om2: pre rc.0 changes from WG
Signed-off-by: bwplotka <bwplotka@gmail.com> tmp Signed-off-by: bwplotka <bwplotka@gmail.com> tmp Signed-off-by: bwplotka <bwplotka@gmail.com>
1 parent b8fc35f commit 74bd60e

1 file changed

Lines changed: 27 additions & 19 deletions

File tree

docs/specs/om/open_metrics_spec_2_0.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,48 +40,56 @@ Created in 2012, Prometheus has been the default for cloud-native observability
4040

4141
In 2020, [OpenMetrics 1.0](open_metrics_spec.md) was released to clean up and tighten the specification with the additional purpose of bringing it into IETF. OpenMetrics 1.0 text exposition documented a working standard with wide and organic adoption among dozens of exporters, integrations, and ingestors.
4242

43-
Around 2024, the OpenMetrics project was incorporated under the CNCF Prometheus project umbrella. Together with production learnings from deploying OpenMetrics 1.0 on wide scale and a backlog of new Prometheus innovations missing from the text formats, Prometheus community decided to pursue a second version of OpenMetrics standard.
43+
Around 2024, the OpenMetrics project was incorporated under the CNCF Prometheus project umbrella. Together with production learnings from deploying OpenMetrics 1.0 on wide scale and a backlog of new Prometheus innovations missing from the text formats, Prometheus community decided to pursue a second version of the OpenMetrics standard.
4444

45-
The intention of OpenMetrics 2.0 is to use OpenMetrics 1.0 as a foundation and enhance it to achieve even greater reliability, usability and consistency with the modern Prometheus data model, without sacrificing the ease of use and readability. See TODO for changes, since the OpenMetrics 1.0.
45+
The intention of OpenMetrics 2.0 is to use OpenMetrics 1.0 as a foundation and enhance it to achieve even greater reliability, usability and consistency with the modern Prometheus data model, without sacrificing the ease of use and readability. OpenMetrics 2.0 also improves compatibility with OpenTelemetry data model and naming conventions.
4646

47-
This document is meant to be used a standalone specification, although the majority of the content is reused from the [OpenMetrics 1.0](open_metrics_spec.md).
47+
This document is meant to be used as a standalone specification.
4848

49-
> NOTE: This document is an early draft, major changes expected. Read [here](https://github.com/prometheus/OpenMetrics/issues/276) on how to join [the Prometheus OM 2.0 work group](https://docs.google.com/document/d/1FCD-38Xz1-9b3ExgHOeDTQUKUatzgj5KbCND9t-abZY/edit?tab=t.lvx6fags1fga#heading=h.uaaplxxbz60u).
49+
> NOTE: This is a release candidate (RC) version of the OpenMetrics 2.0 specification. This means that this specification is currently in an experimental state--no major changes are expected, but we reserve the right to break the compatibility if it's necessary, based on the early adopters' feedback. The potential feedback, questions and suggestions should be added as [an issue on the `prometheus/openmetrics` repository](https://github.com/prometheus/openmetrics).
5050
5151
## Overview
5252

5353
Metrics are a specific kind of telemetry data. They represent a snapshot of the current state for a set of data. They are distinct from logs or events, which focus on records or information about individual events.
5454

5555
OpenMetrics is primarily a wire format, independent of any particular transport for that format. The format is expected to be consumed on a regular basis and to be meaningful over successive expositions.
5656

57-
Implementers MUST expose metrics in the OpenMetrics text format in response to a simple HTTP GET request to a documented URL for a given process or device. This endpoint SHOULD be called "/metrics". Implementers MAY also expose OpenMetrics formatted metrics in other ways, such as by regularly pushing metric sets to an operator-configured endpoint over HTTP.
57+
Implementers SHOULD expose metrics in the OpenMetrics text format in response to an HTTP GET request to a documented URL for a given process or device. This endpoint SHOULD be called "/metrics". Implementers MAY also expose OpenMetrics formatted metrics in other ways, for example, by regularly pushing metric sets to an operator-configured endpoint over HTTP.
5858

5959
### Metrics and Time Series
6060

61-
This standard expresses all system states as numerical values; counts, current values, enumerations, and boolean states being common examples. Contrary to metrics, singular events occur at a specific time. Metrics tend to aggregate data temporally. While this can lose information, the reduction in overhead is an engineering trade-off commonly chosen in many modern monitoring systems.
61+
This standard expresses all system states as numerical values; counts, current values, distributions, enumerations, and boolean states being common examples. Contrary to metrics, singular events occur at a specific time. Metrics tend to aggregate data temporally. While this can lose information, the reduction in overhead is an engineering trade-off commonly chosen in many modern monitoring systems.
6262

63-
Time series are a record of changing information over time. While time series can support arbitrary strings or binary data, only numeric data is in scope for this RFC.
64-
65-
Common examples of metric time series would be network interface counters, device temperatures, BGP connection states, and alert states.
63+
Time series are a record of changing information over time. Common examples of metric time series would be network interface counters, device temperatures, BGP connection states, latency distributions, and alert states.
6664

6765
## Data Model
6866

69-
This section MUST be read together with the ABNF section. In case of disagreements between the two, the ABNF's restrictions MUST take precedence. This reduces repetition as the text wire format MUST be supported.
67+
This section MUST be read together with the ABNF section. In case of disagreements between the two, the ABNF's restrictions MUST take precedence.
68+
69+
// TODO: High level diagram to put here.
7070

7171
### Data Types
7272

73-
#### Values
73+
// TODO(dashpole): Fix on Data model redefinition was "Values".
74+
#### Sample Values
7475

7576
Metric values in OpenMetrics MUST be either Number or CompositeValue.
7677

7778
##### Number
7879

80+
// MAYBE: Clarify floating point exactly / link to where we do this instead of float64
81+
// MAYBE: "ut it MAY be used to signal a division by zero" -> add or any result of the math operations that would result it in.
7982
Number value MUST be either floating point or integer. Note that ingestors of the format MAY only support float64. The non-real values NaN, +Inf and -Inf MUST be supported. NaN value MUST NOT be considered a missing value, but it MAY be used to signal a division by zero.
8083

84+
Booleans MUST be represented as a Number value where `1` is true and `0` is false.
85+
8186
##### CompositeValue
8287

88+
// TODO(dashpole): Fix on Data model redefinition "Sample value"
89+
// * Sample = value + timestamp + st + exemplars
8390
CompositeValue MUST contain all information necessary to recreate a sample value for Metric within the MetricFamily.
8491

92+
// TODO(dashpole): Fix on Data model redefinition "Metric Values" -> maybe "Sample Values"
8593
The following MetricFamily Types MUST use CompositeValue for Metric Values:
8694

8795
* [Histogram](#histogram) MetricFamily Type.
@@ -90,14 +98,9 @@ The following MetricFamily Types MUST use CompositeValue for Metric Values:
9098

9199
Other MetricFamily Types MUST use Numbers.
92100

93-
See [MetricFamily Types](#metricfamily-types) for details.
94-
95-
##### Booleans
96-
97-
Boolean values MUST follow `1==true`, `0==false`.
98-
99101
#### Timestamps
100102

103+
// MAYBE: Mention its float?
101104
Timestamps MUST be Unix Epoch in seconds. Negative timestamps MAY be used.
102105

103106
#### Strings
@@ -110,6 +113,7 @@ Labels are key-value pairs consisting of strings.
110113

111114
Label names beginning with two underscores are RESERVED and MUST NOT be used unless specified by this standard. Such Label names MAY be used in place of TYPE and UNIT metadata in cases where MetricFamilies' metadata might otherwise be conflicting, such as metric federation cases.
112115

116+
// MAYBE: Link to where we explain "UTF-8 metrics may reduce usability"
113117
Label names SHOULD follow the restrictions in the ABNF section under the `label-name` section. Label names MAY be any quoted escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics may reduce usability.
114118

115119
Empty label values SHOULD be treated as if the label was not present.
@@ -118,26 +122,30 @@ Empty label values SHOULD be treated as if the label was not present.
118122

119123
A LabelSet MUST consist of Labels and MAY be empty. Label names MUST be unique within a LabelSet.
120124

125+
// TODO(dashpole): Sample
121126
#### MetricPoint
122127

128+
// TODO(dashpole): Updating... (removed)
123129
Each MetricPoint consists of a set of values, depending on the MetricFamily Type.
124130

125131
#### Exemplars
126132

127133
Exemplars are references to data outside of the MetricSet. A common use case are IDs of program traces.
128134

129-
Exemplars MUST consist of a LabelSet and a value, and MUST have a timestamp. The LabelSet SHOULD NOT contain any Label names included in the MetricPoint's LabelSet. The timestamp SHOULD NOT be after the MetricPoint's timestamp, if present, and SHOULD NOT be before the MetricPoint's start timestamp, if present.
135+
Exemplars MUST consist of a LabelSet and a Number value, and MUST have a timestamp. The LabelSet SHOULD NOT contain any Label names included in the MetricPoint's LabelSet. The timestamp SHOULD be before or equal to the MetricPoint's timestamp, if present. The timestamp SHOULD be after or equal to the MetricPoint's start timestamp, if present.
130136

131-
The Exemplar's timestamp SHOULD be close to the point in time when the referenced data was created, but doesn't have to be exact. For example if getting an exact timestamp is costly, it is acceptable to use some external source or synthetic clock.
137+
The Exemplar's timestamp SHOULD be close to the point when it was observed, but doesn't have to be exact. For example, if getting an exact timestamp is costly, it is acceptable to use some external source or an estimate.
132138

133139
When an exemplar references a [Trace Context](https://www.w3.org/TR/trace-context-2/), it SHOULD use the `trace_id` key for the [trace-id](https://www.w3.org/TR/trace-context-2/#traceparent-header) field, and the `span_id` key for the [`parent-id`](https://www.w3.org/TR/trace-context-2/#traceparent-header) field.
134140

135141
While there's no [hard limit](#size-limits) specified, Exemplar's LabelSet SHOULD NOT be used to transport large data like tracing span details or other event logging.
136142

143+
// TODO: "If you truncate data try to preserve trace id and span id"
137144
Ingestors MAY truncate the Exemplar's LabelSet or discard Exemplars.
138145

139146
#### Metric
140147

148+
// TODO(dashpole) updating
141149
Metrics are defined by a unique LabelSet within a MetricFamily. Metrics MUST contain a list of one or more MetricPoints. Metrics with the same name for a given MetricFamily SHOULD have the same set of label names in their LabelSet.
142150

143151
MetricPoints SHOULD NOT have explicit timestamps.

0 commit comments

Comments
 (0)