mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 23:19:06 +01:00
Reuse tags and meta data tags
This commit is contained in:
parent
fb6f6a4daa
commit
c019f8e7ad
@ -111,7 +111,6 @@ func (r *RedfishReceiver) Start() {
|
||||
delete(metrics, key)
|
||||
}
|
||||
|
||||
for name, value := range metrics {
|
||||
// Set tags
|
||||
tags := map[string]string{
|
||||
"hostname": *clientConfig.Hostname,
|
||||
@ -144,13 +143,15 @@ func (r *RedfishReceiver) Start() {
|
||||
"unit": "watts",
|
||||
}
|
||||
|
||||
// Delete empty tags
|
||||
// Delete empty meta data tags
|
||||
for key, value := range meta {
|
||||
if value == "" {
|
||||
delete(meta, key)
|
||||
}
|
||||
}
|
||||
|
||||
for name, value := range metrics {
|
||||
|
||||
y, err := lp.New(name, tags, meta,
|
||||
map[string]interface{}{
|
||||
"value": value,
|
||||
|
Loading…
Reference in New Issue
Block a user