brod_metrics (brod v4.6.3)

View Source

Telemetry events emitted by brod.

Brod emits events using the Beam Telemetry library. Users can attach handler functions to these events, for example to report metrics. Each event is emitted by a function in this module; see the function documentation for the measurements and metadata attached to each event.

Summary

Functions

Emit a [brod, produce_request_sent] event.

Types

batch_input/0

-type batch_input() :: brod:batch_input().

partition/0

-type partition() :: brod:partition().

topic/0

-type topic() :: brod:topic().

Functions

produce_request_sent(Topic, Partition, BatchInput)

-spec produce_request_sent(topic(), partition(), batch_input()) -> ok.

Emit a [brod, produce_request_sent] event.

Emitted by producers for each produce request successfully sent on wire, i.e. one event per Kafka produce request (message batch).

Note that retried batches emit the event again: the event counts wire sends, so a summed count can exceed the number of unique messages produced when retries occur.

Measurements:

  • count: number of messages in the request.
  • bytes: total size of keys, values and headers of the messages in the request (before encoding and compression), plus 8 bytes per message accounting for the timestamp.

Metadata: topic and partition the request was sent to.