mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 16:14:09 +02:00
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());
|
fields->Set(perfdataPrefix + ".warn", pdv->GetWarn());
|
||||||
if (pdv->GetCrit())
|
if (pdv->GetCrit())
|
||||||
fields->Set(perfdataPrefix + ".crit", 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());
|
fields->Set("_" + escaped_key + "_warn", pdv->GetWarn());
|
||||||
if (pdv->GetCrit())
|
if (pdv->GetCrit())
|
||||||
fields->Set("_" + escaped_key + "_crit", pdv->GetCrit());
|
fields->Set("_" + escaped_key + "_crit", pdv->GetCrit());
|
||||||
|
|
||||||
|
if (!pdv->GetUnit().IsEmpty())
|
||||||
|
fields->Set("_" + escaped_key + "_unit", pdv->GetUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user