You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2026/08/26 07:44:00 UTC
[jira] [Updated] (CAMEL-24505) camel-micrometer-starter - uri metric tag falls back to the raw request path, giving unbounded tag cardinality
[ https://issues.apache.org/jira/browse/CAMEL-24505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrea Cosentino updated CAMEL-24505:
-------------------------------------
Fix Version/s: 4.23.0
> camel-micrometer-starter - uri metric tag falls back to the raw request path, giving unbounded tag cardinality
> --------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24505
> URL: https://issues.apache.org/jira/browse/CAMEL-24505
> Project: Camel
> Issue Type: Improvement
> Components: camel-micrometer, camel-spring-boot-starters
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.23.0
>
>
> {{MicrometerTagsAutoConfiguration.custom()}} builds the {{uri}} tag for the servlet observation:
> {code:java}
> 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()) {
> uri = request.getServletPath();
> if (uri == null || uri.isEmpty()) {
> uri = request.getPathInfo();
> } else {
> String p = request.getPathInfo();
> if (p != null) {
> uri = uri + p;
> }
> }
> }
> {code}
> (MicrometerTagsAutoConfiguration:70)
> When the request does not resolve to a Camel consumer - any 404, any request to a non-Camel path - the tag value becomes the request path verbatim. Micrometer creates one meter per distinct tag value and keeps them for the process lifetime, so the number of meters follows the number of distinct paths requested rather than the number of routes.
> Spring's own convention for this case is a constant {{UNKNOWN}} tag, precisely because the value is client-supplied. Only the resolved consumer path template is a bounded, route-author-authored value.
> *Proposal*
> - Replace the raw {{servletPath}}/{{pathInfo}} fallback with a constant such as {{UNKNOWN}}.
> - Keep the raw path only behind the existing {{uriTagDynamic}} opt-in, and normalise or cap it there.
> - Add a test asserting that N requests to N distinct unmatched paths produce one meter, not N.
> ----
> _This issue was drafted by Claude Code on behalf of Andrea Cosentino._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)