Open
Description
Expected Behavior
Using SetTag()
on a span after getting it from the context with tracer.SpanFromContext()
should add a tag to the span.
Actual Behavior
All default tags are there, but the added tag(s) aren't showing up.
Steps to Reproduce the Problem
- Have an AWS API Gateway + Lamba setup (with Datadog Lambda Extension)
- Wrap the handler with
lambda.StartWithOptions(ddlambda.WrapFunction(handler.Handler(), nil))
- Set a tag in the handler with:
return func(ctx context.Context, event events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
if span, ok := tracer.SpanFromContext(ctx); ok {
span.SetTag("hello", "world")
}
...
}
- Check APM. The traces appear (inferred API Gateway span + cold start span + lambda handler span), but the "hello world"-tag is missing.
Specifications
- Datadog Go Lambda package version: v1.19.0
- Go version: 1.23.2
- gopkg.in/DataDog/dd-trace-go.v1 v1.68.0
- Lambda Extension: v65
ENV Vars:
- DD_ENHANCED_METRICS: true
- DD_FETCH_LAMBDA_TAGS: true
- DD_FLUSH_TO_LOG: true
- DD_LOG_LEVEL: ERROR
- DD_SERVERLESS_LOGS_ENABLED: true
- DD_SITE: datadoghq.com
- DD_TRACE_ENABLED: true
A similar issue was reported a while ago: #124
Metadata
Metadata
Assignees
Labels
No labels