From e884433654895d7ed287c240ebed2d9cbdd8d094 Mon Sep 17 00:00:00 2001 From: sophia chen Date: Thu, 2 Jan 2025 09:20:23 +1100 Subject: [PATCH 1/4] Refactored path normalisation filtering into shared --- src/main/java/com/uid2/operator/Main.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/uid2/operator/Main.java b/src/main/java/com/uid2/operator/Main.java index a307e3695..cc71114db 100644 --- a/src/main/java/com/uid2/operator/Main.java +++ b/src/main/java/com/uid2/operator/Main.java @@ -25,6 +25,7 @@ import com.uid2.shared.store.RotatingSaltProvider; import com.uid2.shared.store.reader.*; import com.uid2.shared.store.scope.GlobalScope; +import com.uid2.shared.util.HTTPPathMetricFilter; import com.uid2.shared.vertx.CloudSyncVerticle; import com.uid2.shared.vertx.ICloudSync; import com.uid2.shared.vertx.RotatingStoreVerticle; @@ -427,14 +428,8 @@ private static void setupMetrics(MicrometerMetricsOptions metricOptions) { prometheusRegistry.config() // providing common renaming for prometheus metric, e.g. "hello.world" to "hello_world" .meterFilter(new PrometheusRenameFilter()) - .meterFilter(MeterFilter.replaceTagValues(Label.HTTP_PATH.toString(), actualPath -> { - try { - String normalized = HttpUtils.normalizePath(actualPath).split("\\?")[0]; - return Endpoints.pathSet().contains(normalized) ? normalized : "/unknown"; - } catch (IllegalArgumentException e) { - return actualPath; - } - })) + .meterFilter(MeterFilter.replaceTagValues(Label.HTTP_PATH.toString(), + actualPath -> HTTPPathMetricFilter.filterPath(actualPath, Endpoints.pathSet()))) // Don't record metrics for 404s. .meterFilter(MeterFilter.deny(id -> id.getName().startsWith(MetricsDomain.HTTP_SERVER.getPrefix()) && From 4147b2dfcbff2aefe199a741df0c55a09a49d158 Mon Sep 17 00:00:00 2001 From: sophia chen Date: Thu, 2 Jan 2025 13:23:27 +1100 Subject: [PATCH 2/4] Updated pom.xml --- pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ef9b19c29..657ccf3f8 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 2.1.0 2.1.0 2.1.0 - 8.0.9 + 8.0.29 ${project.version} 21 21 @@ -206,6 +206,12 @@ 4.3.2 test + + com.uid2 + uid2-shared + 8.0.25-DEV + compile + From 232b4a4d4c3781ebfcbb1b613ac3f9ca722a0e51 Mon Sep 17 00:00:00 2001 From: sophia-chen-ttd <152837545+sophia-chen-ttd@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:27:30 +1100 Subject: [PATCH 3/4] Update pom.xml --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 657ccf3f8..a57034855 100644 --- a/pom.xml +++ b/pom.xml @@ -206,12 +206,6 @@ 4.3.2 test - - com.uid2 - uid2-shared - 8.0.25-DEV - compile - From a65ac591fee570ce7847e64b3e59675b37e54fd8 Mon Sep 17 00:00:00 2001 From: sophia-chen-ttd <152837545+sophia-chen-ttd@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:20:14 +1100 Subject: [PATCH 4/4] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a57034855..bf7c66a1a 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 2.1.0 2.1.0 2.1.0 - 8.0.29 + 8.0.32 ${project.version} 21 21