Skip to content

Commit

Permalink
Dashboard/fix operational vars (#3601)
Browse files Browse the repository at this point in the history
* loki operational dashboard uses more refined variables

* excludes loki canary
  • Loading branch information
owen-d authored Apr 13, 2021
1 parent 965d482 commit 7bac502
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6588,14 +6588,14 @@
{
"allValue": null,
"datasource": "$datasource",
"definition": "label_values(kube_pod_container_info{image=~\".*loki.*\"}, cluster)",
"definition": "label_values(kube_pod_container_info{image=~\".*loki.*\", container!=\"loki-canary\"}, cluster)",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "cluster",
"options": [],
"query": "label_values(kube_pod_container_info{image=~\".*loki.*\"}, cluster)",
"query": "label_values(kube_pod_container_info{image=~\".*loki.*\", container!=\"loki-canary\"}, cluster)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand All @@ -6609,14 +6609,14 @@
{
"allValue": null,
"datasource": "$datasource",
"definition": "label_values(kube_pod_container_info{image=~\".*loki.*\", cluster=\"$cluster\"}, namespace)",
"definition": "label_values(kube_pod_container_info{image=~\".*loki.*\", cluster=\"$cluster\", container!=\"loki-canary\"}, namespace)",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "namespace",
"options": [],
"query": "label_values(kube_pod_container_info{image=~\".*loki.*\", cluster=\"$cluster\"}, namespace)",
"query": "label_values(kube_pod_container_info{image=~\".*loki.*\", cluster=\"$cluster\", container!=\"loki-canary\"}, namespace)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
20 changes: 10 additions & 10 deletions production/loki-mixin/dashboards/loki-operational.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
namespaceType:: 'query',
namespaceQuery::
if cfg.showMultiCluster then
'kube_pod_container_info{cluster="$cluster"}'
'kube_pod_container_info{cluster="$cluster", image=~".*loki.*", container!="loki-canary"}'
else
'kube_pod_container_info',

Expand All @@ -40,12 +40,12 @@ local utils = import 'mixin-utils/utils.libsonnet';
type:: 'datasource',
query:: 'prometheus',
},
]+(
] + (
if cfg.showMultiCluster then [
{
variable:: 'cluster',
label:: cfg.clusterLabel,
query:: 'kube_pod_container_info',
query:: 'kube_pod_container_info{image=~".*loki.*", container!="loki-canary"}',
datasource:: '$metrics',
type:: 'query',
},
Expand Down Expand Up @@ -148,9 +148,9 @@ local utils = import 'mixin-utils/utils.libsonnet';
replaceMatchers(replaceClusterMatchers(expr)),

local selectDatasource(ds) =
if ds == null || ds == "" then ds
else if ds == "$datasource" then "$metrics"
else "$logs",
if ds == null || ds == '' then ds
else if ds == '$datasource' then '$metrics'
else '$logs',

panels: [
p {
Expand Down Expand Up @@ -181,15 +181,15 @@ local utils = import 'mixin-utils/utils.libsonnet';
] else [],
}
for ssp in sp.panels
] else []
] else [],
}
for sp in p.panels
] else []
] else [],
}
for p in super.panels
],
templating: {
list+:[
list+: [
{
hide: 0,
includeAll: false,
Expand All @@ -202,7 +202,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
regex: '',
skipUrlSync: false,
type: l.type,
},
}
for l in dashboards['loki-operational.json'].templateLabels
if l.type == 'datasource'
] + [
Expand Down

0 comments on commit 7bac502

Please sign in to comment.