DataDog / datadog-lambda-js

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

Fix disabling of cold start tracing #370

Closed henrist closed 1 year ago

henrist commented 1 year ago

What does this PR do?

Fixes so that cold start tracing can be disabled as documented.

The value from getEnvValue is a string, and unless this is a blank string it will always be truthy, even when the value is "false".

Use the similar pattern as used in the config section.

Motivation

I've tested out provisioned concurrency, but this makes tracing very inconvenient to use as it might generate traces that lasts for a very long time (so a 50 ms lambda might show a trace for 1h+). I wanted to disable cold start tracing to avoid those cases.

Ideally, maybe cold starts outside an invocation (as for provisioned concurrency), should not be included by default, but cold starts that took place during an invocation should be included.

Testing Guidelines

Additional Notes

Types of Changes

Check all that apply

codecov-commenter commented 1 year ago

Codecov Report

Merging #370 (545e4b8) into main (76021dc) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 545e4b8 differs from pull request most recent head 9a0dcd2. Consider uploading reports for the commit 9a0dcd2 to get more accurate results

@@           Coverage Diff           @@
##             main     #370   +/-   ##
=======================================
  Coverage   80.60%   80.60%           
=======================================
  Files          38       38           
  Lines        1903     1903           
  Branches      439      439           
=======================================
  Hits         1534     1534           
  Misses        313      313           
  Partials       56       56           
Impacted Files Coverage Δ
src/index.ts 87.59% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more