Argus icon indicating copy to clipboard operation
Argus copied to clipboard

Prettify button on view metrics page changes query

Open davidarcher opened this issue 6 years ago • 1 comments

REPRO STEPS:

  1. Navigate to the Argus viewmetrics page
  2. Paste in the following to the text input box
GROUPBY(-15m:-2m:foo.bar.-.-:some.metric.*.here{tag=baz}:avg:3m-avg, #(someRegexForGrouping)#, #SUM#)
  1. Click the Prettify button

EXPECTED: The query entered should be formatted without changing the actual text of the query

GROUPBY(
  -15m:-2m:foo.bar.-.-:some.metric.*.here{tag=baz}:avg:3m-avg,
  #(someRegexForGrouping)#,
  #SUM#
)

ACTUAL: The prettified version of the query has an extra comma between the closing parenthesis of the regex field and the # symbol.

GROUPBY(
  -15m:-2m:foo.bar.-.-:some.metric.*.here{tag=baz}:avg:3m-avg,#(
    someRegexForGrouping
  ),
  #,#SUM#
)

davidarcher avatar Aug 15 '19 18:08 davidarcher

Yes, this happens when parentheses are included in regex. Let me confirm with my team if regex in expression supports characters like brackets or commas.

prestonfff avatar Aug 15 '19 19:08 prestonfff