Package org.apache.beam.sdk.io.kafka
Class KafkaSinkMetrics
java.lang.Object
org.apache.beam.sdk.io.kafka.KafkaSinkMetrics
Helper class to create per worker metrics for Kafka Sink stages.
 
Metrics will be in the namespace 'KafkaSink' and have their name formatted as:
'{baseName}-{metricLabelKey1}:{metricLabelVal1};...{metricLabelKeyN}:{metricLabelValN};' ????
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic GaugecreateBacklogGauge(MetricName name) Creates aGaugemetric to record per partition backlog with the namestatic HistogramcreateRPCLatencyHistogram(org.apache.beam.sdk.io.kafka.KafkaSinkMetrics.RpcMethod method, String topic) Creates aHistogrammetric to record RPC latency with the namestatic MetricNamegetMetricGaugeName(String topic, int partitionId) Creates an MetricName based on topic name and partition id.static voidsetSupportKafkaMetrics(boolean supportKafkaMetrics) 
- 
Field Details- 
METRICS_NAMESPACE- See Also:
 
 
- 
- 
Constructor Details- 
KafkaSinkMetricspublic KafkaSinkMetrics()
 
- 
- 
Method Details- 
createRPCLatencyHistogrampublic static Histogram createRPCLatencyHistogram(org.apache.beam.sdk.io.kafka.KafkaSinkMetrics.RpcMethod method, String topic) Creates aHistogrammetric to record RPC latency with the name'RpcLatency*rpc_method:{method};topic_name:{topic};'. - Parameters:
- method- Kafka method associated with this metric.
- topic- Kafka topic associated with this metric.
- Returns:
- Histogram with exponential buckets with a sqrt(2) growth factor.
 
- 
createBacklogGaugeCreates aGaugemetric to record per partition backlog with the name'name'. - Parameters:
- name- MetricName for the KafkaSink.
- Returns:
- Counter.
 
- 
getMetricGaugeNameCreates an MetricName based on topic name and partition id.'EstimatedBacklogSize*topic_name:{topic};partition_id:{partitionId};' - Parameters:
- topic- Kafka topic associated with this metric.
- partitionId- partition id associated with this metric.
- Returns:
- MetricName.
 
- 
setSupportKafkaMetricspublic static void setSupportKafkaMetrics(boolean supportKafkaMetrics) 
 
-