Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMatching escaped double quotes #2974
Comments
This comment has been minimized.
This comment has been minimized.
|
@iobestar Can you try: In any case, @brian-brazil WDYT? |
gouthamve
added
the
dev-2.0
label
Jul 20, 2017
This comment has been minimized.
This comment has been minimized.
|
That query does not work on 1.x, it should be escaped as you suggest. |
This comment has been minimized.
This comment has been minimized.
|
Correction of my initial post I am using escaped double quotes (escape disappear in presentation): Escaped double quotes works on Prometheus 1.x but it doesn't work on Prometheus 2.0 |
gouthamve
self-assigned this
Jul 21, 2017
This comment has been minimized.
This comment has been minimized.
|
Confirmed, this is a bug in the new text protocol parser, which just extracts slices of the underlying input bytes into label values verbatim, without doing any interpretation of escape sequences Problematic place in the code: https://github.com/prometheus/prometheus/blob/dev-2.0/pkg/textparse/parse.go#L108-L132 |
brian-brazil
added
the
kind/bug
label
Jul 25, 2017
gouthamve
added a commit
to gouthamve/prometheus
that referenced
this issue
Jul 26, 2017
gouthamve
added a commit
to gouthamve/prometheus
that referenced
this issue
Jul 27, 2017
juliusv
added a commit
that referenced
this issue
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
|
Fixed in #2995 |
gouthamve
closed this
Aug 1, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 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. |
iobestar commentedJul 20, 2017
•
edited by brian-brazil
What did you do?
PromQL:
metric_foo_bar{name="\"bar\""}What did you expect to see?
Data endpoints for metric metric_foo_bar with where label 'name' have value
'"bar"'What did you see instead? Under which circumstances?
No data endpoints.
prometheus, version 2.0.0-beta.0 (branch: master, revision: 2b5d915)
build user: root@fc24486243df
build date: 20170712-12:24:53
go version: go1.8.3
This query works on Prometheus 1.7.1 but on Prometheus 2.0 I had to replace it with regex matcher:
metric_foo_bar{name=~".+bar.+"}