Skip to content

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

Closed
@g-farrow

Description

@g-farrow

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)

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