Skip to content

Commit

Permalink
Fix writer timeout metrics (#316)
Browse files Browse the repository at this point in the history
Go durations are configured in nanoseconds, however exported timeout metrics have to be in milliseconds. Conversion was missing before for the writer timeouts, leading to timeouts being displayed as 1000000× too long.
  • Loading branch information
hho authored Dec 18, 2024
1 parent 2c5d328 commit 715f403
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (k *Kafka) reportWriterStats(currentStats kafkago.WriterStats) {
Metric: k.metrics.WriterBatchTimeout,
Tags: sampleTags,
},
Value: float64(currentStats.BatchTimeout),
Value: metrics.D(currentStats.BatchTimeout),
Metadata: ctm.Metadata,
},
{
Expand All @@ -411,7 +411,7 @@ func (k *Kafka) reportWriterStats(currentStats kafkago.WriterStats) {
Metric: k.metrics.WriterReadTimeout,
Tags: sampleTags,
},
Value: float64(currentStats.ReadTimeout),
Value: metrics.D(currentStats.ReadTimeout),
Metadata: ctm.Metadata,
},
{
Expand All @@ -420,7 +420,7 @@ func (k *Kafka) reportWriterStats(currentStats kafkago.WriterStats) {
Metric: k.metrics.WriterWriteTimeout,
Tags: sampleTags,
},
Value: float64(currentStats.WriteTimeout),
Value: metrics.D(currentStats.WriteTimeout),
Metadata: ctm.Metadata,
},
{
Expand Down

0 comments on commit 715f403

Please sign in to comment.