mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-26 15:29:04 +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)
|
delete(metrics, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
for name, value := range metrics {
|
|
||||||
// Set tags
|
// Set tags
|
||||||
tags := map[string]string{
|
tags := map[string]string{
|
||||||
"hostname": *clientConfig.Hostname,
|
"hostname": *clientConfig.Hostname,
|
||||||
@ -144,13 +143,15 @@ func (r *RedfishReceiver) Start() {
|
|||||||
"unit": "watts",
|
"unit": "watts",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete empty tags
|
// Delete empty meta data tags
|
||||||
for key, value := range meta {
|
for key, value := range meta {
|
||||||
if value == "" {
|
if value == "" {
|
||||||
delete(meta, key)
|
delete(meta, key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for name, value := range metrics {
|
||||||
|
|
||||||
y, err := lp.New(name, tags, meta,
|
y, err := lp.New(name, tags, meta,
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"value": value,
|
"value": value,
|
||||||
|
Loading…
Reference in New Issue
Block a user