grafana-flowcharting icon indicating copy to clipboard operation
grafana-flowcharting copied to clipboard

Javascript error in the console related to metric regex

Open morsok opened this issue 4 years ago • 4 comments

Hello,

I was reworking a big panel which had 48 requests to Azure log analytics and causing us to hit the rate limit. I went back to one single query with all the data, and started updating the rules. The metric autocompletion works, and I can see the 48 differents metrics, and so choose the one I need.

After that when refreshing the dashboard I can see the following error in the js console : module.js:2 Uncaught (in promise) TypeError: Cannot read property '1' of null

Related code :

                stringToJsRegex: function(t) {
                    if ("/" !== t[0])
                        return new RegExp("^".concat(t, "$"));
                    var e = t.match(new RegExp("^/(.*?)/(g?i?m?y?)$"));
                    return new RegExp(e[1],e[2])
                },

Error is on the return line.

What can I do to help you see what's the issue ?

morsok avatar Jun 16 '20 14:06 morsok

Hi @morsok Can u try todisable regex options if u don't use regex ?

BR

algenty avatar Jun 16 '20 16:06 algenty

Hello,

Sorry for the late answer, I'm not sure I can deactivate the regex on this case, I'm speaking of the Apply to metrics field. I start typing, it correctly autocompletes with the list of 48 metrics, I choose the one I want (I disabled the 47 other rules so there's just this one active), and then I get the error and the graph does not refresh.

Would you need more screenshots / debugging steps / tests?

morsok avatar Jun 17 '20 12:06 morsok

Hello, Do you have some news about this pb ? Best regards,

Charles

cbijonalliance avatar Jul 23 '20 16:07 cbijonalliance

Cant reproduce, can you give me your regex ?

algenty avatar Oct 30 '20 14:10 algenty