Skip to content

AttributeError: 'StatsDWrapper' object has no attribute '_get_aggregate_metrics_and_dists' #139

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
g-farrow opened this issue May 9, 2021 · 1 comment · Fixed by #140

Comments

@g-farrow
Copy link

g-farrow commented May 9, 2021

Expected Behavior

The lambda runs without error logs

Actual Behavior

DataDog Python code is throwing the following exception:

Traceback (most recent call last):
  File "/opt/python/lib/python3.8/site-packages/datadog_lambda/wrapper.py", line 180, in _after
    flush_thread_stats()
  File "/opt/python/lib/python3.8/site-packages/datadog_lambda/metric.py", line 100, in flush_thread_stats
    _, dists = lambda_stats._get_aggregate_metrics_and_dists(float("inf"))
AttributeError: 'StatsDWrapper' object has no attribute '_get_aggregate_metrics_and_dists'

Steps to Reproduce the Problem

  1. Using the Datadog-Extension v7 and Datadog-Python38 v36 - also using AWS Lambda Powertools' Logger and Tracer
  2. When the Lambda is invoked, the above exception is thrown immediately
  3. The lambda code appears to then run correctly - however, its not clear if the DataDog stats and logs are gathered properly

Specifications

  • Datadog Lambda Layer version: 36
  • Python version: 3.8
  • AWS Powertools Logger and Tracer (v1.15.0)
@DarcyRaynerDD
Copy link
Contributor

Hi @g-farrow. Thanks for the report. This looks like a recent regression with the python layer and our preview extension. I'm taking a look now, but I believe this change was introduced in v36. We're going to try and get a fix out for this as soon as possible.

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 a pull request may close this issue.

2 participants