This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new dc4dea9  [SPARK-57943] MetricsSystem should not expose sink property 
values
dc4dea9 is described below

commit dc4dea995f0c70a8c321172ac08925207ca9a6b7
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Sun Jul 5 17:57:16 2026 -0700

    [SPARK-57943] MetricsSystem should not expose sink property values
    
    ### What changes were proposed in this pull request?
    
    This PR aims to prevent metrics sink properties from being logged in 
`MetricsSystem`.
    
    - `registerSinks()` logs only the sink names instead of the entire 
`sinkPropertiesMap`.
    - The error log on sink creation failure reports only the sink class name, 
not the properties.
    
    ### Why are the changes needed?
    
    Sink properties can contain sensitive values such as credentials, which 
should not be leaked into operator logs.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, except the log messages.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Fable 5
    
    Closes #745 from dongjoon-hyun/SPARK-57943.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../org/apache/spark/k8s/operator/metrics/MetricsSystem.java     | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git 
a/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/MetricsSystem.java
 
b/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/MetricsSystem.java
index abd1ac1..0447f8a 100644
--- 
a/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/MetricsSystem.java
+++ 
b/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/MetricsSystem.java
@@ -110,7 +110,7 @@ public class MetricsSystem {
    * via reflection.
    */
   protected void registerSinks() {
-    log.info("sinkPropertiesMap: {}", sinkPropertiesMap);
+    log.info("Configured metrics sinks: {}", sinkPropertiesMap.keySet());
     sinkPropertiesMap
         .values()
         .forEach(
@@ -130,12 +130,7 @@ public class MetricsSystem {
                   | NoSuchMethodException
                   | SecurityException
                   | ClassNotFoundException e) {
-                if (log.isErrorEnabled()) {
-                  log.error(
-                      "Fail to create metrics sink for sink name {}, sink 
properties {}",
-                      sinkProp.getClassName(),
-                      sinkProp.getProperties());
-                }
+                log.error("Fail to create metrics sink for sink class {}", 
sinkProp.getClassName());
                 throw new IllegalStateException("Fail to create metrics sink", 
e);
               }
             });


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to