You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
customize aws lambda instrumentation to span kind always be SERVER (#286)
*Issue #, if available:*
In OpenTelemetry Python contrib, datadog set the Lambda handler span
kind to be CONSUMER if the Lambda invocation is triggered by
SNS/SQS/DDB, but actually that logic should be applied to Lambda Service
span. The Lambda handler span should be always SERVER since it is
triggered by Lambda Service.
*Description of changes:*
Update the span kind of Lambda handler span to be SERVER from ADOT SDK
repo.
After this change, the Lambda handler segment name looks normal
```
{
"Id": "5da4657e70beac54",
"Document": {
"id": "5da4657e70beac54",
"name": "snsSubscriber",
"start_time": 1730158477.6370573,
"trace_id": "1-67201f8d-4cf059993c2b913f2127f7da",
"end_time": 1730158478.2419734,
"parent_id": "b00ba984da7fd16f",
"aws": {
"span.kind": "LOCAL_ROOT",
"log.group.names": "/aws/lambda/snsSubscriber"
},
"annotations": {
"aws.local.service": "snsSubscriber",
"span.name": "lambda_function.lambda_handler",
"aws.local.operation": "snsSubscriber/FunctionHandler",
"span.kind": "SERVER",
"aws.local.environment": "lambda:default"
},
"metadata": {
"cloud.region": "us-west-1",
"service.name": "snsSubscriber",
"faas.name": "snsSubscriber",
"telemetry.sdk.name": "opentelemetry",
"aws.span.kind": "LOCAL_ROOT",
"telemetry.sdk.language": "python",
"cloud.provider": "aws",
"faas.invocation_id": "c8aff945-7d0a-472a-9785-97763944efbf",
"cloud.account.id": "816069141447",
"cloud.resource_id": "arn:aws:lambda:us-west-1:816069141447:function:snsSubscriber",
"faas.instance": "2024/10/28/[$LATEST]88c0a736ba8d42bab162aa3a25180f73",
"aws.log.group.names": "/aws/lambda/snsSubscriber",
"telemetry.sdk.version": "1.27.0",
"faas.version": "$LATEST",
"PlatformType": "AWS::Lambda",
"telemetry.auto.version": "0.6.0.dev0-aws"
},
```
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
0 commit comments