Skip to content
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

Values passed to lambda_metric of incorrect type do not raise an exception. #347

Open
aaron-csetter opened this issue Jul 6, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@aaron-csetter
Copy link

Expected Behavior

When a value passed to lambda_metric() is of an incorrect value or type (not something that can be sent as a metric), a TypeError or ValueError should be raised.

Actual Behavior

In the example below, neither call actually goes through and no exception is raised in the main thread. This makes debugging a nightmare.

Steps to Reproduce the Problem

@datadog_lambda_wrapper
def lambda_handler(lambda_event, _context):
    lambda_metric("should.work", 1)
    lambda_metric("should.raise.exception", "oops")

Specifications

  • Datadog Lambda Layer version: v73 and v75
  • Python version: 3.10

Stacktrace

I wish there was one.
@duncanista duncanista added the bug Something isn't working label Jan 10, 2024
@astuyve
Copy link
Contributor

astuyve commented Jan 30, 2024

We received a similar request here, and the answer will be similar here. We never want to cause a lambda function execution to halt, so raising a TypeError or ValueError will be incorrect here.

We are open to adding validation, ideally we'd do so at the agent level so that it would cover all runtimes. Presumably the correct response here would be to log an error? If we did this at the WARN level, would that seem appropriate?

Thanks!

@nhulston
Copy link
Contributor

Fixed in #553, will be out in the next release (v106)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants