mirror of https://github.com/Icinga/icinga2.git
Elasticsearch/GELF: Add metric unit to performance data fields
Seen this inside the InfluxDBWriter code, makes sense to store this in Elasticsearch too.
This commit is contained in:
parent
6617214b1c
commit
313f25163b
|
@ -166,6 +166,9 @@ void ElasticsearchWriter::AddCheckResult(const Dictionary::Ptr& fields, const Ch
|
|||
fields->Set(perfdataPrefix + ".warn", pdv->GetWarn());
|
||||
if (pdv->GetCrit())
|
||||
fields->Set(perfdataPrefix + ".crit", pdv->GetCrit());
|
||||
|
||||
if (!pdv->GetUnit().IsEmpty())
|
||||
fields->Set(perfdataPrefix + ".unit", pdv->GetUnit());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,6 +269,9 @@ void GelfWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable, con
|
|||
fields->Set("_" + escaped_key + "_warn", pdv->GetWarn());
|
||||
if (pdv->GetCrit())
|
||||
fields->Set("_" + escaped_key + "_crit", pdv->GetCrit());
|
||||
|
||||
if (!pdv->GetUnit().IsEmpty())
|
||||
fields->Set("_" + escaped_key + "_unit", pdv->GetUnit());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue