Skip to content

Commit 9c3136c

Browse files
committed
hard wraps
Signed-off-by: bwplotka <bwplotka@gmail.com>
1 parent 27d8b71 commit 9c3136c

2 files changed

Lines changed: 43 additions & 35 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ help: ## Displays help.
1313
fmt: ## Format docs.
1414
fmt: $(MDOX)
1515
@echo "Formatting markdown files..."
16-
@$(MDOX) fmt --soft-wraps --links.validate $(MD_FILES_TO_FORMAT)
16+
@$(MDOX) fmt --links.validate $(MD_FILES_TO_FORMAT)
1717

1818
.PHONY: check
1919
check: ## Checks if doc is formatter and links are correct (don't check external links).
2020
check: $(MDOX)
2121
@echo "Checking markdown file formatting and basic links..."
22-
@$(MDOX) fmt --soft-wraps --links.validate --links.validate.config-file=./.mdox.validator.yaml --check $(MD_FILES_TO_FORMAT) || (echo "🔥 Validation failed, files not formatted or links are broken. Try running 'make fmt' to fix formatting!" && exit 1)
22+
@$(MDOX) fmt --links.validate --links.validate.config-file=./.mdox.validator.yaml --check $(MD_FILES_TO_FORMAT) || (echo "🔥 Validation failed, files not formatted or links are broken. Try running 'make fmt' to fix formatting!" && exit 1)
2323
@echo "✅ Markdown files correctly formatted"

docs/specs/om/open_metrics_spec_2_0.md

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
---
2-
title: OpenMetrics 2.0
3-
sort_rank: 3
2+
title: "OpenMetrics 2.0"
43
nav_title: "2.0"
4+
sort_rank: 3
5+
56
hide_in_nav: true
7+
68
author:
7-
- email: arthursens2005@gmail.com
8-
ins: A. Silva Sens
9-
name: Arthur Silva Sens
10-
organization: Grafana Labs
11-
- email: bwplotka@gmail.com
12-
ins: B. Płotka
13-
name: Bartłomiej Płotka
14-
organization: Google
15-
- email: dashpole@google.com
16-
ins: D. Ashpole
17-
name: David Ashpole
18-
organization: Google
19-
- email: krajo@prometheus.io
20-
ins: G. Krajcsovits
21-
name: György Krajcsovits
22-
organization: Grafana Labs
23-
- email: owen.williams@grafana.com
24-
ins: O. Williams
25-
name: Owen Williams
26-
organization: Grafana Labs
27-
- email: richih@richih.org
28-
ins: R. Hartmann
29-
name: Richard Hartmann
30-
organization: Grafana Labs
9+
- ins: A. Silva Sens
10+
name: Arthur Silva Sens
11+
organization: Grafana Labs
12+
email: arthursens2005@gmail.com
13+
- ins: B. Płotka
14+
name: Bartłomiej Płotka
15+
organization: Google
16+
email: bwplotka@gmail.com
17+
- ins: D. Ashpole
18+
name: David Ashpole
19+
organization: Google
20+
email: dashpole@google.com
21+
- ins: G. Krajcsovits
22+
name: György Krajcsovits
23+
organization: Grafana Labs
24+
email: krajo@prometheus.io
25+
- ins: O. Williams
26+
name: Owen Williams
27+
organization: Grafana Labs
28+
email: owen.williams@grafana.com
29+
- ins: R. Hartmann
30+
name: Richard Hartmann
31+
organization: Grafana Labs
32+
email: richih@richih.org
3133
---
3234

3335
- Version: 2.0.0-rc0
@@ -66,7 +68,7 @@ Common examples of metric time series would be network interface counters, devic
6668

6769
## Data Model
6870

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.
71+
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.
7072

7173
### Data Types
7274

@@ -157,7 +159,7 @@ MetricFamily name:
157159
* MUST be the same as every MetricPoint's MetricName in the family.
158160

159161
> NOTE: [OpenMetrics 1.0](https://prometheus.io/docs/specs/om/open_metrics_spec/#suffixes) required mandatory suffixes
160-
> for MetricName and matching MetricFamily names without such suffixes. To improve parser reliability (i.e. matching
162+
> for MetricName and matching MetricFamily names without such suffixes. To improve parser reliability (i.e. matching
161163
> [MetricFamily metadata](#metricfamily-metadata)) and future compatibility, this specification requires MetricFamily name to strictly match MetricNames
162164
> in the same family.
163165
@@ -676,11 +678,12 @@ Timestamps SHOULD NOT use exponential float rendering for timestamps if nanoseco
676678

677679
There MUST NOT be an explicit separator between MetricFamilies. The next MetricFamily MUST be signalled with either metadata or a new sample metric name which cannot be part of the previous MetricFamily.
678680

681+
679682
MetricFamilies MUST NOT be interleaved.
680683

681684
#### MetricFamily metadata
682685

683-
There are four pieces of metadata: The MetricFamily name, TYPE, UNIT and HELP. An example of the metadata for a counter Metric called foo is:
686+
There are four pieces of metadata: The MetricFamily name, TYPE, UNIT and HELP. An example of the metadata for a counter Metric called foo is:
684687

685688
```openmetrics-add-eof
686689
# TYPE foo counter
@@ -833,7 +836,7 @@ An example of a MetricFamily with no Metrics:
833836
# TYPE foo gauge
834837
```
835838

836-
An example with a Metric with a label and a MetricPoint with a timestamp:
839+
An example with a Metric with a label and a MetricPoint with a timestamp:
837840

838841
```openmetrics-add-eof
839842
# TYPE foo gauge
@@ -1245,13 +1248,16 @@ After namespacing by company or organisation, namespacing and naming should cont
12451248

12461249
For a common very well known existing piece of software, the name of the software itself may be sufficiently distinguishing. For example bind_ is probably sufficient for the DNS software, even though isc_bind_ would be the more usual naming.
12471250

1251+
12481252
Metric names prefixed by scrape_ are used by ingestors to attach information related to individual expositions, so should not be exposed by applications directly. Metrics that have already been consumed and passed through a general purpose monitoring system may include such metric names on subsequent expositions.
12491253
If an exposer wishes to provide information about an individual exposition, a metric prefix such as myexposer_scrape_ may be used. A common example is a gauge myexposer_scrape_duration_seconds for how long that exposition took from the exposer's standpoint.
12501254

12511255
Within the Prometheus ecosystem a set of per-process metrics has emerged that are consistent across all implementations, prefixed with process_. For example for open file ulimits the MetricFamiles process_open_fds and process_max_fds gauges provide both the current and maximum value. (These names are legacy, if such metrics were defined today they would be more likely called process_fds_open and process_fds_limit). In general it is very challengings to get names with identical semantics like this, which is why different instrumentation should use different names.
12521256

1257+
12531258
Avoid redundancy in metric names. Avoid substrings like "metric", "timer", "stats", "counter", "total", "float64" and so on - by virtue of being a metric with a given type (and possibly unit) exposed via OpenMetrics information like this is already implied so should not be included explicitly. You should not include label names of a metric in the metric name for the same reasons, and in addition subsequent aggregation of the metric by a monitoring system could make such information incorrect.
12541259

1260+
12551261
Avoid including implementation details from other layers of your monitoring system in the metric names contained in your instrumentation. For example a MetricFamily name should not contain the string "openmetrics" merely because it happens to be currently exposed via OpenMetrics somewhere, or "prometheus" merely because your current monitoring system is Prometheus.
12561262

12571263
### Label Namespacing
@@ -1291,7 +1297,7 @@ OpenMetrics builds on the existing widely adopted Prometheus text exposition for
12911297

12921298
Metadata can come from different sources. Over the years, two main sources have emerged. While they are often functionally the same, it helps in understanding to talk about their conceptual differences.
12931299

1294-
"Target metadata" is metadata commonly external to an exposer. Common examples would be data coming from service discovery, a CMDB, or similar, like information about a datacenter region, if a service is part of a particular deployment, or production or testing. This can be achieved by either the exposer or the ingestor adding labels to all Metrics that capture this metadata. Doing this through the ingestor is preferred as it is more flexible and carries less overhead. On flexibility, the hardware maintenance team might care about which server rack a machine is located in, whereas the database team using that same machine might care that it contains replica number 2 of the production database. On overhead, hardcoding or configuring this information needs an additional distribution path.
1300+
"Target metadata" is metadata commonly external to an exposer. Common examples would be data coming from service discovery, a CMDB, or similar, like information about a datacenter region, if a service is part of a particular deployment, or production or testing. This can be achieved by either the exposer or the ingestor adding labels to all Metrics that capture this metadata. Doing this through the ingestor is preferred as it is more flexible and carries less overhead. On flexibility, the hardware maintenance team might care about which server rack a machine is located in, whereas the database team using that same machine might care that it contains replica number 2 of the production database. On overhead, hardcoding or configuring this information needs an additional distribution path.
12951301

12961302
"Exposer metadata" is coming from within an exposer. Common examples would be software version, compiler version, or Git commit SHA.
12971303

@@ -1322,7 +1328,7 @@ The above discussion is in the context of individual exposers. An exposition fro
13221328

13231329
### Client Calculations and Derived Metrics
13241330

1325-
Exposers should leave any math or calculation up to ingestors. A notable exception is the Summary quantile which is unfortunately required for backwards compatibility. Exposition should be of raw values which are useful over arbitrary time periods.
1331+
Exposers should leave any math or calculation up to ingestors. A notable exception is the Summary quantile which is unfortunately required for backwards compatibility. Exposition should be of raw values which are useful over arbitrary time periods.
13261332

13271333
As an example, you should not expose a gauge with the average rate of increase of a counter over the last 5 minutes. Letting the ingestor calculate the increase over the data points they have consumed across expositions has better mathematical properties and is more resilient to scrape failures.
13281334

@@ -1369,6 +1375,7 @@ As per the parent section, ingestors should be free to attach their own timestam
13691375
my_counter_total 1 123
13701376
```
13711377

1378+
13721379
In case the specific time of the last change of a counter matters, this would be the correct way:
13731380

13741381
```
@@ -1383,6 +1390,7 @@ my_counter_last_increment_timestamp_seconds 123
13831390

13841391
By putting the timestamp of last change into its own Gauge as a value, ingestors are free to attach their own timestamp to both Metrics.
13851392

1393+
13861394
Experience has shown that exposing absolute timestamps (epoch is considered absolute here) is more robust than time elapsed, seconds since, or similar. In either case, they would be gauges. For example:
13871395

13881396
```
@@ -1430,7 +1438,7 @@ Specific limits run the risk of preventing reasonable use cases, for example whi
14301438

14311439
On the other hand, an exposition which is too large in some dimension could cause significant performance problems compared to the benefit of the metrics exposed. Thus some guidelines on the size of any single exposition would be useful.
14321440

1433-
ingestors may choose to impose limits themselves, for in particular to prevent attacks or outages. Still, ingestors need to consider reasonable use cases and try not to disproportionately impact them. If any single value/metric/exposition exceeds such limits then the whole exposition must be rejected.
1441+
ingestors may choose to impose limits themselves, for in particular to prevent attacks or outages. Still, ingestors need to consider reasonable use cases and try not to disproportionately impact them. If any single value/metric/exposition exceeds such limits then the whole exposition must be rejected.
14341442

14351443
In general there are three things which impact the performance of a general purpose monitoring system ingestion time series data: the number of unique time series, the number of samples over time in those series, and the number of unique strings such as metric names, label names, label values, and HELP. ingestors can control how often they ingest, so that aspect does not need further consideration.
14361444

0 commit comments

Comments
 (0)