public class KafkaSinkMetrics
extends java.lang.Object
Metrics will be in the namespace 'KafkaSink' and have their name formatted as:
'{baseName}-{metricLabelKey1}:{metricLabelVal1};...{metricLabelKeyN}:{metricLabelValN};' ????
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
METRICS_NAMESPACE |
| Constructor and Description |
|---|
KafkaSinkMetrics() |
| Modifier and Type | Method and Description |
|---|---|
static Gauge |
createBacklogGauge(MetricName name)
Creates a
Gauge metric to record per partition backlog with the name |
static Gauge |
createBacklogGauge(java.lang.String topic,
int partitionId)
Creates a
Gauge metric to record per partition backlog with the name |
static Histogram |
createRPCLatencyHistogram(org.apache.beam.sdk.io.kafka.KafkaSinkMetrics.RpcMethod method,
java.lang.String topic)
Creates a
Histogram metric to record RPC latency with the name |
static MetricName |
getMetricGaugeName(java.lang.String topic,
int partitionId)
Creates an MetricName based on topic name and partition id.
|
static void |
setSupportKafkaMetrics(boolean supportKafkaMetrics) |
public static final java.lang.String METRICS_NAMESPACE
public static Histogram createRPCLatencyHistogram(org.apache.beam.sdk.io.kafka.KafkaSinkMetrics.RpcMethod method, java.lang.String topic)
Histogram metric to record RPC latency with the name
'RpcLatency*rpc_method:{method};topic_name:{topic};'.
method - Kafka method associated with this metric.topic - Kafka topic associated with this metric.public static Gauge createBacklogGauge(java.lang.String topic, int partitionId)
Gauge metric to record per partition backlog with the name
'EstimatedBacklogSize*topic_name:{topic};partitionId:{partitionId};'.
topic - Kafka topic associated with this metric.partitionId - partition id associated with this metric.public static Gauge createBacklogGauge(MetricName name)
Gauge metric to record per partition backlog with the name
'name'.
name - MetricName for the KafkaSink.public static MetricName getMetricGaugeName(java.lang.String topic, int partitionId)
'EstimatedBacklogSize*topic_name:{topic};partition_id:{partitionId};'
topic - Kafka topic associated with this metric.partitionId - partition id associated with this metric.public static void setSupportKafkaMetrics(boolean supportKafkaMetrics)