← ZIO Kafka docs

zio.kafka.producer.metrics

Members list

Type members

Classlikes

final case class ProducerMetrics(produceCallsCounter: Counter = ..., produceLatencyHistogram: Histogram[Duration] = ..., produceRecordsCounter: Counter = ..., produceBatchSizeHistogram: Histogram[Int] = ..., sendQueueSizeHistogram: Histogram[Int] = ..., sendQueueLatencyHistogram: Histogram[Duration] = ..., sendAuthErrorCounter: Counter = ...)

A description of all metrics that can be observed by the zio-kafka producer.

A description of all metrics that can be observed by the zio-kafka producer.

The purpose of this class is to be a repository of metrics names/descriptions/boundaries, which can optionally be updated by the user.

Instances of this class can be provided to implementations of ProducerMetricsObserver. This can be either the built-in ZioMetricsProducerMetricsObserver or an alternative metrics observer implemented with Micrometer, Dropwizard, etc.

Activate a custom ProducerMetricsObserver with zio.kafka.producer.ProducerSettings.withMetricsObserver.

WARNING: this is an UNSTABLE API and may change in an incompatible way without notice in any zio-kafka version.

Attributes

Companion
object
Source
ProducerMetrics.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
ProducerMetrics.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Source
ProducerMetricsObserver.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Implementations of this trait are responsible for observing producer metrics and collect the measurements. The different methods are invoked from different places in the producer.

Implementations of this trait are responsible for observing producer metrics and collect the measurements. The different methods are invoked from different places in the producer.

These methods hold up the producer; they should return quickly or else throughput of the producer will be affected.

Users can provide a custom implementation via zio.kafka.producer.ProducerSettings.withMetricsObserver.

WARNING: this is an UNSTABLE API and may change in an incompatible way without notice in any zio-kafka version.

Attributes

Companion
object
Source
ProducerMetricsObserver.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class ZioMetricsProducerMetricsObserver(producerMetrics: ProducerMetrics, metricLabels: Set[MetricLabel]) extends ProducerMetricsObserver

A ProducerMetricsObserver implementation that uses zio-metrics to collect observations.

A ProducerMetricsObserver implementation that uses zio-metrics to collect observations.

Value parameters

metricLabels

the metric labels that are added to each metric

producerMetrics

the names, descriptions and histogram boundaries of all the metrics

Attributes

Source
ZioMetricsProducerMetricsObserver.scala
Supertypes
class Object
trait Matchable
class Any