DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
109 stars 35 forks source link

fix: block forbidden chars from metric names #460

Closed dotkas closed 7 months ago

dotkas commented 8 months ago

What does this PR do?

Block calling metric functions with names that will cause datadog-agent to fail.

Motivation

I should probably have known better, but it took me a merged PR all the way to prod and an error message in DataDog Serverless before I realized my code didn't work, and a clone of datadog-agent Go code to realize what I'd messed up. So I figured this could help other people.

Testing Guidelines

I added a new Jest case.

Additional Notes

I guess this is technically a breaking change. But if anybody would be affected by it we'd really be doing them a favor here as they would still have errors in their logs, only further down the pipeline. 🤷🏻

Types of Changes

Check all that apply

dotkas commented 7 months ago