Fix missing environment id for monitoring data.

This commit is contained in:
Maximilian Paß
2022-08-30 23:57:26 +02:00
parent 1ac4655ad5
commit 549d147870

View File

@ -65,10 +65,8 @@ func FromContext(ctx context.Context) (Runner, bool) {
// monitorExecutionsRunnerID passes the id of the runner executing the execution into the monitoring Point p.
func monitorExecutionsRunnerID(env dto.EnvironmentID, runnerID string) storage.WriteCallback[*dto.ExecutionRequest] {
return func(p *write.Point, e *dto.ExecutionRequest, eventType storage.EventType) {
if eventType == storage.Creation && e != nil {
p.AddTag(monitoring.InfluxKeyRunnerID, runnerID)
p.AddTag(monitoring.InfluxKeyEnvironmentID, env.ToString())
}
return func(p *write.Point, _ *dto.ExecutionRequest, _ storage.EventType) {
p.AddTag(monitoring.InfluxKeyEnvironmentID, env.ToString())
p.AddTag(monitoring.InfluxKeyRunnerID, runnerID)
}
}