Skip to content

Commit

Permalink
Add container id for otel/Datadog (#5357)
Browse files Browse the repository at this point in the history
  • Loading branch information
himadrisingh authored Jul 31, 2024
1 parent 964ef7a commit c345ac3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions runtime/pkg/observability/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ func Start(ctx context.Context, logger *zap.Logger, opts *Options) (ShutdownFunc
}))

// Create resource representing the currently running service
res, err := resource.Merge(
resource.Default(),
resource.NewWithAttributes(
semconv.SchemaURL,
res, err := resource.New(ctx,
resource.WithContainer(),
resource.WithSchemaURL(semconv.SchemaURL),
resource.WithAttributes(
semconv.ServiceName(opts.ServiceName),
semconv.ServiceVersion(opts.ServiceVersion),
),
resource.WithFromEnv(),
)
if err != nil {
return nil, err
Expand Down

0 comments on commit c345ac3

Please sign in to comment.