[SPARK-5847][CORE][BRANCH-1.6] backport of #14270 #188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of apache#14270. Because the spark.internal.config system
does not exists in branch 1.6, a simpler substitution scheme for ${} in
the spark.metrics.namespace value, using only Spark configuration had to
be added to preserve the behaviour discussed in the tickets and tested.
This backport is contributed by Criteo SA under the Apache v2 licence.
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 metricsacross 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.namespaceproperty to any given valueor to another spark configuration key reference 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.namespaceproperty can be set to anyarbitrary 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, nordoes the
spark.metrics.namespaceproperty have any such affect on such metrics.Added new unit tests, modified existing unit tests.