Skip to content

Commit

Permalink
Reduce labels per metric for indexing pressure metrics to cluster, no…
Browse files Browse the repository at this point in the history
…de, and name to save on storage space.
  • Loading branch information
tac-emil-andresen committed Jul 6, 2024
1 parent 40b06f9 commit b9fea3e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions collector/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
}
},
},
{
Expand All @@ -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,
}
},
},
},
Expand Down

0 comments on commit b9fea3e

Please sign in to comment.