Skip to content

Commit

Permalink
Add queryType=range to custom log template logs links
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Aug 6, 2024
1 parent b63c49e commit 5008102
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ const utils = {
"queries": [
{
"refId": "A",
"expr": `{env="${data.labels.env}",cluster_id="${data.labels.cluster_id}",nodename="${data.labels.nodename}",job="${data.labels.exported_job}",level="${data.labels.level}"}`,
"queryType": "range",
"expr": `{env="${data.labels.env}",cluster_id="${data.labels.cluster_id}",nodename="${data.labels.nodename}",job="${data.labels.exported_job}",level="${data.labels.level}"}`,
}
],
"range": { "from": "now-15m", "to": "now" }
Expand All @@ -148,6 +148,7 @@ const utils = {
"datasource": data.annotations.logs_datasource || "Loki Core",
"queries": [{
"refId": "A",
"queryType": "range",
"expr": data.annotations.logs_template.replace(/\$([a-z0-9_]+)/g, function(_, label) {
return data.labels[label] || "";
}),
Expand Down

0 comments on commit 5008102

Please sign in to comment.