Reuse tags and meta data tags

This commit is contained in:
Holger Obermaier 2022-05-03 17:55:33 +02:00
parent fb6f6a4daa
commit c019f8e7ad

View File

@ -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,