Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard/fix operational vars #3601

Merged
merged 2 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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