Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error on empty HELP #4427

Closed
Wing924 opened this Issue Jul 27, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@Wing924
Copy link

Wing924 commented Jul 27, 2018

Bug Report

What did you do?
Scrape those metrics:

# HELP rabbitmq_channels  
# TYPE rabbitmq_channels gauge
rabbitmq_channels{name="rabbit",} 0.0
# HELP rabbitmq_published_total  
# TYPE rabbitmq_published_total counter
rabbitmq_published_total{name="rabbit",} 0.0

What did you expect to see?
Parse OK

What did you see instead? Under which circumstances?
Error: expected text in HELP

Environment

  • Prometheus version:
    • v2.3.2: OK
    • master: NG

Reason

textparse has been changed.
Previous one just ignore lines starting with # while new one parse comment lines.

case tHelp, tType:
switch t := p.nextToken(); t {
case tMName:
p.offsets = append(p.offsets, p.l.start, p.l.i)
default:
return EntryInvalid, parseError("expected metric name after HELP", t)
}
switch t := p.nextToken(); t {
case tText:
p.text = p.l.buf()[1:]
default:
return EntryInvalid, parseError("expected text in HELP", t)
}

These code don't allow help is empty.
It breaks the backward compatibility

@brian-brazil brian-brazil changed the title Prometheus parse error on master Parse error on empty HELP Aug 1, 2018

brian-brazil added a commit that referenced this issue Aug 1, 2018

Handle empty HELP in text parser.
Fixes #4427

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>

brian-brazil added a commit that referenced this issue Aug 1, 2018

Handle empty HELP in text parser. (#4444)
Fixes #4427

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>

mknapphrt added a commit to mknapphrt/prometheus that referenced this issue Aug 1, 2018

Handle empty HELP in text parser. (prometheus#4444)
Fixes prometheus#4427

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.