-
Notifications
You must be signed in to change notification settings - Fork 227
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
fix(prometheus) Metric name should not be set twice #1330
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm if the test in the comment passes
parseError("foo{__name__=\"foo\"}") | ||
parseError("foo{_metric_=\"bar\"}") | ||
parseError("foo{_metric_=\"foo\"}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does something like {_metric_="foo"}
still parse successfully? I'm not 100% sure if metricName
accounts for both foo{~}
and {_metric_="foo"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add tests for those too but yes it parses. I'm not sure is {_metric_="foo"}
is equivalent to foo{~}
as _metric_
is more internal to FiloDB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed more tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think should happen for {__name__="foo", _metric_="foo"}
? This is expected to fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, lgtm. Good point about _metric_
-- I'm also not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vishramachandran @tjackpaul @sherali42 Can you please share your view on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{__name__="foo", _metric_="foo"}
should fail.
Pull Request checklist
Current behavior : Following prom expressions are valid
foo{_metric_="foo"}
butfoo{__name__="foo"}
will fail to parseNew behavior :
both
foo{_metric_="foo"}
andfoo{__name__="foo"}
will fail to parse