You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
metric.flush_stats has an optional lambda_context argument, defaulting to None.
Omitting this argument shouldn't cause issues, and didn't in earlier versions of the library.
Actual Behavior
Exception thrown: builtins.UnboundLocalError: local variable 'tags' referenced before assignment
Steps to Reproduce the Problem
metric.flush_stats()
Specifications
Datadog Lambda Layer version: v6.98.0
Python version: 3.10
Stacktrace
Traceback (most recent call last):
[...]
File "/home/lambda/[...]", line 55, in send
flush_stats()
File "/home/lambda/datadog_lambda/metric.py", line 136, in flush_stats
extension_thread_stats.flush(tags)
UnboundLocalError: local variable 'tags' referenced before assignment
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @nr-synth, this is indeed a bug in the library. I'll get started working on a fix.
However, you shouldn't need to ever call this method manually yourself. The datadog wrapper will do it for you after each invocation. Are you calling this manually?
Thanks @purple4reina - I don't have the full context, best I can surmise is that we were using this function when locally testing Lambda code with Datadog.
Expected Behavior
metric.flush_stats
has an optionallambda_context
argument, defaulting toNone
.Omitting this argument shouldn't cause issues, and didn't in earlier versions of the library.
Actual Behavior
Exception thrown:
builtins.UnboundLocalError: local variable 'tags' referenced before assignment
Steps to Reproduce the Problem
metric.flush_stats()
Specifications
Stacktrace
The text was updated successfully, but these errors were encountered: