Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
annisall opened this issue Apr 22, 2021 · 2 comments

Comments

@annisall
Copy link

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
@DylanLovesCoffee
Copy link
Contributor

Hey @annisall, thanks for raising the issue. I was able to reproduce this with v3.33.0 when I have DD_TRACE_ENABLED=false. We'll keep digging into this.

@DylanLovesCoffee
Copy link
Contributor

👋 @annisall I just released a new version of the Layer and serverless plugin which has the fix for this. Thanks again for reporting!

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

No branches or pull requests

2 participants