prometheus/model/textparse
beorn7 9e500345f3 textparse/scrape: Add option to scrape both classic and native histograms
So far, if a target exposes a histogram with both classic and native
buckets, a native-histogram enabled Prometheus would ignore the
classic buckets. With the new scrape config option
`scrape_classic_histograms` set, both buckets will be ingested,
creating all the series of a classic histogram in parallel to the
native histogram series. For example, a histogram `foo` would create a
native histogram series `foo` and classic series called `foo_sum`,
`foo_count`, and `foo_bucket`.

This feature can be used in a migration strategy from classic to
native histograms, where it is desired to have a transition period
during which both native and classic histograms are present.

Note that two bugs in classic histogram parsing were found and fixed
as a byproduct of testing the new feature:

1. Series created from classic _gauge_ histograms didn't get the
   _sum/_count/_bucket prefix set.
2. Values of classic _float_ histograms weren't parsed properly.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-05-13 01:32:25 +02:00
..
interface.go textparse/scrape: Add option to scrape both classic and native histograms 2023-05-13 01:32:25 +02:00
interface_test.go textparse/scrape: Add option to scrape both classic and native histograms 2023-05-13 01:32:25 +02:00
openmetricslex.l Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
openmetricslex.l.go refactor (package model): move from github.com/pkg/errors to 'errors' and 'fmt' packages (#10747) 2022-06-27 21:29:19 +02:00
openmetricsparse.go Add Exemplars support for all time series 2023-03-03 17:09:17 -08:00
openmetricsparse_test.go Add Exemplars support for all time series 2023-03-03 17:09:17 -08:00
promlex.l refactor (package model): move from github.com/pkg/errors to 'errors' and 'fmt' packages (#10747) 2022-06-27 21:29:19 +02:00
promlex.l.go refactor (package model): move from github.com/pkg/errors to 'errors' and 'fmt' packages (#10747) 2022-06-27 21:29:19 +02:00
promparse.go lint: Adjust to the lint warnings raised by current versions of golint-ci 2023-04-19 17:10:10 +02:00
promparse_test.go enable gocritic, unconvert and unused linters 2023-04-13 19:20:22 +00:00
promtestdata.nometa.txt Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
promtestdata.txt Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
protobufparse.go textparse/scrape: Add option to scrape both classic and native histograms 2023-05-13 01:32:25 +02:00
protobufparse_test.go textparse/scrape: Add option to scrape both classic and native histograms 2023-05-13 01:32:25 +02:00
README.md Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00

Making changes to textparse lexers

In the rare case that you need to update the textparse lexers, edit promlex.l or openmetricslex.l and then run the following command: golex -o=promlex.l.go promlex.l

Note that you need golex installed: go get -u modernc.org/golex