Skip to content

Commit

Permalink
Add Kafka output metrics (#42537) (#42555)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2b8d554)

Co-authored-by: William Easton <[email protected]>
  • Loading branch information
mergify[bot] and strawgate authored Jan 31, 2025
1 parent 4e8f458 commit 52563d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libbeat/outputs/kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,14 @@ func newSaramaConfig(log *logp.Logger, config *kafkaConfig) (*sarama.Config, err
k.Version = version

k.Producer.Partitioner = partitioner

k.MetricRegistry = adapter.GetGoMetrics(
monitoring.Default,
"libbeat.outputs.kafka",
adapter.Rename("incoming-byte-rate", "bytes_read"),
adapter.Rename("outgoing-byte-rate", "bytes_write"),
"libbeat.outputs",
adapter.Rename("incoming-byte-rate", "read.bytes"),
adapter.Rename("outgoing-byte-rate", "write.bytes"),
adapter.Rename("request-latency-in-ms", "write.latency"),
adapter.Rename("requests-in-flight", "kafka.requests-in-flight"),
adapter.GoMetricsNilify,
)

Expand Down

0 comments on commit 52563d9

Please sign in to comment.