Skip to content

Conversation

@yiyuan-he
Copy link
Contributor

@yiyuan-he yiyuan-he commented Feb 10, 2025

Issue #, if available:
Lambda Topology issue -- PRs in other ADOT SDKs:

Description of changes:

  • Apply fix for the Lambda Topology issue. The logic mimics the fix in our other ADOT SDKs.
  • Adding AWS Resource support for Lambda.

Test plan:
Set up two Lambda functions with .NET runtimes and tested with custom Lambda layer with fix built-in. Below are screenshots of the topology for various configurations.

Screenshot 2025-02-07 at 11 48 51 AM

We observe the following correct behaviors for topology above:

  • Service entity node for Invoke call to downstream lambda.
  • AWS Resource node for GetFunction call to downstream lambda.
  • AWS Resource node for ListBuckets call to downstream s3.
Screenshot 2025-02-07 at 12 17 59 PM

We observe the following correct behaviors for topology above:

  • Downstream lambda called with Invoke is correctly treated as RemoteService entity when not instrumented

Screenshot 2025-02-07 at 1 53 30 PM

We observe the following correct behaviors for topology above:

  • Two different downstream Lambdas can be distinguished even if they are both RemoteService entity type nodes.

Validated that the correct trace is generated for lambda instrumentation patch. This trace is for GetFunction call.

Screenshot 2025-02-11 at 2 02 03 PM

I could not validate Invoke directly since the .NET sample app sends the traces to CloudWatch via EC2 instance which conflicts with the Lambda environment. However, the above Topology behaviors and EMF Logs are sufficient to confirm the intended behavior.

Invoke EMF Logs

{
    "Lambda.Function.Name": "lambdaA",
    "RemoteOperation": "Invoke",
    "RemoteEnvironment": "lambda:default",
    "Service": "lambdaA",
    ...
    "RemoteService": "lambdaB",
    "Telemetry.SDK": "opentelemetry,1.6.0.dev0-aws,dotnet,Auto",
    "Environment": "lambda:default",
    "aws.log.group.names": "/aws/lambda/lambdaA",
    "PlatformType": "AWS::Lambda"
}

GetFunction EMF Logs

{
    "Lambda.Function.Name": "lambdaA",
    "RemoteOperation": "GetFunction",
    "Service": "lambdaA",
    ...
    "RemoteService": "AWS::Lambda",
    "RemoteResourceIdentifier": "lambdaB",
    "Telemetry.SDK": "opentelemetry,1.6.0.dev0-aws,dotnet,Auto",
    "Environment": "lambda:default",
    "aws.log.group.names": "/aws/lambda/lambdaA",
    "PlatformType": "AWS::Lambda",
    "RemoteResourceType": "AWS::Lambda::Function"
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yiyuan-he yiyuan-he requested a review from a team as a code owner February 10, 2025 23:57
@yiyuan-he yiyuan-he changed the title Lambda topology fix [WIP] Lambda topology fix Feb 11, 2025
@yiyuan-he yiyuan-he changed the title Lambda topology fix Fix: Lambda Topology Issue Feb 11, 2025
@yiyuan-he yiyuan-he merged commit c63bad5 into aws-observability:main Feb 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants