From f922823fd878c6bce8522af9a712ed1695d4bec9 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Tue, 22 Feb 2022 17:02:42 +0800 Subject: [PATCH] Add a property to enable/disable metrics module --- .../src/main/resources/application.yaml | 3 +++ dolphinscheduler-api/src/main/resources/application.yaml | 3 +++ dolphinscheduler-master/src/main/resources/application.yaml | 3 +++ .../org/apache/dolphinscheduler/meter/MeterConfiguration.java | 3 ++- dolphinscheduler-python/src/main/resources/application.yaml | 3 +++ .../src/main/resources/application.yaml | 3 +++ dolphinscheduler-worker/src/main/resources/application.yaml | 3 +++ 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application.yaml b/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application.yaml index d2bb0cfac0d3..f68d1b8f4140 100644 --- a/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application.yaml +++ b/dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/resources/application.yaml @@ -52,6 +52,9 @@ management: alert: port: 50052 +metrics: + enabled: true + # Override by profile --- diff --git a/dolphinscheduler-api/src/main/resources/application.yaml b/dolphinscheduler-api/src/main/resources/application.yaml index f53445a48b3f..72a6cd3a9a60 100644 --- a/dolphinscheduler-api/src/main/resources/application.yaml +++ b/dolphinscheduler-api/src/main/resources/application.yaml @@ -104,6 +104,9 @@ registry: audit: enabled: false +metrics: + enabled: true + # Override by profile --- diff --git a/dolphinscheduler-master/src/main/resources/application.yaml b/dolphinscheduler-master/src/main/resources/application.yaml index 55e7ea6c25a9..beefc2277116 100644 --- a/dolphinscheduler-master/src/main/resources/application.yaml +++ b/dolphinscheduler-master/src/main/resources/application.yaml @@ -121,6 +121,9 @@ management: tags: application: ${spring.application.name} +metrics: + enabled: true + # Override by profile --- diff --git a/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/MeterConfiguration.java b/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/MeterConfiguration.java index 7b517f37b7b3..d8b7297853d1 100644 --- a/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/MeterConfiguration.java +++ b/dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/MeterConfiguration.java @@ -21,10 +21,10 @@ package org.apache.dolphinscheduler.meter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; -import org.springframework.context.annotation.Profile; import io.micrometer.core.aop.CountedAspect; import io.micrometer.core.aop.TimedAspect; @@ -33,6 +33,7 @@ @Configuration @EnableAspectJAutoProxy @EnableAutoConfiguration +@ConditionalOnProperty(prefix = "metrics", name = "enabled", havingValue = "true") public class MeterConfiguration { @Bean public TimedAspect timedAspect(MeterRegistry registry) { diff --git a/dolphinscheduler-python/src/main/resources/application.yaml b/dolphinscheduler-python/src/main/resources/application.yaml index b5dc00cd8983..8c60ac1f66d7 100644 --- a/dolphinscheduler-python/src/main/resources/application.yaml +++ b/dolphinscheduler-python/src/main/resources/application.yaml @@ -67,6 +67,9 @@ management: tags: application: ${spring.application.name} +metrics: + enabled: true + # Override by profile --- spring: diff --git a/dolphinscheduler-standalone-server/src/main/resources/application.yaml b/dolphinscheduler-standalone-server/src/main/resources/application.yaml index 53cfcbc9e26d..afd3f5d4ff90 100644 --- a/dolphinscheduler-standalone-server/src/main/resources/application.yaml +++ b/dolphinscheduler-standalone-server/src/main/resources/application.yaml @@ -180,6 +180,9 @@ management: audit: enabled: true +metrics: + enabled: true + # Override by profile --- spring: diff --git a/dolphinscheduler-worker/src/main/resources/application.yaml b/dolphinscheduler-worker/src/main/resources/application.yaml index 9d5d0ff67a78..3f79a32863f5 100644 --- a/dolphinscheduler-worker/src/main/resources/application.yaml +++ b/dolphinscheduler-worker/src/main/resources/application.yaml @@ -83,3 +83,6 @@ management: metrics: tags: application: ${spring.application.name} + +metrics: + enabled: true