Skip to content
Snippets Groups Projects
  • Mark Grover's avatar
    70f846a3
    [SPARK-5847][CORE] Allow for configuring MetricsSystem's use of app ID to namespace all metrics · 70f846a3
    Mark Grover authored
    ## What changes were proposed in this pull request?
    Adding a new property to SparkConf called spark.metrics.namespace that allows users to
    set a custom namespace for executor and driver metrics in the metrics systems.
    
    By default, the root namespace used for driver or executor metrics is
    the value of `spark.app.id`. However, often times, users want to be able to track the metrics
    across apps for driver and executor metrics, which is hard to do with application ID
    (i.e. `spark.app.id`) since it changes with every invocation of the app. For such use cases,
    users can set the `spark.metrics.namespace` property to another spark configuration key like
    `spark.app.name` which is then used to populate the root namespace of the metrics system
    (with the app name in our example). `spark.metrics.namespace` property can be set to any
    arbitrary spark property key, whose value would be used to set the root namespace of the
    metrics system. Non driver and executor metrics are never prefixed with `spark.app.id`, nor
    does the `spark.metrics.namespace` property have any such affect on such metrics.
    
    ## How was this patch tested?
    Added new unit tests, modified existing unit tests.
    
    Author: Mark Grover <mark@apache.org>
    
    Closes #14270 from markgrover/spark-5847.
    70f846a3
    History
    [SPARK-5847][CORE] Allow for configuring MetricsSystem's use of app ID to namespace all metrics
    Mark Grover authored
    ## What changes were proposed in this pull request?
    Adding a new property to SparkConf called spark.metrics.namespace that allows users to
    set a custom namespace for executor and driver metrics in the metrics systems.
    
    By default, the root namespace used for driver or executor metrics is
    the value of `spark.app.id`. However, often times, users want to be able to track the metrics
    across apps for driver and executor metrics, which is hard to do with application ID
    (i.e. `spark.app.id`) since it changes with every invocation of the app. For such use cases,
    users can set the `spark.metrics.namespace` property to another spark configuration key like
    `spark.app.name` which is then used to populate the root namespace of the metrics system
    (with the app name in our example). `spark.metrics.namespace` property can be set to any
    arbitrary spark property key, whose value would be used to set the root namespace of the
    metrics system. Non driver and executor metrics are never prefixed with `spark.app.id`, nor
    does the `spark.metrics.namespace` property have any such affect on such metrics.
    
    ## How was this patch tested?
    Added new unit tests, modified existing unit tests.
    
    Author: Mark Grover <mark@apache.org>
    
    Closes #14270 from markgrover/spark-5847.