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

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c44bb3  CAMEL-16265: camel-microprofile-metrics - Should mask 
sensitive endpoint uri.
1c44bb3 is described below

commit 1c44bb3171343c50187f229b3f190105f7333f30
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Mar 2 15:12:49 2021 +0100

    CAMEL-16265: camel-microprofile-metrics - Should mask sensitive endpoint 
uri.
---
 .../event/notifier/MicroProfileMetricsEventNotifierNamingStrategy.java | 3 ++-
 .../MicroProfileMetricsExchangeEventNotifierNamingStrategy.java        | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/MicroProfileMetricsEventNotifierNamingStrategy.java
 
b/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/MicroProfileMetricsEventNotifierNamingStrategy.java
index 30f2ac1..0c2c59f 100644
--- 
a/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/MicroProfileMetricsEventNotifierNamingStrategy.java
+++ 
b/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/MicroProfileMetricsEventNotifierNamingStrategy.java
@@ -19,6 +19,7 @@ package 
org.apache.camel.component.microprofile.metrics.event.notifier;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.CamelEvent.ExchangeEvent;
+import org.apache.camel.util.URISupport;
 import org.eclipse.microprofile.metrics.Tag;
 
 import static 
org.apache.camel.component.microprofile.metrics.MicroProfileMetricsConstants.CAMEL_CONTEXT_TAG;
@@ -32,7 +33,7 @@ public interface 
MicroProfileMetricsEventNotifierNamingStrategy {
     default Tag[] getTags(ExchangeEvent event, Endpoint endpoint) {
         return new Tag[] {
                 new Tag(CAMEL_CONTEXT_TAG, 
event.getExchange().getContext().getName()),
-                new Tag(ENDPOINT_NAME, endpoint.getEndpointUri()),
+                new Tag(ENDPOINT_NAME, 
URISupport.sanitizeUri(endpoint.getEndpointUri())),
                 new Tag(EVENT_TYPE_TAG, event.getClass().getSimpleName()),
         };
     }
diff --git 
a/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/exchange/MicroProfileMetricsExchangeEventNotifierNamingStrategy.java
 
b/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/exchange/MicroProfileMetricsExchangeEventNotifierNamingStrategy.java
index 7596e09..dfec4c9 100644
--- 
a/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/exchange/MicroProfileMetricsExchangeEventNotifierNamingStrategy.java
+++ 
b/components/camel-microprofile-metrics/src/main/java/org/apache/camel/component/microprofile/metrics/event/notifier/exchange/MicroProfileMetricsExchangeEventNotifierNamingStrategy.java
@@ -19,6 +19,7 @@ package 
org.apache.camel.component.microprofile.metrics.event.notifier.exchange;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.CamelEvent.ExchangeEvent;
+import org.apache.camel.util.URISupport;
 import org.eclipse.microprofile.metrics.Tag;
 
 import static 
org.apache.camel.component.microprofile.metrics.MicroProfileMetricsConstants.CAMEL_CONTEXT_TAG;
@@ -36,7 +37,7 @@ public interface 
MicroProfileMetricsExchangeEventNotifierNamingStrategy {
     default Tag[] getTags(ExchangeEvent event, Endpoint endpoint) {
         return new Tag[] {
                 new Tag(CAMEL_CONTEXT_TAG, 
event.getExchange().getContext().getName()),
-                new Tag(ENDPOINT_NAME, endpoint.getEndpointUri()),
+                new Tag(ENDPOINT_NAME, 
URISupport.sanitizeUri(endpoint.getEndpointUri())),
                 new Tag(EVENT_TYPE_TAG, event.getClass().getSimpleName())
         };
     }

Reply via email to