Skip to content

Commit

Permalink
chore: Update OpenTelemetry configuration and observability package
Browse files Browse the repository at this point in the history
  • Loading branch information
mantzas committed May 4, 2024
1 parent 257890c commit 0289f32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions observability/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -28,6 +30,8 @@ func Setup(ctx context.Context, name, version string, conn *grpc.ClientConn) (*P
return nil, err

Check warning on line 30 in observability/observability.go

View check run for this annotation

Codecov / codecov/patch

observability/observability.go#L30

Added line #L30 was not covered by tests
}

otel.SetTextMapPropagator(propagation.TraceContext{})

metricProvider, err := setupMeter(ctx, name, res, conn)
if err != nil {
return nil, err

Check warning on line 37 in observability/observability.go

View check run for this annotation

Codecov / codecov/patch

observability/observability.go#L37

Added line #L37 was not covered by tests
Expand Down
1 change: 1 addition & 0 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 0289f32

Please sign in to comment.