Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch server-UI and TagValueGuard #1635

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;

/**
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@
Set<String> 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;

Check warning on line 134 in inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/metrics/MeasureTagValueGuard.java

View check run for this annotation

Codecov / codecov/patch

inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/metrics/MeasureTagValueGuard.java#L132-L134

Added lines #L132 - L134 were not covered by tests
}
} else {
tagValues.add(tagValue);
}
Expand Down
Loading