Add environment id to periodical monitoring events.

This commit is contained in:
Maximilian Paß
2022-08-19 22:06:39 +02:00
parent 5590c50e14
commit 1eef26cc83
4 changed files with 16 additions and 6 deletions

View File

@@ -31,6 +31,13 @@ func NewAbstractManager() *AbstractManager {
}
}
// MonitorEnvironmentID adds the passed environment id to the monitoring Point p.
func MonitorEnvironmentID[T any](id dto.EnvironmentID) storage.WriteCallback[T] {
return func(p *write.Point, _ T, _ storage.EventType) {
p.AddTag(monitoring.InfluxKeyEnvironmentID, id.ToString())
}
}
// MonitorRunnersEnvironmentID passes the id of the environment e into the monitoring Point p.
func MonitorRunnersEnvironmentID(p *write.Point, e Runner, _ storage.EventType) {
if e != nil {