Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 61b8668

Browse files
authoredAug 20, 2021
Add functionname attribute to span metadata (#89)
1 parent 80a7631 commit 61b8668

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
 

‎internal/trace/listener.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func startFunctionExecutionSpan(ctx context.Context, mergeXrayTraces bool) trace
119119
tracer.Tag("function_version", functionVersion),
120120
tracer.Tag("request_id", lambdaCtx.AwsRequestID),
121121
tracer.Tag("resource_names", lambdacontext.FunctionName),
122+
tracer.Tag("functionname", strings.ToLower(lambdacontext.FunctionName)),
122123
tracer.Tag("datadog_lambda", version.DDLambdaVersion),
123124
tracer.Tag("dd_trace", version.DDTraceVersion),
124125
)

‎internal/trace/listener_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func TestStartFunctionExecutionSpanFromXrayWithMergeEnabled(t *testing.T) {
8686
assert.Equal(t, "abcdefgh-1234-5678-1234-abcdefghijkl", finishedSpan.Tag("request_id"))
8787
assert.Equal(t, "MockFunctionName", finishedSpan.Tag("resource.name"))
8888
assert.Equal(t, "MockFunctionName", finishedSpan.Tag("resource_names"))
89+
assert.Equal(t, "mockfunctionname", finishedSpan.Tag("functionname"))
8990
assert.Equal(t, "serverless", finishedSpan.Tag("span.type"))
9091
assert.Equal(t, "xray", finishedSpan.Tag("_dd.parent_source"))
9192
}

0 commit comments

Comments
 (0)
Please sign in to comment.