mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6194 from Icinga/feature/metric-unit-elastic-gelf
Elasticsearch/GELF: Add metric unit to performance data fields
This commit is contained in:
commit
ecbbc2fcc5
|
@ -167,6 +167,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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -270,6 +270,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