From 1dd9674773e0f1f18416337f7fec0064333e38b4 Mon Sep 17 00:00:00 2001 From: nicolasgere Date: Wed, 1 May 2024 10:30:10 -0700 Subject: [PATCH] [ENH]: make otel optional (#2090) ## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Make otel server optional --- go/pkg/grpcutils/service.go | 11 +++++------ go/shared/otel/main.go | 2 +- k8s/distributed-chroma/values.yaml | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/go/pkg/grpcutils/service.go b/go/pkg/grpcutils/service.go index 5d2e5ce11c5..3fd15919649 100644 --- a/go/pkg/grpcutils/service.go +++ b/go/pkg/grpcutils/service.go @@ -74,13 +74,12 @@ func newDefaultGrpcProvider(name string, grpcConfig *GrpcConfig, registerFunc fu } opts = append(opts, grpc.UnaryInterceptor(otel.ServerGrpcInterceptor)) OPTL_TRACING_ENDPOINT := os.Getenv("OPTL_TRACING_ENDPOINT") - if OPTL_TRACING_ENDPOINT == "" { - OPTL_TRACING_ENDPOINT = "jaeger:4317" + if OPTL_TRACING_ENDPOINT != "" { + otel.InitTracing(context.Background(), &otel.TracingConfig{ + Service: "sysdb-service", + Endpoint: OPTL_TRACING_ENDPOINT, + }) } - otel.InitTracing(context.Background(), &otel.TracingConfig{ - Service: "sysdb-service", - Endpoint: OPTL_TRACING_ENDPOINT, - }) c := &defaultGrpcServer{ server: grpc.NewServer(opts...), diff --git a/go/shared/otel/main.go b/go/shared/otel/main.go index 6933df63be4..7f317a703f1 100644 --- a/go/shared/otel/main.go +++ b/go/shared/otel/main.go @@ -125,7 +125,7 @@ func InitTracing(ctx context.Context, config *TracingConfig) (err error) { otlptracegrpc.NewClient( otlptracegrpc.WithInsecure(), otlptracegrpc.WithEndpoint(config.Endpoint), - otlptracegrpc.WithDialOption(grpc.WithBlock()), // Useful for waiting until the connection is up. + otlptracegrpc.WithDialOption(), ), ) if err != nil { diff --git a/k8s/distributed-chroma/values.yaml b/k8s/distributed-chroma/values.yaml index b7e05d122b6..d09668ff96b 100644 --- a/k8s/distributed-chroma/values.yaml +++ b/k8s/distributed-chroma/values.yaml @@ -38,6 +38,8 @@ sysdb: tag: 'sysdb' replicaCount: 1 env: + - name: OPTL_TRACING_ENDPOINT + value: 'value: "http://jaeger:4317"' flags: logService: @@ -45,6 +47,8 @@ logService: repository: 'local' tag: 'log-service' env: + - name: OPTL_TRACING_ENDPOINT + value: 'value: "http://jaeger:4317"' flags: queryService: