diff --git a/docstore-metrics/gradle.lockfile b/docstore-metrics/gradle.lockfile index 053dd53..5b232c6 100644 --- a/docstore-metrics/gradle.lockfile +++ b/docstore-metrics/gradle.lockfile @@ -19,29 +19,15 @@ io.dropwizard.metrics:metrics-jakarta-servlet:4.2.25=compileClasspath,runtimeCla io.dropwizard.metrics:metrics-jvm:4.2.25=runtimeClasspath,testRuntimeClasspath io.github.mweirauch:micrometer-jvm-extras:0.2.2=runtimeClasspath,testRuntimeClasspath io.grpc:grpc-bom:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-core:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus-simpleclient:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.14.4=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-core:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=runtimeClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.5=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=runtimeClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_tracer_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_tracer_otel:0.16.0=runtimeClasspath,testRuntimeClasspath @@ -64,7 +50,7 @@ org.eclipse.jetty:jetty-server:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-session:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=runtimeClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.documentstore:document-store:0.9.50=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.6.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.latencyutils:LatencyUtils:2.0.3=runtimeClasspath,testRuntimeClasspath diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a274b96..dcb8738 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,6 @@ dropwizard-metrics = "4.2.25" micrometer = "1.15.12" prometheus-simpleclient = "0.16.0" -# Aligns with the io.prometheus:* transitives pulled in by micrometer-registry-prometheus. -prometheus = "1.3.5" caffeine = "3.1.8" [libraries] @@ -14,15 +12,11 @@ dropwizard-metrics-jakarta-servlets = { module = "io.dropwizard.metrics:metrics- dropwizard-metrics-jvm = { module = "io.dropwizard.metrics:metrics-jvm", version.ref = "dropwizard-metrics" } micrometer-core = { module = "io.micrometer:micrometer-core", version.ref = "micrometer" } micrometer-registry-prometheus-simpleclient = { module = "io.micrometer:micrometer-registry-prometheus-simpleclient", version.ref = "micrometer" } -micrometer-registry-prometheus = { module = "io.micrometer:micrometer-registry-prometheus", version.ref = "micrometer" } -prometheus-exporter-httpserver = { module = "io.prometheus:prometheus-metrics-exporter-httpserver", version.ref = "prometheus" } -prometheus-exporter-servlet-jakarta = { module = "io.prometheus:prometheus-metrics-exporter-servlet-jakarta", version.ref = "prometheus" } -prometheus-instrumentation-dropwizard = { module = "io.prometheus:prometheus-metrics-instrumentation-dropwizard", version.ref = "prometheus" } -prometheus-simpleclient-bridge = { module = "io.prometheus:prometheus-metrics-simpleclient-bridge", version.ref = "prometheus" } micrometer-jvm-extras = { module = "io.github.mweirauch:micrometer-jvm-extras", version = "0.2.2" } prometheus-simpleclient-servlet-jakarta = { module = "io.prometheus:simpleclient_servlet_jakarta", version.ref = "prometheus-simpleclient" } prometheus-simpleclient-pushgateway = { module = "io.prometheus:simpleclient_pushgateway", version.ref = "prometheus-simpleclient" } prometheus-simpleclient-dropwizard = { module = "io.prometheus:simpleclient_dropwizard", version.ref = "prometheus-simpleclient" } +prometheus-simpleclient-httpserver = { module = "io.prometheus:simpleclient_httpserver", version.ref = "prometheus-simpleclient" } caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" } apache-httpcomponents-httpclient = { module = "org.apache.httpcomponents:httpclient", version = "4.5.13" } diff --git a/integrationtest-service-framework/gradle.lockfile b/integrationtest-service-framework/gradle.lockfile index 00bb00e..61f15cf 100644 --- a/integrationtest-service-framework/gradle.lockfile +++ b/integrationtest-service-framework/gradle.lockfile @@ -23,30 +23,15 @@ io.dropwizard.metrics:metrics-json:4.2.25=runtimeClasspath,testRuntimeClasspath io.dropwizard.metrics:metrics-jvm:4.2.25=runtimeClasspath,testRuntimeClasspath io.github.mweirauch:micrometer-jvm-extras:0.2.2=runtimeClasspath,testRuntimeClasspath io.grpc:grpc-bom:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-core:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus-simpleclient:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.14.4=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-core:1.15.12=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=runtimeClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-servlet-jakarta:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.5=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=runtimeClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_jakarta:0.16.0=runtimeClasspath,testRuntimeClasspath @@ -69,7 +54,7 @@ org.eclipse.jetty:jetty-session:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.6.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.latencyutils:LatencyUtils:2.0.3=runtimeClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=runtimeClasspath,testRuntimeClasspath diff --git a/platform-grpc-service-framework/gradle.lockfile b/platform-grpc-service-framework/gradle.lockfile index 72fc00c..b97de7a 100644 --- a/platform-grpc-service-framework/gradle.lockfile +++ b/platform-grpc-service-framework/gradle.lockfile @@ -42,11 +42,10 @@ io.grpc:grpc-protobuf:1.75.0=runtimeClasspath,testRuntimeClasspath io.grpc:grpc-services:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.grpc:grpc-stub:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.grpc:grpc-util:1.75.0=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-core:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus-simpleclient:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.14.4=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-core:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=runtimeClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http2:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -60,24 +59,10 @@ io.netty:netty-resolver:4.1.138.Final=compileClasspath,runtimeClasspath,testComp io.netty:netty-transport-native-unix-common:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.perfmark:perfmark-api:0.27.0=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-servlet-jakarta:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.5=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=runtimeClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_jakarta:0.16.0=runtimeClasspath,testRuntimeClasspath @@ -99,7 +84,7 @@ org.eclipse.jetty:jetty-server:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-session:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=runtimeClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.13.23=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.13.23=runtimeClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-server-utils:0.13.23=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/platform-http-service-framework/gradle.lockfile b/platform-http-service-framework/gradle.lockfile index b5d2ae1..89fa77f 100644 --- a/platform-http-service-framework/gradle.lockfile +++ b/platform-http-service-framework/gradle.lockfile @@ -41,31 +41,16 @@ io.grpc:grpc-bom:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,t io.grpc:grpc-context:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.grpc:grpc-core:1.75.0=runtimeClasspath,testRuntimeClasspath io.grpc:grpc-inprocess:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-core:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus-simpleclient:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.14.4=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-core:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=runtimeClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.perfmark:perfmark-api:0.27.0=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-servlet-jakarta:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.5=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=runtimeClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_jakarta:0.16.0=runtimeClasspath,testRuntimeClasspath @@ -90,7 +75,7 @@ org.eclipse.jetty:jetty-server:12.1.10=compileClasspath,runtimeClasspath,testCom org.eclipse.jetty:jetty-session:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.13.23=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.13.23=runtimeClasspath,testRuntimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.6.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/platform-hybrid-service-framework/gradle.lockfile b/platform-hybrid-service-framework/gradle.lockfile index f7db688..8a3db6e 100644 --- a/platform-hybrid-service-framework/gradle.lockfile +++ b/platform-hybrid-service-framework/gradle.lockfile @@ -46,11 +46,10 @@ io.grpc:grpc-protobuf:1.75.0=runtimeClasspath,testRuntimeClasspath io.grpc:grpc-services:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.grpc:grpc-stub:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.grpc:grpc-util:1.75.0=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-core:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus-simpleclient:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.14.4=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-core:1.15.12=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=runtimeClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.138.Final=runtimeClasspath,testRuntimeClasspath io.netty:netty-codec-http2:4.1.138.Final=runtimeClasspath,testRuntimeClasspath @@ -64,24 +63,10 @@ io.netty:netty-resolver:4.1.138.Final=runtimeClasspath,testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.138.Final=runtimeClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.138.Final=runtimeClasspath,testRuntimeClasspath io.perfmark:perfmark-api:0.27.0=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-servlet-jakarta:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.5=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=runtimeClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_common:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_jakarta:0.16.0=runtimeClasspath,testRuntimeClasspath @@ -106,7 +91,7 @@ org.eclipse.jetty:jetty-server:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-session:12.1.10=runtimeClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=runtimeClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-client-utils:0.13.23=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-context-utils:0.13.23=runtimeClasspath,testRuntimeClasspath org.hypertrace.core.grpcutils:grpc-server-utils:0.13.23=runtimeClasspath,testRuntimeClasspath diff --git a/platform-metrics/README.md b/platform-metrics/README.md index 3242491..15f04fb 100644 --- a/platform-metrics/README.md +++ b/platform-metrics/README.md @@ -43,7 +43,8 @@ counter.increment(); This library uses MicroMeter for metrics, and the API of MicroMeter is exposed directly to leverage the power of it. See https://micrometer.io/docs for more details. -For Flink TaskManagers, `SharedMeterRegistry.getPrometheusRegistry(serviceName, port)` -binds the process scrape endpoint and returns the Prometheus registry so a Flink metric -reporter can bridge Flink-native metrics onto the same endpoint. Application meters still -go through `PlatformMetricsRegistry.getMeterRegistry()`. +For Flink TaskManagers, `SharedMeterRegistry.start(serviceName, port)` initializes the +registry and binds the process scrape endpoint once per JVM. A Flink metric reporter then +calls `SharedMeterRegistry.register(collectorRegistry)` to serve Flink-native metrics on the +same endpoint, and `SharedMeterRegistry.unregister(handle)` when it closes. Application +meters still go through `PlatformMetricsRegistry.getMeterRegistry()`. diff --git a/platform-metrics/build.gradle.kts b/platform-metrics/build.gradle.kts index 62884aa..683e2d2 100644 --- a/platform-metrics/build.gradle.kts +++ b/platform-metrics/build.gradle.kts @@ -15,21 +15,12 @@ dependencies { api(localLibs.micrometer.core) api(localLibs.jakarta.servlet.api) - // New Prometheus client stack (io.micrometer.prometheusmetrics / io.prometheus.metrics). - implementation(localLibs.micrometer.registry.prometheus) - // Standalone HTTP server that exposes the Prometheus scrape endpoint (SharedMeterRegistry). - implementation(localLibs.prometheus.exporter.httpserver) - // Bridges Dropwizard MetricRegistry into the new PrometheusRegistry. - implementation(localLibs.prometheus.instrumentation.dropwizard) - // Bridges the legacy simpleclient CollectorRegistry onto the new PrometheusRegistry. - implementation(localLibs.prometheus.simpleclient.bridge) - - // Legacy simpleclient stack — still required by PrometheusPushMeterRegistry - // (io.micrometer.prometheus.PrometheusMeterRegistry + PushGateway). implementation(localLibs.micrometer.registry.prometheus.simpleclient) implementation(localLibs.prometheus.simpleclient.pushgateway) - // Bridges Dropwizard MetricRegistry into the legacy simpleclient CollectorRegistry. + // Bridges Dropwizard MetricRegistry into the simpleclient CollectorRegistry. implementation(localLibs.prometheus.simpleclient.dropwizard) + // Standalone HTTP server that exposes the Prometheus scrape endpoint (SharedMeterRegistry). + implementation(localLibs.prometheus.simpleclient.httpserver) implementation(localLibs.micrometer.jvm.extras) implementation(commonLibs.slf4j2.api) diff --git a/platform-metrics/gradle.lockfile b/platform-metrics/gradle.lockfile index 8f9b52d..64f382e 100644 --- a/platform-metrics/gradle.lockfile +++ b/platform-metrics/gradle.lockfile @@ -21,26 +21,11 @@ io.micrometer:micrometer-commons:1.15.12=compileClasspath,runtimeClasspath,testC io.micrometer:micrometer-core:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.micrometer:micrometer-observation:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.10=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.10=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=compileClasspath,testCompileClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_tracer_common:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_tracer_otel:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -64,7 +49,7 @@ org.eclipse.jetty:jetty-server:12.1.10=compileClasspath,runtimeClasspath,testCom org.eclipse.jetty:jetty-session:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.6.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.10.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.10.0=testRuntimeClasspath diff --git a/platform-metrics/src/main/java/org/hypertrace/core/serviceframework/metrics/PlatformMetricsRegistry.java b/platform-metrics/src/main/java/org/hypertrace/core/serviceframework/metrics/PlatformMetricsRegistry.java index c67e115..2bec781 100644 --- a/platform-metrics/src/main/java/org/hypertrace/core/serviceframework/metrics/PlatformMetricsRegistry.java +++ b/platform-metrics/src/main/java/org/hypertrace/core/serviceframework/metrics/PlatformMetricsRegistry.java @@ -42,8 +42,6 @@ import io.prometheus.client.CollectorRegistry; import io.prometheus.client.dropwizard.DropwizardExports; import io.prometheus.client.exporter.PushGateway; -import io.prometheus.metrics.model.registry.PrometheusRegistry; -import io.prometheus.metrics.simpleclient.bridge.SimpleclientCollector; import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; @@ -91,7 +89,6 @@ public class PlatformMetricsRegistry { private static final String METRICS_DEFAULT_TAGS_CONFIG_KEY = "defaultTags"; private static final MetricRegistry METRIC_REGISTRY = new MetricRegistry(); - private static final PrometheusRegistry PROMETHEUS_REGISTRY = new PrometheusRegistry(); public static final List DEFAULT_METRICS_REPORTERS = List.of("prometheus"); private static ConsoleReporter consoleReporter; @@ -129,11 +126,6 @@ public String get(String k) { Clock.SYSTEM)); CollectorRegistry.defaultRegistry.register(new DropwizardExports(METRIC_REGISTRY)); - // exposing the metrics registered via the Collector Registry to a Prometheus instance which - // will be served via a separate prometheus server. - SimpleclientCollector.builder() - .collectorRegistry(CollectorRegistry.defaultRegistry) - .register(PROMETHEUS_REGISTRY); } private static void initConsoleMetricsReporter(final int reportIntervalSec) { @@ -220,7 +212,8 @@ private static List getStringList(Config config, String path, ListApplication meters still report through {@link PlatformMetricsRegistry#getMeterRegistry()}; - * this class only binds the HTTP scrape server and exposes the underlying {@link - * PrometheusRegistry} so Flink's metric reporter can bridge Flink-native metrics onto the same - * endpoint. The exporter is started exactly once per JVM: the port from the first caller wins, and - * later callers reuse that instance. + *

Application meters still report through {@link PlatformMetricsRegistry#getMeterRegistry()}, + * which lands in {@link CollectorRegistry#defaultRegistry}. This class serves that registry plus + * any registry handed to {@link #register(CollectorRegistry)} (such as the one owned by Flink's + * metric reporter) from a single HTTP server. The server is bound exactly once per JVM: the port + * from the first caller wins, and later callers reuse that instance. * - *

Parameters are primitives / {@link String} on purpose so this class can sit on Flink's + *

Parameters are JDK / simpleclient types on purpose so this class can sit on Flink's * parent-first shared classpath without coupling that surface to typesafe-config. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class SharedMeterRegistry { - private static boolean initialized = false; + // No name-collision checks: exposed registries are owned by different components and are + // registered before they hold any metrics. + private static final CollectorRegistry EXPOSED = new CollectorRegistry(false); + + static { + EXPOSED.register(new RegistryDelegate(CollectorRegistry.defaultRegistry)); + } + + private static HTTPServer server; /** - * Returns the process-wide Prometheus registry, starting {@link PlatformMetricsRegistry} and the - * scrape-endpoint HTTP server on first use. + * Initializes {@link PlatformMetricsRegistry} for Flink and binds the scrape endpoint on first + * use. * * @param serviceName service name added to the common metric tags - * @param exporterPort the port on which to publish the Prometheus scrape endpoint - * @return the shared Prometheus registry + * @param port the port on which to publish the Prometheus scrape endpoint; 0 picks a free port */ - public static synchronized PrometheusRegistry getOrCreatePrometheusRegistry( - String serviceName, int exporterPort) { - if (!initialized) { - PlatformMetricsRegistry.initMetricsRegistryForFlink(serviceName); - try { - HTTPServer.builder() - .port(exporterPort) - .registry(PlatformMetricsRegistry.getPrometheusRegistry()) - .buildAndStart(); - } catch (IOException e) { - throw new UncheckedIOException("Failed to start Prometheus exporter HTTP server", e); - } - initialized = true; + public static synchronized void start(String serviceName, int port) { + PlatformMetricsRegistry.initMetricsRegistryForFlink(serviceName); + if (server != null) { + return; + } + try { + server = + new HTTPServer.Builder() + .withPort(port) + .withRegistry(EXPOSED) + .withDaemonThreads(true) + .build(); + } catch (IOException e) { + throw new UncheckedIOException("Failed to start Prometheus exporter HTTP server", e); + } + } + + /** + * Serves the metrics of {@code source} on the shared scrape endpoint. + * + * @return a handle to pass to {@link #unregister(Collector)} + */ + public static synchronized Collector register(CollectorRegistry source) { + return new RegistryDelegate(source).register(EXPOSED); + } + + /** Stops serving the registry previously passed to {@link #register(CollectorRegistry)}. */ + public static synchronized void unregister(Collector handle) { + EXPOSED.unregister(handle); + } + + /** + * Returns the port the scrape endpoint is bound to. + * + * @throws IllegalStateException if {@link #start(String, int)} has not been called + */ + public static synchronized int boundPort() { + if (server == null) { + throw new IllegalStateException("Prometheus exporter HTTP server is not started"); + } + return server.getPort(); + } + + private static final class RegistryDelegate extends Collector { + private final CollectorRegistry source; + + private RegistryDelegate(CollectorRegistry source) { + this.source = source; + } + + @Override + public List collect() { + return Collections.list(source.metricFamilySamples()); + } + + @Override + public List collect(Predicate sampleNameFilter) { + return Collections.list(source.filteredMetricFamilySamples(sampleNameFilter)); } - return PlatformMetricsRegistry.getPrometheusRegistry(); } } diff --git a/platform-metrics/src/test/java/org/hypertrace/core/serviceframework/metrics/prometheus/SharedMeterRegistryTest.java b/platform-metrics/src/test/java/org/hypertrace/core/serviceframework/metrics/prometheus/SharedMeterRegistryTest.java new file mode 100644 index 0000000..a215ba9 --- /dev/null +++ b/platform-metrics/src/test/java/org/hypertrace/core/serviceframework/metrics/prometheus/SharedMeterRegistryTest.java @@ -0,0 +1,108 @@ +package org.hypertrace.core.serviceframework.metrics.prometheus; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import io.prometheus.client.Collector; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Counter; +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import org.hypertrace.core.serviceframework.metrics.PlatformMetricsRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class SharedMeterRegistryTest { + private static final HttpClient HTTP_CLIENT = HttpClient.newHttpClient(); + + @BeforeEach + void startEndpoint() { + SharedMeterRegistry.start("shared-meter-registry-test", 0); + } + + @AfterEach + void stopRegistry() { + PlatformMetricsRegistry.stop(); + } + + @Test + void servesPlatformAndRegisteredMetricsOnOneEndpoint() throws Exception { + PlatformMetricsRegistry.registerCounter("shared.test.platform", Map.of()).increment(); + CollectorRegistry external = new CollectorRegistry(); + Counter.build().name("shared_test_external").help("help").register(external).inc(); + Collector handle = SharedMeterRegistry.register(external); + + try { + String body = scrape(null).body(); + + assertTrue(body.contains("shared_test_platform_total"), body); + assertTrue(body.contains("shared_test_external_total"), body); + } finally { + SharedMeterRegistry.unregister(handle); + } + } + + @Test + void unregisterRemovesRegisteredMetrics() throws Exception { + CollectorRegistry external = new CollectorRegistry(); + Counter.build().name("shared_test_removed").help("help").register(external).inc(); + Collector handle = SharedMeterRegistry.register(external); + + SharedMeterRegistry.unregister(handle); + + assertFalse(scrape(null).body().contains("shared_test_removed")); + } + + @Test + void restartReinitializesPlatformMetricsOnBoundEndpoint() throws Exception { + int port = SharedMeterRegistry.boundPort(); + PlatformMetricsRegistry.stop(); + + SharedMeterRegistry.start("shared-meter-registry-test", 0); + PlatformMetricsRegistry.registerCounter("shared.test.restarted", Map.of()).increment(); + + assertEquals(port, SharedMeterRegistry.boundPort()); + assertTrue(scrape(null).body().contains("shared_test_restarted_total")); + } + + @Test + void servesDistributionWithPercentilesAndHistogram() throws Exception { + PlatformMetricsRegistry.registerDistributionSummary("shared.test.summary", Map.of(), true) + .record(1); + + HttpResponse response = scrape(null); + + assertEquals(200, response.statusCode()); + assertTrue(response.body().contains("shared_test_summary_bucket"), response.body()); + assertTrue(response.body().contains("quantile="), response.body()); + } + + @Test + void servesOpenMetricsFormat() throws Exception { + PlatformMetricsRegistry.registerCounter("shared.test.openmetrics", Map.of()).increment(); + + HttpResponse response = scrape("application/openmetrics-text; version=1.0.0"); + + assertEquals(200, response.statusCode()); + assertTrue( + response.headers().firstValue("Content-Type").orElse("").contains("openmetrics-text")); + assertTrue(response.body().contains("shared_test_openmetrics_total"), response.body()); + } + + private static HttpResponse scrape(String accept) + throws IOException, InterruptedException { + HttpRequest.Builder request = + HttpRequest.newBuilder( + URI.create("http://localhost:" + SharedMeterRegistry.boundPort() + "/metrics")); + if (accept != null) { + request.header("Accept", accept); + } + return HTTP_CLIENT.send(request.build(), HttpResponse.BodyHandlers.ofString()); + } +} diff --git a/platform-service-framework/build.gradle.kts b/platform-service-framework/build.gradle.kts index 671db2f..400ae11 100644 --- a/platform-service-framework/build.gradle.kts +++ b/platform-service-framework/build.gradle.kts @@ -22,7 +22,6 @@ dependencies { // Use for metrics servlet implementation(localLibs.prometheus.simpleclient.servlet.jakarta) - implementation(localLibs.prometheus.exporter.servlet.jakarta) testImplementation(commonLibs.log4j.slf4j2.impl) testImplementation(commonLibs.junit.jupiter) diff --git a/platform-service-framework/gradle.lockfile b/platform-service-framework/gradle.lockfile index 959e367..2784178 100644 --- a/platform-service-framework/gradle.lockfile +++ b/platform-service-framework/gradle.lockfile @@ -25,30 +25,15 @@ io.dropwizard.metrics:metrics-json:4.2.25=compileClasspath,runtimeClasspath,test io.dropwizard.metrics:metrics-jvm:4.2.25=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.github.mweirauch:micrometer-jvm-extras:0.2.2=runtimeClasspath,testRuntimeClasspath io.grpc:grpc-bom:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-core:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.14.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus-simpleclient:1.14.4=runtimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-registry-prometheus:1.14.4=runtimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-core:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.micrometer:micrometer-registry-prometheus-simpleclient:1.15.12=runtimeClasspath,testRuntimeClasspath io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-config:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-core:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-common:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-httpserver:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exporter-servlet-jakarta:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-formats:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-exposition-textformats:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-model:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-simpleclient-bridge:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-initializer:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel-agent:1.3.5=runtimeClasspath,testRuntimeClasspath -io.prometheus:prometheus-metrics-tracer-otel:1.3.5=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_common:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_dropwizard:0.16.0=runtimeClasspath,testRuntimeClasspath +io.prometheus:simpleclient_httpserver:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_pushgateway:0.16.0=runtimeClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_common:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.prometheus:simpleclient_servlet_jakarta:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -75,7 +60,7 @@ org.eclipse.jetty:jetty-server:12.1.10=compileClasspath,runtimeClasspath,testCom org.eclipse.jetty:jetty-session:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.2.2=runtimeClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.6.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=testCompileClasspath org.junit.jupiter:junit-jupiter-api:5.10.0=testCompileClasspath,testRuntimeClasspath diff --git a/service-framework-spi/gradle.lockfile b/service-framework-spi/gradle.lockfile index 44bd65f..cca6e25 100644 --- a/service-framework-spi/gradle.lockfile +++ b/service-framework-spi/gradle.lockfile @@ -6,6 +6,6 @@ io.grpc:grpc-bom:1.75.0=compileClasspath,runtimeClasspath,testCompileClasspath,t io.netty:netty-bom:4.1.138.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jetty.ee10:jetty-ee10-bom:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-bom:12.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hypertrace.bom:hypertrace-bom:0.3.83=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hypertrace.bom:hypertrace-bom:0.3.85=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hypertrace.core.kafkastreams.framework:kafka-bom:0.6.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath empty=annotationProcessor