Skip to content

Regex parse issue #8645

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

Closed
dguihal opened this issue Apr 3, 2025 · 5 comments
Closed

Regex parse issue #8645

dguihal opened this issue Apr 3, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dguihal
Copy link

dguihal commented Apr 3, 2025

Describe the bug

Parse error in regex

example:

node_uname_info{nodename=~"(?i:(test)(\.[a-z0-9.]+)?)"}

ERROR: 422, error when executing query="node_uname_info{nodename=~"(?i:(test)(\.[a-z0-9.]+)?)"}" on the time range (start=1743682803612, end=1743684603612, step=3000): cannot expand WITH expressions: cannot parse string literal ""(?i:(test)(\.[a-z0-9.]+)?)"": invalid syntax

this come from an issue I met using the Kubernetes / Views / Nodes dashboard provided with vm-k8s stack (which come from kubernetes mixins)

The regex is valid according to regex101

To Reproduce

Try above request in VM query ui or load Kubernetes / Views / Nodes dashboard in grafana using VM as prometheus datasource (https://grafana.com/grafana/dashboards/15759-kubernetes-views-nodes/)

Unfortunatly I don't have a standard prometheus to compare behavior

Version

image: victoriametrics/victoria-metrics:v1.114.0 from [email protected]

Logs

No response

Screenshots

Image

Image

Used command-line flags

No response

Additional information

The issue seems around the \. escaping.

@dguihal dguihal added the bug Something isn't working label Apr 3, 2025
@f41gh7
Copy link
Contributor

f41gh7 commented Apr 3, 2025

For promql/metricsql requests \. should be double escaped: \\. Looks like a bug with dashboard.

@zekker6
Copy link
Contributor

zekker6 commented Apr 3, 2025

Related: VictoriaMetrics/helm-charts#2100

@AndrewChubatiuk
Copy link
Contributor

@hagen1778
Copy link
Collaborator

@AndrewChubatiuk @zekker6 @f41gh7 do I understand it right that the issue is in the external Grafana expression that is out of our control and it already has a PR that fixes it?

@hagen1778 hagen1778 self-assigned this Apr 6, 2025
@hagen1778
Copy link
Collaborator

Seems to be resolved in dotdc/grafana-dashboards-kubernetes#142. Closing as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants