Skip to content

Commit

Permalink
fix(tracing): set flusher in otellambda instrumentation (#292)
Browse files Browse the repository at this point in the history
This ensures we flush data prior to lambda freezing.
  • Loading branch information
jta authored May 31, 2024
1 parent fafdf55 commit 9ae98a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tracing/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ import (
"github.com/aws/aws-lambda-go/lambda"
"go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda"
"go.opentelemetry.io/otel/attribute"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/trace"
)

var payloadKey = attribute.Key("payload")

func NewLambdaHandler(handler lambda.Handler, tp trace.TracerProvider) lambda.Handler {
func NewLambdaHandler(handler lambda.Handler, tp *sdktrace.TracerProvider) lambda.Handler {
return otellambda.WrapHandler(
&LambdaHandler{handler},
otellambda.WithTracerProvider(tp),
otellambda.WithFlusher(tp),
)
}

Expand Down

0 comments on commit 9ae98a0

Please sign in to comment.