Skip to content

Commit

Permalink
container_fs_.* metrics doesn't have container label after
Browse files Browse the repository at this point in the history
openshift/pull/1402 which caused regression
for dashboards using container label since it gives empty datapoints
for all queries using container label in queries containing
container_fs_.* metrices.

Inorder to fix the dashboards added containerfsSelector in
kubernetes-monitoring/kubernetes-mixin/pull/737 and overrided the containerfsSelector
default value from  container!= to harmless id!= in this commit.
We really don't need that selector since we dropped the container label
in OCP for container_fs_.* metrices but we need to override the
selector for the queries involving container_fs_.* to work.

Signed-off-by: Jayapriya Pai <janantha@redhat.com>
  • Loading branch information
slashpai committed Oct 17, 2022
1 parent 1a78287 commit 99006ce
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions jsonnet/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,15 @@ local inCluster =
'pod-total.json',
'prometheus.json',
],
// This step is to delete row with titles 'Storage IO - Distribution(Containers)'
// and 'Storage IO - Distribution' from 'k8s-resources-pod.json' dashboard since
// Prometheus doesn't collect the per-container fs metrics
local filteredDashboards = {
'k8s-resources-pod.json': ['Storage IO - Distribution(Containers)', 'Storage IO - Distribution'],
},
local filterDashboard(dashboard, excludedRowTitles) = dashboard { rows: std.filter(function(row) !std.member(excludedRowTitles, row.title), dashboard.rows) },
dashboards: {
[k]: allDashboards[k]
[k]: filterDashboard(allDashboards[k], if std.setMember(k, std.objectFields(filteredDashboards)) then filteredDashboards[k] else [])
for k in std.objectFields(allDashboards)
if std.setMember(k, includeDashboards)
},
Expand Down Expand Up @@ -335,13 +342,16 @@ local inCluster =
mixin+: {
ruleLabels: $.values.common.ruleLabels,
_config+: {
diskDeviceSelector: $.values.nodeExporter.mixin._config.diskDeviceSelector,
// Temporarily commented since upstream change https://github.com/kubernetes-monitoring/kubernetes-mixin/pull/767 not merged yet
// diskDeviceSelector: $.values.nodeExporter.mixin._config.diskDeviceSelector,
diskDeviceSelector: 'device=~"(/dev.+)|%s"' % std.join('|', ['mmcblk.p.+', 'nvme.+', 'rbd.+', 'sd.+', 'vd.+', 'xvd.+', 'dm-.+', 'dasd.+']),
hostNetworkInterfaceSelector: 'device!~"veth.+"',
kubeSchedulerSelector: 'job="scheduler"',
namespaceSelector: $.values.common.mixinNamespaceSelector,
cpuThrottlingSelector: $.values.common.mixinNamespaceSelector,
kubeletPodLimit: 250,
pvExcludedSelector: 'label_alerts_k8s_io_kube_persistent_volume_filling_up="disabled"',
containerfsSelector: 'id!=""',
},
},
prometheusAdapterMetricPrefix: $.values.common.prometheusAdapterMetricPrefix,
Expand Down

0 comments on commit 99006ce

Please sign in to comment.