This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new cef53303179 CAMEL-21504: camel-spring-boot -
MicrometerTagsAutoConfiguration class puts http method in uri tag
cef53303179 is described below
commit cef53303179fd9022f4fc062f3f4e8b032072713
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Jan 7 09:41:21 2025 +0100
CAMEL-21504: camel-spring-boot - MicrometerTagsAutoConfiguration class puts
http method in uri tag
---
.../MicrometerTagsAutoConfiguration.java | 38 +---------------------
1 file changed, 1 insertion(+), 37 deletions(-)
diff --git
a/components-starter/camel-micrometer-starter/src/main/java/org/apache/camel/component/micrometer/springboot/MicrometerTagsAutoConfiguration.java
b/components-starter/camel-micrometer-starter/src/main/java/org/apache/camel/component/micrometer/springboot/MicrometerTagsAutoConfiguration.java
index b04005ddc42..9d2bf264754 100644
---
a/components-starter/camel-micrometer-starter/src/main/java/org/apache/camel/component/micrometer/springboot/MicrometerTagsAutoConfiguration.java
+++
b/components-starter/camel-micrometer-starter/src/main/java/org/apache/camel/component/micrometer/springboot/MicrometerTagsAutoConfiguration.java
@@ -19,13 +19,11 @@ package org.apache.camel.component.micrometer.springboot;
import io.micrometer.common.KeyValue;
import io.micrometer.common.KeyValues;
import jakarta.servlet.http.HttpServletRequest;
-import org.apache.camel.CamelContext;
import
org.apache.camel.component.micrometer.springboot.metrics.CamelMetricsConfiguration;
import org.apache.camel.http.common.CamelServlet;
import org.apache.camel.http.common.HttpConsumer;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
import
org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
@@ -85,42 +83,8 @@ public class MicrometerTagsAutoConfiguration {
uri = "";
}
- return KeyValue.of("uri", context.getCarrier().getMethod());
+ return KeyValue.of("uri", uri);
}
- // @Override
- // public Iterable<Tag> getTags(HttpServletRequest request,
HttpServletResponse response,
- // Object handler, Throwable exception) {
- //
- // String uri = null;
- // if (servlet.isPresent() && !configuration.isUriTagDynamic()) {
- // HttpConsumer consumer =
servlet.get().getServletResolveConsumerStrategy().resolve(request,
- // servlet.get().getConsumers());
- // if (consumer != null) {
- // uri = consumer.getPath();
- // }
- // }
- //
- // // the request may not be for camel servlet, so we need to
capture uri from request
- // if (uri == null || uri.isEmpty()) {
- // // dynamic uri with the actual value from the http request
- // uri = request.getServletPath();
- // if (uri == null || uri.isEmpty()) {
- // uri = request.getPathInfo();
- // } else {
- // String p = request.getPathInfo();
- // if (p != null) {
- // uri = uri + p;
- // }
- // }
- // }
- // if (uri == null) {
- // uri = "";
- // }
- // return Tags.concat(
- // super.getTags(request, response, handler, exception),
- // Tags.of(Tag.of("uri", uri))
- // );
- // }
};
}
}