Skip to content

Commit

Permalink
[ENH]: make otel optional (#2090)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Make otel server optional
  • Loading branch information
nicolasgere authored May 1, 2024
1 parent e9bfb66 commit 1dd9674
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 5 additions & 6 deletions go/pkg/grpcutils/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...),
Expand Down
2 changes: 1 addition & 1 deletion go/shared/otel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions k8s/distributed-chroma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ sysdb:
tag: 'sysdb'
replicaCount: 1
env:
- name: OPTL_TRACING_ENDPOINT
value: 'value: "http://jaeger:4317"'
flags:

logService:
image:
repository: 'local'
tag: 'log-service'
env:
- name: OPTL_TRACING_ENDPOINT
value: 'value: "http://jaeger:4317"'
flags:

queryService:
Expand Down

0 comments on commit 1dd9674

Please sign in to comment.