From 0289f32f050916a8d5ce7763bde0a889ec61b399 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 4 May 2024 09:51:08 +0300 Subject: [PATCH] chore: Update OpenTelemetry configuration and observability package --- observability/observability.go | 4 ++++ service.go | 1 + 2 files changed, 5 insertions(+) diff --git a/observability/observability.go b/observability/observability.go index 63166930f..512751d04 100644 --- a/observability/observability.go +++ b/observability/observability.go @@ -6,6 +6,8 @@ import ( "context" "log/slog" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/resource" "go.opentelemetry.io/otel/sdk/trace" @@ -28,6 +30,8 @@ func Setup(ctx context.Context, name, version string, conn *grpc.ClientConn) (*P return nil, err } + otel.SetTextMapPropagator(propagation.TraceContext{}) + metricProvider, err := setupMeter(ctx, name, res, conn) if err != nil { return nil, err diff --git a/service.go b/service.go index 132901a34..d1a65c69e 100644 --- a/service.go +++ b/service.go @@ -50,6 +50,7 @@ func New(name, version string, observabilityConn *grpc.ClientConn, options ...Op if version == "" { version = "dev" } + // TODO: provide a default grpc connection and optional function to override details. if observabilityConn == nil { return nil, errors.New("observability connection is required") }