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

[FR] Support \n and spaces in the query #747

Closed
anch665 opened this issue Dec 14, 2022 · 0 comments · Fixed by #771
Closed

[FR] Support \n and spaces in the query #747

anch665 opened this issue Dec 14, 2022 · 0 comments · Fixed by #771

Comments

@anch665
Copy link

anch665 commented Dec 14, 2022

Some large requests look very ugly. In addition, grafana also independently changes them when you press the pencil button.
For this reason, we use wrapping and formatting queries.
but carbonapi can't process them when it sees the \n character in the request.
Can this be fixed?

aliasSub(
  transformNull(
    exclude(
	  asPercent(
            group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.404.req, 'sumSeries', 10, 12)),
            group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.*.req, 'sumSeries', 10, 12)),
          0),
    'MISSING'),
  0),
'.+asPercent\(([\w]+\.[\w]+).+', '404.\1')

error log
2022-12-14T07:33:53.302+0300 ERROR access request failed {"data": {"handler":"render","carbonapi_uuid":"8d39f5be-4958-473c-9ce3-d8c25a44803c","url":"/render","peer_ip":"10.72.4.76","host":"rtmsasanalys01:8087","format":"json","use_cache":true,"targets":["aliasSub(\n transformNull(\n exclude(\n\t asPercent(\n group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.404.req, 'sumSeries', 10, 12)),\n group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.*.req, 'sumSeries', 10, 12)),\n 0),\n 'MISSING'),\n 0),\n'.+asPercent\\(([\\w]+\\.[\\w]+).+', '404.\\1')"],"cache_timeout":60,"runtime":0.000736943,"http_code":400,"reason":"Bad Request\n\nTarget : aliasSub(\n transformNull(\n exclude(\n\t asPercent(\n group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.404.req, 'sumSeries', 10, 12)),\n group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.*.req, 'sumSeries', 10, 12)),\n 0),\n 'MISSING'),\n 0),\n'.+asPercent\\(([\\w]+\\.[\\w]+).+', '404.\\1')\nError : missing argument\nParsed so far : aliasSub(\nCould not parse : \n transformNull(\n exclude(\n\t asPercent(\n group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.404.req, 'sumSeries', 10, 12)),\n group(groupByNodes(collectd.PROD.rtmsasrtdm0*.NginxByPerl.host.*.port.5111.gauge.channelid.*.requesttype.*.login.*.up.*.status.*.req, 'sumSeries', 10, 12)),\n 0),\n 'MISSING'),\n 0),\n'.+asPercent\\(([\\w]+\\.[\\w]+).+', '404.\\1')\n","from":1670970832,"until":1670992434,"from_raw":"1670970832","until_raw":"1670992434","uri":"/render","from_cache":false,"used_backend_cache":false,"request_headers":{"X-Dashboard-Id":"143","X-Grafana-Org-Id":"1","X-Panel-Id":"92"}}}

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

Successfully merging a pull request may close this issue.

1 participant