Skip to content

Commit

Permalink
fix(prometheus): fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
oowl committed Jun 6, 2023
1 parent bb0e706 commit 318eb27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kong/plugins/prometheus/prometheus.lua
Expand Up @@ -192,11 +192,11 @@ local function full_metric_name(name, label_names, label_values)
else
label_value = tostring(label_values[idx])
end
if string.find(label_value, "\\") then
if string.find(label_value, "\\", 1, true) then
label_value = ngx_re_gsub(label_value, "\\", "\\\\", "jo")
end

if string.find(label_value, '"') then
if string.find(label_value, '"', 1, true) then
label_value = ngx_re_gsub(label_value, '"', '\\"', "jo")
end

Expand Down

0 comments on commit 318eb27

Please sign in to comment.