Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Client metrics push (KIP-714).

When Kafka’s enable.metrics.push is on (the default), a producer, consumer or admin client asks a broker for its client metrics subscription with GetTelemetrySubscriptions, and pushes the metrics that the subscription names with PushTelemetry at the push interval. On close it sends one last push with terminating set.

ClientTelemetry is that reporter, as Kafka’s ClientTelemetryReporter and the telemetry sender of its NetworkClient are. A Client built with ClientTelemetryConfig starts one. The metrics come from a ClientMetrics registry; client-core registers the network metrics of Kafka’s Selector in it.

Differences from Kafka:

  • The reporter sends on a connection that the client already has open. It does not open a connection of its own, so a client that has no open connection pushes nothing until it opens one.
  • A subscription with the zero client instance id stops telemetry. Kafka’s reporter throws from its response handler, after which it sends no further request.

Modules§

otlp
The part of the OpenTelemetry metrics protocol (OTLP) that a KIP-714 client pushes.

Structs§

ClientMetrics
The metric registry of one client. A clone shares the registry.
ClientTelemetry
A running KIP-714 reporter. Dropping it starts the close, as close does, without the wait.
ClientTelemetryConfig
What a client pushes: its type and the resource attributes of every metric (ClientTelemetryProvider.contextChange).
Counter
A monotonic counter, pushed as an OTLP sum (Kafka’s CumulativeSum and WindowedCount).
Gauge
A value that goes up and down, pushed as an OTLP gauge.
MetricKey
The name and attributes of one metric, as KIP-714 names them.
NetworkMetrics
The network metrics of a client’s connections: the -total metrics of Kafka’s Selector in the client’s metric group, and its connection-count.
TelemetryTiming
The timing of a reporter.

Enums§

TelemetryClientType
The kind of client, which names its metric group.

Constants§

TELEMETRY_METRIC_DOMAIN
The prefix of every client metric name (ClientTelemetryProvider.DOMAIN).

Traits§

TelemetryConnections
The connections that a reporter sends on.

Functions§

client_instance_id
Kafka’s clientInstanceId of a producer, consumer or admin client (ClientTelemetryUtils.fetchClientInstanceId).