Decouple InfluxDB writings from request handling.
With #451, we found that writing an InfluxDB data point might block and lead to high latencies.
This commit is contained in:

committed by
Sebastian Serth

parent
ae86b1c261
commit
08c3a3d53d
@ -164,7 +164,8 @@ func ChangedPrewarmingPoolSize(id dto.EnvironmentID, count uint) {
|
||||
func WriteInfluxPoint(p *write.Point) {
|
||||
if influxClient != nil {
|
||||
p.AddTag("stage", config.Config.InfluxDB.Stage)
|
||||
influxClient.WritePoint(p)
|
||||
// We identified that the influxClient is not truly asynchronous. See #541.
|
||||
go func() { influxClient.WritePoint(p) }()
|
||||
} else {
|
||||
entry := log.WithField("name", p.Name())
|
||||
for _, tag := range p.TagList() {
|
||||
|
Reference in New Issue
Block a user