add otel.enabled

This commit is contained in:
Anatoly Karlov 2024-11-01 20:28:10 +07:00
parent 9345e2efd5
commit b3200e2914
2 changed files with 3 additions and 0 deletions

View File

@ -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 {

View File

@ -137,3 +137,4 @@ http-client:
otel:
resource: http://localhost:4318/v1/traces
timeout: 60000
enabled: false