Skip to content

Commit

Permalink
Add section on scrape config and exemplars
Browse files Browse the repository at this point in the history
Signed-off-by: György Krajcsovits <[email protected]>
  • Loading branch information
krajorama committed Jan 26, 2024
1 parent 0b5f85f commit 428cc0e
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ In this option only instrumentation backwards compatibility is guaranteed(*). Th

*: there is still the option to keep scraping classic histograms series beside custom histograms to be able to use the old queries, in fact it’s a recommended migration tactic, see later.

### Scrape configuration

1. The feature is disabled if the feature flag [`native-histograms`](https://prometheus.io/docs/prometheus/latest/feature_flags/#native-histograms) is disabled.
2. If native histograms feature is enabled, custom histograms can be enabled in `scrape_config` by setting the configration option `scrape_custom_histograms` to `true`.

Scenarios provided that the native histograms feature is enabled:
* If the scraped metric has custom bucket definitions and `scrape_classic_histograms` is enabled, the original classic histogram series with suffixes shall be generated. This is independent of the setting for custom histograms.
* If `scrape_custom_histograms` is disabled, no effect.
* If `scrape_custom_histograms` is enabled:
* If the scrape histogram has exponential buckets, no effect. Exponential buckets have higher priority.
* Otherwise the new custom histograms are scraped in a series without suffix.

### Scrape

* Create the new representation in a series named `<metric>` without the `le` label. The resulting series name would be the same as if the user enabled exponential histograms. For example `http_request_latency_seconds_bucket`, `http_request_latency_seconds_count` and `http_request_latency_seconds_sum` will simply be stored as a one metric called `http_request_latency_seconds` from now on.
Expand All @@ -85,6 +97,10 @@ In this option only instrumentation backwards compatibility is guaranteed(*). Th
* In the OpenMetrics text exposition [format](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#numbers) floats and integers are explicitly distinguished by the dot (`.`) sign being present or not in the value.
* In the Prometheus/OpenMetrics ProtoBuf [format](https://github.com/prometheus/client_model/blob/d56cd794bca9543da8cc93e95432cd64d5f99635/io/prometheus/client/metrics.proto#L115-L122) float and integer numbers are explicitly transferred in different fields.

### Exemplars

* Reuse the same logic as with exponential histograms. Roughly: parse the exemplars from the classic histogram, discard exemplars without timestamp and sort by timestamp before forwarding.

### Writing/storage

* Remote write protocol to support transferring custom bucket definitions as part of the current Histogram DTO.
Expand Down

0 comments on commit 428cc0e

Please sign in to comment.