Skip to content

Commit bb9d8f5

Browse files
Refactored path normalisation filtering into shared
1 parent 3c5d621 commit bb9d8f5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/com/uid2/admin/Main.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import com.uid2.shared.store.RotatingSaltProvider;
4343
import com.uid2.shared.store.reader.*;
4444
import com.uid2.shared.store.scope.GlobalScope;
45+
import com.uid2.shared.util.HTTPPathMetricFilter;
4546
import com.uid2.shared.vertx.VertxUtils;
4647
import io.micrometer.core.instrument.Gauge;
4748
import io.micrometer.core.instrument.MeterRegistry;
@@ -422,13 +423,8 @@ private static void setupMetrics(MicrometerMetricsOptions metricOptions) {
422423
prometheusRegistry.config()
423424
// providing common renaming for prometheus metric, e.g. "hello.world" to "hello_world"
424425
.meterFilter(new PrometheusRenameFilter())
425-
.meterFilter(MeterFilter.replaceTagValues(Label.HTTP_PATH.toString(), actualPath -> {
426-
try {
427-
return HttpUtils.normalizePath(actualPath).split("\\?")[0];
428-
} catch (IllegalArgumentException e) {
429-
return actualPath;
430-
}
431-
}))
426+
.meterFilter(MeterFilter.replaceTagValues(Label.HTTP_PATH.toString(),
427+
actualPath -> HTTPPathMetricFilter.filterPath(actualPath, Set.of())))
432428
// adding common labels
433429
.commonTags("application", "uid2-admin");
434430

0 commit comments

Comments
 (0)