Skip to content

expfmt: tolerate trailing whitespace after samples#916

Open
ibobgunardi wants to merge 1 commit into
prometheus:mainfrom
ibobgunardi:bobi/expfmt-trailing-whitespace
Open

expfmt: tolerate trailing whitespace after samples#916
ibobgunardi wants to merge 1 commit into
prometheus:mainfrom
ibobgunardi:bobi/expfmt-trailing-whitespace

Conversation

@ibobgunardi
Copy link
Copy Markdown

Fixes #33.

The text parser treated blanks after a sample value as the start of a timestamp, and blanks after a timestamp as a spurious string. This skips trailing blanks/tabs before checking for the line ending, while keeping timestamp parsing and invalid trailing text behavior unchanged.

Tests:

  • go test ./expfmt -run TestTextParse -count=1
  • go test ./expfmt -count=1
  • go test ./... -count=1 fails locally on Windows in config.TestMissingBearerAuthFile because the test expects the Unix no such file or directory wording.

Signed-off-by: Bobby <boby@codelabs.co.id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextParser: Tolerate trailing whitespace

1 participant