Class KafkaSinkMetrics


  • public class KafkaSinkMetrics
    extends java.lang.Object
    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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String METRICS_NAMESPACE  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.beam.sdk.metrics.Histogram createRPCLatencyHistogram​(org.apache.beam.sdk.io.kafka.KafkaSinkMetrics.RpcMethod method, java.lang.String topic)
      Creates an Histogram metric to record RPC latency.
      static void setSupportKafkaMetrics​(boolean supportKafkaMetrics)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • METRICS_NAMESPACE

        public static final java.lang.String METRICS_NAMESPACE
        See Also:
        Constant Field Values
    • Constructor Detail

      • KafkaSinkMetrics

        public KafkaSinkMetrics()
    • Method Detail

      • createRPCLatencyHistogram

        public static org.apache.beam.sdk.metrics.Histogram createRPCLatencyHistogram​(org.apache.beam.sdk.io.kafka.KafkaSinkMetrics.RpcMethod method,
                                                                                      java.lang.String topic)
        Creates an Histogram metric to record RPC latency. Metric will have 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.
      • setSupportKafkaMetrics

        public static void setSupportKafkaMetrics​(boolean supportKafkaMetrics)