DataDog / datadog-lambda-extension

Datadog Lambda Extension
Apache License 2.0
77 stars 4 forks source link

Add configuration option to allow disabling Datadog extension/agent's own verbose logs #334

Open clocked0ne opened 3 months ago

clocked0ne commented 3 months ago

Our logs are flooded with these kinds of messages:

DEBUG   {"status":"debug","message":"datadog:Finishing inferred span"}
DEBUG   {"status":"debug","message":"datadog:Discarding Xray metadata subsegment due to sampling"}
DEBUG   {"status":"debug","message":"datadog:Reading Xray trace context from env var ..."}
DEBUG   {"status":"debug","message":"datadog:Flushing statsD"}

I've set up exclusion filters to try and filter these out, which is what Datadog support themselves recommended, but it doesn't seem to work consistently and doesn't seem like the logical way to do this.

I also don't want to change the logLevel configuration setting as my understanding is that this will affect other logs and not just the Extension/Agent's logs; perhaps this needs better documentation?

A configuration option such as verboseLogging: false to switch off generation of these log entries would be ideal.

purple4reina commented 2 months ago

You should be able to adjust the logLevel without it affecting anything but the extension and tracer logging. If using environment variables, this would mean removing the DD_LOG_LEVEL environment variable.