Skip to content

Commit

Permalink
adding more exact paths for TraceInformationGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
thjaeckle committed Nov 8, 2024
1 parent df6f261 commit ac7bd5a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public final class TraceInformationGenerator implements Function<String, TraceIn
"/(?<entityType>{0}))(/(?<entityId>$|.*?))?(/(?<subEntityType>$|.*?))?(/(?<subEntityId>$|.*?))?($|/.*)";
private static final String PATHS_EXACT_LENGTH_GROUP = "exact";
private static final Set<String> PATHS_EXACT = Set.of(
"api/2/whoami",
"api/2/checkPermissions",
"api/2/cloudevents",
"ws/2",
"health",
"status",
Expand Down Expand Up @@ -139,7 +142,10 @@ private TraceInformation extractTraceInformation(final String path) {
final var pathToShorten = matcher.group(PATHS_TO_SHORTEN_GROUP);
if (null != pathToShorten) {
final var messageMatcher = MESSAGE_PATTERN.matcher(normalizedPath);
if (messageMatcher.matches()) {
if (pathToShorten.equals(path)) {
traceUri = URI.create(path);
sanitizedUri = traceUri;
} else if (messageMatcher.matches()) {
traceUri = URI.create(pathToShorten + MESSAGES_PATH_SUFFIX);
sanitizedUri = traceUri;
} else {
Expand Down

0 comments on commit ac7bd5a

Please sign in to comment.