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

incorrect parsing of metric names with equals sign in them #57

Open
Dieterbe opened this Issue Sep 3, 2014 · 7 comments

Comments

Projects
None yet
3 participants
@Dieterbe
Contributor

Dieterbe commented Sep 3, 2014

in my InfluxdbFinder I add a logging line to find_nodes like so:

    def find_nodes(self, query):
        logger.debug(msg="find_nodes invocation", findQuery=query)
        ...

then I do these requests:

~/w/e/graphite-api ❯❯❯ curl "http://localhost:8000/render/?target=alias(service=carbon-tagger,'foo')&format=json"
[]%
~/w/e/graphite-api ❯❯❯ curl "http://localhost:8000/render/?target=alias(servicecarbon-tagger,'foo')&format=json"
[]%   

they result in these logs:

{"msg": "find_nodes invocation", "findQuery": "<FindQuery: alias from Tue Sep  2 20:02:31 2014 until Wed Sep  3 20:02:31 2014>"}
{"msg": "find_nodes invocation", "findQuery": "<FindQuery: servicecarbon-tagger from Tue Sep  2 20:02:35 2014 until Wed Sep  3 20:02:35 2014>"}

conclusion. if metric key / pattern contains an equals sign, something in graphite-api breaks.

note: this used to work fine in graphite-web

@Dieterbe

This comment has been minimized.

Contributor

Dieterbe commented Sep 3, 2014

it's also not just alias()

~ ❯❯❯ curl 'http://g/render/?format=json&target=movingAverage(sumSeries(service=statsdaemon),5)'
[]%
~ ❯❯❯ curl 'http://g/render/?format=json&target=movingAverage(sumSeries(servicestatsdaemon),5)'
[]% 
{"query": "<FindQuery: movingAverage from Tue Sep  2 20:52:41 2014 until Wed Sep  3 20:52:41 2014>", "find": "nodes"}
{"query": "<FindQuery: servicestatsdaemon from Tue Sep  2 20:52:44 2014 until Wed Sep  3 20:52:44 2014>", "find": "nodes"}
@vladimir-smirnov-sociomantic

This comment has been minimized.

vladimir-smirnov-sociomantic commented Sep 4, 2014

The problem is in graphite_api/render/grammar.py - it handles "equals" sign in a wrong way.

query

target=movingAverage(sumSeries(service=statsdaemon),5)

parsed to

([([u'movingAverage'], {'pathExpression': [(u'movingAverage', 0)]})], {'expression': [(([u'movingAverage'], {'pathExpression': [(u'movingAverage', 0)]}), 0)]})

query

target=movingAverage(sumSeries(servicestatsdaemon),5)

parsed to

([([([u'movingAverage', ([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), ([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]})], {'args': [(([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), 1), (([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]}), 2)], 'funcname': [(u'movingAverage', 0)]})], {'call': [(([u'movingAverage', ([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), ([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]})], {'args': [(([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), 1), (([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]}), 2)], 'funcname': [(u'movingAverage', 0)]}), 0)]})], {'expression': [(([([u'movingAverage', ([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), ([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]})], {'args': [(([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), 1), (([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]}), 2)], 'funcname': [(u'movingAverage', 0)]})], {'call': [(([u'movingAverage', ([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), ([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]})], {'args': [(([([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]})], {'expression': [(([([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]})], {'call': [(([u'sumSeries', ([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]})], {'args': [(([([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]})], {'expression': [(([u'servicestatsdaemon'], {'pathExpression': [(u'servicestatsdaemon', 0)]}), 0)]}), 1)], 'funcname': [(u'sumSeries', 0)]}), 0)]}), 0)]}), 1), (([([u'5'], {'integer': [(u'5', 0)]})], {'number': [(([u'5'], {'integer': [(u'5', 0)]}), 0)]}), 2)], 'funcname': [(u'movingAverage', 0)]}), 0)]}), 0)]}

As you may see, with first query, parser thinks that it's pathExpression movingAverage and that's all. In second query it parses it to function of function of path expression and number.

And that's definitly grammar, cause on the input it receives normal target:

u'movingAverage(sumSeries(service=statsdaemon),5)'
@vladimir-smirnov-sociomantic

This comment has been minimized.

vladimir-smirnov-sociomantic commented Sep 4, 2014

Also it looks for me, that the reason of this behaviour is https://github.com/brutasse/graphite-api/blob/master/graphite_api/render/grammar.py#L64 and on - args/kwargs parsing. Right now '=' is used as delimiter for kwargs support. So in your query you have no arguments, only one kwarg and its the reason why parser fails.

@brutasse

This comment has been minimized.

Owner

brutasse commented Sep 4, 2014

That makes sense. And the commit adding kwargs support made it to graphite-web master and not 0.9.x. @Dieterbe which version of graphite-web did you use? Your query should also fail on graphite-web master.

@vladimir-smirnov-sociomantic

This comment has been minimized.

vladimir-smirnov-sociomantic commented Sep 4, 2014

Though I still thinks that it's a bug, cause "args" are mandatory and if Parser thinks that "foo=bar" in first place is kwarg - that parser is broken. Moreover, it loses everything after "movingAverage" in this situation, so it's definitely not what it should do. Though it's worth to report that issue to graphite-web master. Because I don't know "pyparser" and I've got a lot of complains about it.

@Dieterbe

This comment has been minimized.

Contributor

Dieterbe commented Sep 4, 2014

ah ok that explains. i've been using graphite-web 0.9.12 (latest 0.9) release, and it always worked fine on that.
Of course, i am aware that equals in metric id's is not officially supported, but i believe metrics 2.0 is the future, it has already proven very useful to me, and it uses equals signs in metric id's. So hopefully we can make this use case work. Anything I can do?
Maybe wrap my metric query patterns in quotes? maybe that won't trigger the kwargs parsing?
although @vladimir-smirnov-sociomantic has a good point, I don't see any graphite function accepting keyword args as first args, but maybe we shouldn't rely on that. You never know, future functions might do it for some reason?

@vladimir-smirnov-sociomantic

This comment has been minimized.

vladimir-smirnov-sociomantic commented Sep 4, 2014

My point is a bit different: it's still a bug! Because right now having "kwargs" style keyword breaks parser compleately and that is wrong. As you see in dump - it even can't detect that it's "kwarg" or "arg" - it just looses part of "target" and that's all.

Even though there may be kwarg in the first place, there should be ability to at least escape '=' symbol and get necessary behaviour.

@Dieterbe Dieterbe changed the title from Finder.find_nodes() called with alias() around pattern to incorrect parsing of metric names with equals sign in them Sep 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment