DataDog / serverless-plugin-datadog

Serverless plugin to automagically instrument your Lambda functions with Datadog
Apache License 2.0
96 stars 49 forks source link

No trace sampling option available #544

Closed christophasam closed 1 month ago

christophasam commented 1 month ago

Expected Behavior

DD_TRACE_SAMPLE_RATE or corresponding serverless configuration is available / supported and the sampling rate can be adjusted.

Actual Behavior

DD_TRACE_SAMPLE_RATE is not taken in consideration, even if it's set

Steps to Reproduce the Problem

  1. add an env variable DD_TRACE_SAMPLE_RATE = 0.01 to your serverless config and deploy it
  2. check Datadog if the traces are sampled

Specifications

purple4reina commented 1 month ago

Hi @christophasam, v5.4.0 of the plugin is over two years old. Would you mind updating to the latest version v5.72.0 and trying again? Let me know if that works, because this feature should definitely be implemented already.

purple4reina commented 1 month ago

Ah, nevermind, I found your problem.

Image

Note: The use of DD_TRACE_SAMPLE_RATE is deprecated. Use DD_TRACE_SAMPLING_RULES instead. For instance, if you already set DD_TRACE_SAMPLE_RATE to 0.1, set DD_TRACE_SAMPLING_RULES to [{"sample_rate":0.1}] instead.