prometheus/model/textparse
cui 54d4f527a0
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
textparse: fix NaN canonicalization check in OpenMetrics getFloatValue (#18399)
* textparse: fix NaN canonicalization check in OpenMetrics getFloatValue
* textparse: add tests for OpenMetrics summary NaN quantiles

getFloatValue was testing p.exemplarVal instead of the parsed float when normalizing NaN to the canonical representation, so metric values that were NaN were not normalized correctly.

Extend TestOpenMetricsParse with nansum summary lines and cmpopts.EquateNaNs in requireEntries so NaN float values compare equal after canonicalization.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Signed-off-by: cui <cuiweixie@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-05-12 15:45:59 +02:00
..
testdata textparse: Refactor benchmark testdata for all types. (#15998) 2025-02-10 12:26:18 +00:00
benchmark_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
interface.go Rename created timestamp to start timestamp in proto (#18368) 2026-03-31 08:38:45 -07:00
interface_test.go textparse: fix NaN canonicalization check in OpenMetrics getFloatValue (#18399) 2026-05-12 15:45:59 +02:00
nhcbparse.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
nhcbparse_test.go Rename created timestamp to start timestamp in proto (#18368) 2026-03-31 08:38:45 -07:00
openmetricslex.l bugfix: allow quoted exemplar keys in openmetrics text format 2024-11-12 15:29:44 +00:00
openmetricslex.l.go Update golangci-lint (#17478) 2025-11-05 13:47:34 +01:00
openmetricsparse.go textparse: fix NaN canonicalization check in OpenMetrics getFloatValue (#18399) 2026-05-12 15:45:59 +02:00
openmetricsparse_test.go textparse: fix NaN canonicalization check in OpenMetrics getFloatValue (#18399) 2026-05-12 15:45:59 +02:00
promlex.l UTF-8: Add support for parsing UTF8 metric and label names 2024-02-15 14:34:37 -05:00
promlex.l.go Update golangci-lint (#17478) 2025-11-05 13:47:34 +01:00
promparse.go textparse: fix parseLVals to only treat quoted strings as metric names 2026-03-05 15:07:42 +01:00
promparse_test.go textparse: fix parseLVals to only treat quoted strings as metric names 2026-03-05 15:07:42 +01:00
protobufparse.go Merge pull request #18414 from roidelapluie/roidelapluie/fix-proto-histogram-panics 2026-04-01 14:42:01 +02:00
protobufparse_test.go Merge pull request #18414 from roidelapluie/roidelapluie/fix-proto-histogram-panics 2026-04-01 14:42:01 +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