This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch switch/metrics in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
commit f922823fd878c6bce8522af9a712ed1695d4bec9 Author: kezhenxu94 <[email protected]> AuthorDate: Tue Feb 22 17:02:42 2022 +0800 Add a property to enable/disable metrics module --- .../dolphinscheduler-alert-server/src/main/resources/application.yaml | 3 +++ dolphinscheduler-api/src/main/resources/application.yaml | 3 +++ dolphinscheduler-master/src/main/resources/application.yaml | 3 +++ .../java/org/apache/dolphinscheduler/meter/MeterConfiguration.java | 3 ++- dolphinscheduler-python/src/main/resources/application.yaml | 3 +++ dolphinscheduler-standalone-server/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 d2bb0cf..f68d1b8 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 f53445a..72a6cd3 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 55e7ea6..beefc22 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 7b517f3..d8b7297 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 @@ import io.micrometer.core.instrument.MeterRegistry; @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 b5dc00c..8c60ac1 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 53cfcbc..afd3f5d 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 9d5d0ff..3f79a32 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
