Skip to content

[bug] Lambda integration fails if no InvokedFunctionArn present #2445

Description

@Dreamescaper

Component

OpenTelemetry.Instrumentation.AWSLambda

Package Version

Package Name Version
OpenTelemetry.Instrumentation.AWSLambda 1.10.0-beta.3

Runtime Version

net8.0

Description

When I invoke lambda function locally during testing, providing an empty LambdaContext, it fails with the following error:

Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at OpenTelemetry.Instrumentation.AWSLambda.Implementation.AWSLambdaUtils.GetFaasId(String functionArn)
   at OpenTelemetry.Instrumentation.AWSLambda.Implementation.AWSLambdaUtils.GetFunctionTags[TInput](TInput input, ILambdaContext context, Boolean isColdStart)
   at OpenTelemetry.Instrumentation.AWSLambda.AWSLambdaWrapper.OnFunctionStart[TInput](TInput input, ILambdaContext context, ActivityContext parentContext)
   at OpenTelemetry.Instrumentation.AWSLambda.AWSLambdaWrapper.TraceInternalAsync[TInput,TResult](TracerProvider tracerProvider, Func`3 handlerAsync, TInput input, ILambdaContext context, ActivityContext parentContext)

Additional Context

I realize that it is not nessesseraly a bug, and I probably should add values there. But it didn't happen with 1.10.0-beta.1, and I can see that other methods (apart from GetFaasId, like GetAccountId) do check for functionArn nullabilty, so it probably should happen here as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomp:instrumentation.awslambdaThings related to OpenTelemetry.Instrumentation.AWSLambda

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions