From c7c0b0e3a92c7fd4b27c2f0cec4fb597027c301f Mon Sep 17 00:00:00 2001 From: Christian Tzolov Date: Thu, 2 Jul 2020 19:52:57 +0200 Subject: [PATCH] Basic SCDF Server metrics collection support - Add influx, prometheus + rsocket-proxy-clinet and wavefront Micrometer meter registry dependencies to SCDF core. - Disable the meter registries by default in the dataflow-server-defaults.yml file. - Extend the docker-compose-wavefront to enable wavefront metrics collection for the SCDF server along with the Stream and Task apps. - Enable the 'http.server.requests' metric by default - Add the `spring.cloud.dataflow` prefix to the metric (e.g. metric-name: 'spring.cloud.dataflow.http.server.requests') Related to #3937 Related to #4016 Resolves #2740 --- pom.xml | 9 ++++++++- spring-cloud-dataflow-server-core/pom.xml | 17 +++++++++++++++++ .../META-INF/dataflow-server-defaults.yml | 14 ++++++++++++++ .../docker-compose-wavefront.yml | 5 +++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 932cec92e8..2eb3f03d0a 100644 --- a/pom.xml +++ b/pom.xml @@ -92,6 +92,7 @@ 3.0.2 1.11.731 1.8 + 0.11.0 spring-cloud-dataflow-configuration-metadata @@ -257,6 +258,12 @@ jsr305 ${findbugs.version} + + io.micrometer.prometheus + prometheus-rsocket-spring + ${prometheus-rsocket-spring.version} + + @@ -421,4 +428,4 @@ - \ No newline at end of file + diff --git a/spring-cloud-dataflow-server-core/pom.xml b/spring-cloud-dataflow-server-core/pom.xml index ff10f7735b..d2d6768a47 100644 --- a/spring-cloud-dataflow-server-core/pom.xml +++ b/spring-cloud-dataflow-server-core/pom.xml @@ -9,6 +9,23 @@ spring-cloud-dataflow-server-core jar + + io.micrometer + micrometer-registry-wavefront + + + io.micrometer + micrometer-registry-influx + + + io.micrometer + micrometer-registry-prometheus + + + io.micrometer.prometheus + prometheus-rsocket-spring + + org.springframework.cloud spring-cloud-dataflow-common-flyway diff --git a/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml b/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml index 526333ab41..c056bc6f49 100644 --- a/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml +++ b/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml @@ -1,4 +1,18 @@ management: + metrics: + web: + server: + request: + autotime: + enabled: true + metric-name: 'spring.cloud.dataflow.http.server.requests' + export: + influx: + enabled: false + prometheus: + enabled: false + wavefront: + enabled: false endpoints: web: base-path: /management diff --git a/spring-cloud-dataflow-server/docker-compose-wavefront.yml b/spring-cloud-dataflow-server/docker-compose-wavefront.yml index c7251dc857..48fa44e60a 100644 --- a/spring-cloud-dataflow-server/docker-compose-wavefront.yml +++ b/spring-cloud-dataflow-server/docker-compose-wavefront.yml @@ -10,6 +10,11 @@ version: '3' services: dataflow-server: environment: + - management.metrics.export.wavefront.enabled=true + - management.metrics.export.wavefront.api-token=${WAVEFRONT_KEY:?WAVEFRONT_KEY is not set!} + - management.metrics.export.wavefront.uri=${WAVEFRONT_URI:-https://vmware.wavefront.com} + - management.metrics.export.wavefront.source=${WAVEFRONT_SOURCE:-scdf-docker-compose} + - spring.cloud.dataflow.applicationProperties.stream.management.metrics.export.wavefront.enabled=true - spring.cloud.dataflow.applicationProperties.stream.management.metrics.export.wavefront.api-token=${WAVEFRONT_KEY:?WAVEFRONT_KEY is not set!} - spring.cloud.dataflow.applicationProperties.stream.management.metrics.export.wavefront.uri=${WAVEFRONT_URI:-https://vmware.wavefront.com}