Skip to content

Commit

Permalink
Decouple InfluxDB writings from request handling.
Browse files Browse the repository at this point in the history
With #451, we found that writing an InfluxDB data point might block and lead to high latencies.
  • Loading branch information
mpass99 authored and MrSerth committed Jan 28, 2024
1 parent ae86b1c commit 08c3a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/monitoring/influxdb2_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 08c3a3d

Please sign in to comment.