From b3200e29140069f70a6c77fddf55df0b597620fb Mon Sep 17 00:00:00 2001 From: Anatoly Karlov Date: Fri, 1 Nov 2024 20:28:10 +0700 Subject: [PATCH] add otel.enabled --- src/main/java/dev/vality/disputes/config/OtelConfig.java | 2 ++ src/main/resources/application.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/java/dev/vality/disputes/config/OtelConfig.java b/src/main/java/dev/vality/disputes/config/OtelConfig.java index 16978e2..ff481b6 100644 --- a/src/main/java/dev/vality/disputes/config/OtelConfig.java +++ b/src/main/java/dev/vality/disputes/config/OtelConfig.java @@ -16,6 +16,7 @@ import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -23,6 +24,7 @@ import java.time.Duration; @Slf4j @Configuration +@ConditionalOnProperty(value = "otel.enabled", havingValue = "true", matchIfMissing = true) @RequiredArgsConstructor public class OtelConfig { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7a36a0f..0816250 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -137,3 +137,4 @@ http-client: otel: resource: http://localhost:4318/v1/traces timeout: 60000 + enabled: false