Kafka Stats Sink (proto)

This extension has the qualified name envoy.stat_sinks.kafka

Note

This extension is only available in contrib images.

Note

This extension is functional but has not had substantial production burn time, use only with this caveat.

This extension does not operate on the data plane and hence is intended to be robust against untrusted traffic.

Tip

This extension extends and can be used with the following extension category:

This extension must be configured with one of the following type URLs:

Kafka Stats Sink configuration overview.

extensions.stat_sinks.kafka.v3.KafkaStatsSinkConfig

[extensions.stat_sinks.kafka.v3.KafkaStatsSinkConfig proto]

Configuration for the Kafka stats sink. Metrics are serialized and produced to a Kafka topic using librdkafka.

{
  "broker_list": ...,
  "topic": ...,
  "batch_size": ...,
  "report_counters_as_deltas": {...},
  "emit_tags_as_labels": {...},
  "producer_config": {...},
  "buffer_flush_timeout_ms": {...},
  "format": ...
}
broker_list

(string, REQUIRED) Comma-separated list of Kafka broker addresses in host:port format. At least one broker must be specified.

topic

(string, REQUIRED) Kafka topic to produce metrics to.

batch_size

(uint32) Number of metrics to batch into a single Kafka message. If 0 or unset, all metrics from a single flush are sent in one message. Setting a batch size helps control message sizes when there are many metrics.

report_counters_as_deltas

(BoolValue) If true, counters are reported as the delta since last flush rather than the absolute cumulative value. Defaults to false.

emit_tags_as_labels

(BoolValue) If true, tag-extracted metric names are used and tags are emitted as separate labels/JSON fields. If false, the full metric name (including tag values) is used. Defaults to true.

producer_config

(repeated map<string, string>) Additional librdkafka producer configuration properties as key-value pairs. These are passed directly to librdkafka and can be used to configure compression (compression.type), authentication (security.protocol, sasl.mechanism, etc.), batching (batch.num.messages), and more. See https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md

buffer_flush_timeout_ms

(UInt32Value) Maximum time in milliseconds to buffer messages before forcing a produce. Maps to librdkafka’s linger.ms. If not set, defaults to 500ms.

format

(extensions.stat_sinks.kafka.v3.SerializationFormat) Serialization format for metric messages produced to Kafka. Defaults to JSON.

Enum extensions.stat_sinks.kafka.v3.SerializationFormat

[extensions.stat_sinks.kafka.v3.SerializationFormat proto]

Serialization format for metrics produced to Kafka.

JSON

(DEFAULT) ⁣JSON serialization. Metrics are encoded as human-readable JSON objects.

PROTOBUF

⁣Protocol Buffers serialization. Each Kafka message value is a binary-serialized envoy.service.metrics.v3.StreamMetricsMessage containing io.prometheus.client.MetricFamily entries – the same wire format used by the gRPC envoy.stat_sinks.metrics_service sink.