Fix Nomad event stream is ignoring errors

when an event stream could be established once.
This commit is contained in:
Maximilian Paß
2022-09-07 07:06:09 +02:00
parent e8457ca035
commit 89fc7b2637
3 changed files with 23 additions and 3 deletions

View File

@ -131,6 +131,18 @@ func WriteInfluxPoint(p *write.Point) {
if influxClient != nil {
p.AddTag("stage", config.Config.InfluxDB.Stage)
influxClient.WritePoint(p)
} else {
entry := log.WithField("name", p.Name())
for _, tag := range p.TagList() {
if tag.Key == "event_type" && tag.Value == "periodically" {
return
}
entry = entry.WithField(tag.Key, tag.Value)
}
for _, field := range p.FieldList() {
entry = entry.WithField(field.Key, field.Value)
}
entry.Debug("Influx data point")
}
}