Skip to content

AwsLambdaInstrumentor doesn't handle function exception, inconsistently flushes trace/metrics #2246

@tammy-baylis-swi

Description

@tammy-baylis-swi

Describe your environment

Steps to reproduce
I built an Otel Python lambda layer using contents of this repo's main branch. I equipped an AWS Lambda function with this layer, then I invoked to immediately raise Exception. A local instance of Otel Collector exporting to console/logging/debug received traces from the function sometimes and never received some custom metrics.

What is the expected behavior?
All traces and any custom metrics should be generated and exported, even if lambda function raises exception.

Some of the other instrumentors handle exceptions and adjust + still report telemetry. For example: requests, asgi (via try-except to set attributes and finally to export telemetry).

What is the actual behavior?
Some traces and no custom metrics are exported when lambda function raises exception.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions