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

Regex parse issue #8645

Open
dguihal opened this issue Apr 3, 2025 · 3 comments
Open

Regex parse issue #8645

dguihal opened this issue Apr 3, 2025 · 3 comments
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 victoria-metrics-k8s-stack@0.41.0

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

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

4 participants