Class GraphiteSink

  • All Implemented Interfaces:
    org.apache.spark.metrics.sink.Sink

    public class GraphiteSink
    extends java.lang.Object
    implements org.apache.spark.metrics.sink.Sink
    A Sink for Spark's metric system reporting metrics (including Beam step metrics) to Graphite.

    The sink is configured using Spark configuration parameters, for example:

    
     "spark.metrics.conf.*.sink.graphite.class"="org.apache.beam.runners.spark.metrics.sink.GraphiteSink"
     "spark.metrics.conf.*.sink.graphite.host"="<graphite_hostname>"
     "spark.metrics.conf.*.sink.graphite.port"=<graphite_listening_port>
     "spark.metrics.conf.*.sink.graphite.period"=10
     "spark.metrics.conf.*.sink.graphite.unit"=seconds
     "spark.metrics.conf.*.sink.graphite.prefix"="<optional_prefix>"
     "spark.metrics.conf.*.sink.graphite.regex"="<optional_regex_to_send_matching_metrics>"
     
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphiteSink​(java.util.Properties properties, com.codahale.metrics.MetricRegistry metricRegistry)
      Constructor for Spark 3.2.x and later.
      GraphiteSink​(java.util.Properties properties, com.codahale.metrics.MetricRegistry metricRegistry, org.apache.spark.SecurityManager securityMgr)
      Constructor for Spark 3.1.x and earlier.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void report()  
      void start()  
      void stop()  
      • Methods inherited from class java.lang.Object

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

      • GraphiteSink

        public GraphiteSink​(java.util.Properties properties,
                            com.codahale.metrics.MetricRegistry metricRegistry,
                            org.apache.spark.SecurityManager securityMgr)
        Constructor for Spark 3.1.x and earlier.
      • GraphiteSink

        public GraphiteSink​(java.util.Properties properties,
                            com.codahale.metrics.MetricRegistry metricRegistry)
        Constructor for Spark 3.2.x and later.
    • Method Detail

      • start

        public void start()
        Specified by:
        start in interface org.apache.spark.metrics.sink.Sink
      • stop

        public void stop()
        Specified by:
        stop in interface org.apache.spark.metrics.sink.Sink
      • report

        public void report()
        Specified by:
        report in interface org.apache.spark.metrics.sink.Sink