"++" in Process Name is Causing Parsing Error

Hello,

I have a rather strange issue with a Grafana dashboard that I use to monitor my Windows hosts. There is a “Process” section that has five graphs. The graphs show % Processor Time, Handle Count, Private Bytes, Virtual Bytes, and Working Set for each process. The issue I’m having is that I use a program called Notepad++ and when that process is present, the five graphs all fail to display anything and show the following query error…

InfluxDB returned error: error parsing query: error parsing regexp: invalid nested repetition operator: ++ at line 1, char 121

The query for the % Processor Time is…

SELECT mean("Percent_Processor_Time") as "% Processor Time" FROM "win_proc" WHERE host =~ /$hostname$/ AND instance =~ /$process$/ AND $timeFilter GROUP BY time($interval), instance fill(linear)

If I manually select processes to show in the graph, everything displays correctly. As soon as I select the “All” option, the graph goes blank. This happens if I select only the “Notepad++” process.

Is there a way to modify the query so it doesn’t interpret the characters in the process name as part of the query?

Thanks.

Short of renaming the executable, any thoughts on how to approach this?

Thanks.

Hello @SJMarty,
Hmmm that’s odd.
Can you just remove instance =~ /$process$/ if you’re selecting for all anyways?
Can you give a list of instance values?

The error message might be related to the way you’re using the $ symbol. In regex, $ is used to match the end of a line, which is correct, but the problem could be due to how you’re using variable substitution ($hostname and $process ). If these variables are not correctly initialized or if they contain special characters that are not properly escaped, they could lead to syntax errors in the regex.

Maybe try"

I’m not a grafana expert though. I gather this is the autogenerated query from the query builder?

Thanks for the reply. I just wanted to circle back on this and state that this behavior was being caused by a bug introduced in a recent release of Grafana. Although I’m not sure which specific version it started with, the v10.4.x release has fixed this problem for me.