diff --git a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/config/FrontendConfiguration.java b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/config/FrontendConfiguration.java index 74ddb81b54..2c013d3194 100644 --- a/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/config/FrontendConfiguration.java +++ b/components/inspectit-ocelot-configurationserver/src/main/java/rocks/inspectit/ocelot/config/FrontendConfiguration.java @@ -1,7 +1,9 @@ package rocks.inspectit.ocelot.config; import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpStatus; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** @@ -16,4 +18,14 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { .addResourceHandler("/ui/**") .addResourceLocations("classpath:/static/ui/"); } + + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addRedirectViewController("/ui", "/ui/") + .setKeepQueryParams(true) + .setStatusCode(HttpStatus.PERMANENT_REDIRECT); + registry.addRedirectViewController("/", "/ui/") + .setKeepQueryParams(true) + .setStatusCode(HttpStatus.PERMANENT_REDIRECT); + } } diff --git a/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml b/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml index 4a197b722d..1e5dab04b4 100644 --- a/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml +++ b/components/inspectit-ocelot-configurationserver/src/main/resources/application.yml @@ -28,7 +28,6 @@ spring: # server properties - see https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#server-properties server: port: 8090 - max-http-header-size: 1MB inspectit-config-server: # the directory which is used as working directory diff --git a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/metrics/MeasureTagValueGuard.java b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/metrics/MeasureTagValueGuard.java index 6184e54eff..319db02c16 100644 --- a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/metrics/MeasureTagValueGuard.java +++ b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/metrics/MeasureTagValueGuard.java @@ -127,10 +127,12 @@ protected void stop() { Set tagValues = tagValuesByTagKey.computeIfAbsent(tagKey, (x) -> new HashSet<>()); // if tag value is new AND max values per tag is already reached if (!tagValues.contains(tagValue) && tagValues.size() >= maxValuesPerTag) { - blockedTagKeysByMeasure.computeIfAbsent(measureName, measure -> Sets.newHashSet()).add(tagKey); - agentHealthManager.handleInvalidatableHealth(AgentHealth.ERROR, this.getClass(), - String.format(tagOverFlowMessageTemplate, measureName, tagKey)); - hasTagValueOverflow = true; + boolean isNewBlockedTag = blockedTagKeysByMeasure.computeIfAbsent(measureName, measure -> Sets.newHashSet()).add(tagKey); + if(isNewBlockedTag) { + agentHealthManager.handleInvalidatableHealth(AgentHealth.ERROR, this.getClass(), + String.format(tagOverFlowMessageTemplate, measureName, tagKey)); + hasTagValueOverflow = true; + } } else { tagValues.add(tagValue); }