Skip to content

TypeError: trace_id must be an integer occurs when multiple SQS messages to process #134

Closed
@annisall

Description

@annisall

I have a lambda that is triggered by SQS. When there are multiple SQS messages to be processed, I can see that there's TypeError: trace_id must be an integer in the logs and no metrics is sent to DataDog.

Expected Behavior

Metrics are sent to DataDog without any errors.

Actual Behavior

TypeError mentioned above is raised and no metrics are sent to datadog.

Steps to Reproduce the Problem

  1. Create a SQS queue and lambda that it triggers
  2. Add multiple messages to SQS queue
  3. Check the logs in Cloudwatch and search for the error

Specifications

  • Datadog Lambda Layer version: dd_lambda_layer:datadog-python38_3.33.0
  • Python version: 3.8.0

I tested with 3.33.0, 3.32.0 and 2.30.0. Both 3.33.0 and 3.32.0 had this problem, but with 2.30.0 the error didn't occur and data was sent to DataDog.

Stacktrace

File "/opt/python/datadog_lambda/wrapper.py", line 161, in _before
set_correlation_ids()
File "/opt/python/datadog_lambda/tracing.py", line 297, in set_correlation_ids
span = tracer.trace("dummy.span")
File "/opt/python/ddtrace/tracer.py", line 626, in trace
return self.start_span(
File "/opt/python/ddtrace/tracer.py", line 427, in start_span
span = Span(
File "/opt/python/ddtrace/span.py", line 114, in __init__
raise TypeError("trace_id must be an integer")
TypeError: trace_id must be an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions