You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.Info("Converting delta OTLP metrics to cumulative")
286
-
case"otlp-native-delta-ingestion":
287
-
// Experimental OTLP native delta ingestion.
288
-
// This currently just stores the raw delta value as-is with unknown metric type. Better typing and
289
-
// type-aware functions may come later.
290
-
// See proposal: https://github.com/prometheus/proposals/pull/48
291
-
c.web.NativeOTLPDeltaIngestion=true
292
-
logger.Info("Enabling native ingestion of delta OTLP metrics, storing the raw sample values without conversion. WARNING: Delta support is in an early stage of development. The ingestion and querying process is likely to change over time.")
293
286
case"type-and-unit-labels":
294
287
c.scrape.EnableTypeAndUnitLabels=true
295
288
logger.Info("Experimental type and unit labels enabled")
296
-
case"use-uncached-io":
297
-
c.tsdb.UseUncachedIO=true
298
-
logger.Info("Experimental Uncached IO is enabled.")
299
289
default:
300
290
logger.Warn("Unknown option for --enable-feature", "option", o)
When enabled, allows for the native ingestion of delta OTLP metrics, storing the raw sample values without conversion. This cannot be enabled in conjunction with `otlp-deltatocumulative`.
225
-
226
-
Currently, the StartTimeUnixNano field is ignored, and deltas are given the unknown metric metadata type.
227
-
228
-
Delta support is in a very early stage of development and the ingestion and querying process my change over time. For the open proposal see [prometheus/proposals#48](https://github.com/prometheus/proposals/pull/48).
229
-
230
-
### Querying
231
-
232
-
We encourage users to experiment with deltas and existing PromQL functions; we will collect feedback and likely build features to improve the experience around querying deltas.
233
-
234
-
Note that standard PromQL counter functions like `rate()` and `increase()` are designed for cumulative metrics and will produce incorrect results when used with delta metrics. This may change in the future, but for now, to get similar results for delta metrics, you need `sum_over_time()`:
235
-
236
-
*`sum_over_time(delta_metric[<range>])`: Calculates the sum of delta values over the specified time range.
237
-
*`sum_over_time(delta_metric[<range>]) / <range>`: Calculates the per-second rate of the delta metric.
238
-
239
-
These may not work well if the `<range>` is not a multiple of the collection interval of the metric. For example, if you do `sum_over_time(delta_metric[1m]) / 1m` range query (with a 1m step), but the collection interval of a metric is 10m, the graph will show a single point every 10 minutes with a high rate value, rather than 10 points with a lower, constant value.
240
-
241
-
### Current gotchas
242
-
243
-
* If delta metrics are exposed via [federation](https://prometheus.io/docs/prometheus/latest/federation/), data can be incorrectly collected if the ingestion interval is not the same as the scrape interval for the federated endpoint.
244
-
245
-
* It is difficult to figure out whether a metric has delta or cumulative temporality, since there's no indication of temporality in metric names or labels. For now, if you are ingesting a mix of delta and cumulative metrics we advise you to explicitly add your own labels to distinguish them. In the future, we plan to introduce type labels to consistently distinguish metric types and potentially make PromQL functions type-aware (e.g. providing warnings when cumulative-only functions are used with delta metrics).
246
-
247
-
* If there are multiple samples being ingested at the same timestamp, only one of the points is kept - the samples are **not** summed together (this is how Prometheus works in general - duplicate timestamp samples are rejected). Any aggregation will have to be done before sending samples to Prometheus.
248
-
249
220
## Type and Unit Labels
250
221
251
222
`--enable-feature=type-and-unit-labels`
252
223
253
-
When enabled, Prometheus will start injecting additional, reserved `__type__`
254
-
and `__unit__` labels as designed in the [PROM-39 proposal](https://github.com/prometheus/proposals/pull/39).
255
-
256
-
Those labels are sourced from the metadata structured of the existing scrape and ingestion formats
257
-
like OpenMetrics Text, Prometheus Text, Prometheus Proto, Remote Write 2 and OTLP. All the user provided labels with
258
-
`__type__` and `__unit__` will be overridden.
259
-
260
-
PromQL layer will handle those labels the same way __name__ is handled, e.g. dropped
261
-
on certain operations like `-` or `+` and affected by `promql-delayed-name-removal` feature.
224
+
When enabled, Prometheus will start injecting additional, special `__type__`
225
+
and `__unit__` labels that extends the existing `__name__` metric identity.
262
226
263
-
This feature enables important metadata information to be accessible directly with samples and PromQL layer.
264
-
265
-
It's especially useful for users who:
227
+
Those labels are injected from the metadata parts of OpenMetrics and other scrape expositions
228
+
, as well as Remote Write 2.0 and OTLP receive. All user provided labels with
229
+
`__type__` and `__unit__` will be dropped or overridden.
266
230
231
+
This is useful for users who:
267
232
* Want to be able to select metrics based on type or unit.
268
233
* Want to handle cases of series with the same metric name and different type and units.
269
-
e.g. native histogram migrations or OpenTelemetry metrics from OTLP endpoint, without translation.
234
+
e.g. native histogram migrations or OpenTelemetry metrics from OTLP endpoint, without translation.
270
235
271
-
In future more [work is planned](https://github.com/prometheus/prometheus/issues/16610) that will depend on this e.g. rich PromQL UX that helps
236
+
In future more work is planned that will depend on this e.g. rich PromQL UX that helps
272
237
when wrong types are used on wrong functions, automatic renames, delta types and more.
273
238
274
-
## Use Uncached IO
275
-
276
-
`--enable-feature=use-uncached-io`
277
-
278
-
Experimental and only available on Linux.
279
-
280
-
When enabled, it makes chunks writing bypass the page cache. Its primary
281
-
goal is to reduce confusion around page‐cache behavior and to prevent over‑allocation of
282
-
memory in response to misleading cache growth.
283
-
284
-
This is currently implemented using direct I/O.
285
-
286
-
For more details, see the [proposal](https://github.com/prometheus/proposals/pull/45).
239
+
See [proposal](https://github.com/prometheus/proposals/pull/39)
0 commit comments