From b9fea3e8d48109443328fe3929f8de2c0a15e655 Mon Sep 17 00:00:00 2001 From: emilandresentac Date: Sat, 6 Jul 2024 13:30:38 -0700 Subject: [PATCH] Reduce labels per metric for indexing pressure metrics to cluster, node, and name to save on storage space. --- collector/nodes.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/collector/nodes.go b/collector/nodes.go index ff770038..e99e8d5c 100644 --- a/collector/nodes.go +++ b/collector/nodes.go @@ -96,7 +96,7 @@ var ( defaultRoleLabels = []string{"cluster", "host", "name"} defaultThreadPoolLabels = append(defaultNodeLabels, "type") defaultBreakerLabels = append(defaultNodeLabels, "breaker") - defaultIndexingPressureLabels = append(defaultNodeLabels, "indexing_pressure") + defaultIndexingPressureLabels = []string{"cluster", "host", "name", "indexing_pressure"} defaultFilesystemDataLabels = append(defaultNodeLabels, "mount", "path") defaultFilesystemIODeviceLabels = append(defaultNodeLabels, "device") defaultCacheLabels = append(defaultNodeLabels, "cache") @@ -1628,7 +1628,12 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no return float64(indexingPressureMem.Current.AllInBytes) }, Labels: func(cluster string, node NodeStatsNodeResponse, indexingPressure string) []string { - return append(defaultNodeLabelValues(cluster, node), indexingPressure) + return []string{ + cluster, + node.Host, + node.Name, + indexingPressure, + } }, }, { @@ -1642,7 +1647,12 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no return float64(indexingPressureStats.LimitInBytes) }, Labels: func(cluster string, node NodeStatsNodeResponse, indexingPressure string) []string { - return append(defaultNodeLabelValues(cluster, node), indexingPressure) + return []string{ + cluster, + node.Host, + node.Name, + indexingPressure, + } }, }, },