Skip to content

Commit ac7bd5a

Browse files
committed
adding more exact paths for TraceInformationGenerator
1 parent df6f261 commit ac7bd5a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/utils/tracing/src/main/java/org/eclipse/ditto/internal/utils/tracing/TraceInformationGenerator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public final class TraceInformationGenerator implements Function<String, TraceIn
6060
"/(?<entityType>{0}))(/(?<entityId>$|.*?))?(/(?<subEntityType>$|.*?))?(/(?<subEntityId>$|.*?))?($|/.*)";
6161
private static final String PATHS_EXACT_LENGTH_GROUP = "exact";
6262
private static final Set<String> PATHS_EXACT = Set.of(
63+
"api/2/whoami",
64+
"api/2/checkPermissions",
65+
"api/2/cloudevents",
6366
"ws/2",
6467
"health",
6568
"status",
@@ -139,7 +142,10 @@ private TraceInformation extractTraceInformation(final String path) {
139142
final var pathToShorten = matcher.group(PATHS_TO_SHORTEN_GROUP);
140143
if (null != pathToShorten) {
141144
final var messageMatcher = MESSAGE_PATTERN.matcher(normalizedPath);
142-
if (messageMatcher.matches()) {
145+
if (pathToShorten.equals(path)) {
146+
traceUri = URI.create(path);
147+
sanitizedUri = traceUri;
148+
} else if (messageMatcher.matches()) {
143149
traceUri = URI.create(pathToShorten + MESSAGES_PATH_SUFFIX);
144150
sanitizedUri = traceUri;
145151
} else {

0 commit comments

Comments
 (0)