prometheus/model/textparse
beorn7 65ccf4460a textparse: Fix endless loop #12731
PR #12557 introduced the possibility of parsing multiple exemplars per
native histograms. It did so by requiring the `Exemplar` method of the
parser to be called repeatedly until it returns false. However, the
protobuf parser code wasn't correctly updated for the old case of a
single exemplar for a classic bucket (if actually parsed as a classic
bucket) and a single exemplar on a counter. In those cases, the method
would return `true` forever, yielding the same exemplar again and
again, leading to an endless loop.

With this fix, the state is now tracked and the single exemplar is
only returned once.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-08-22 21:03:54 +02:00
..
README.md
interface.go scrape: Enable ingestion of multiple exemplars per sample 2023-07-13 14:16:10 +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
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 scrape: Enable ingestion of multiple exemplars per sample 2023-07-13 14:16:10 +02: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
promtestdata.txt
protobufparse.go textparse: Fix endless loop #12731 2023-08-22 21:03:54 +02:00
protobufparse_test.go textparse: Expose #12731 in protobufparse_test.go 2023-08-22 20:53:31 +02:00

README.md

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