DataDog / dd-trace-rb

Datadog Tracing Ruby Client
https://docs.datadoghq.com/tracing/
Other
310 stars 375 forks source link

Dont print DATADOG CONFIGURATION #3940

Open jshah opened 1 month ago

jshah commented 1 month ago

Hi, is there a way to not print the DATADOG CONFIGURATION on agent startup?

Here is an example of the log that gets printed:

I, [2024-09-23T18:03:39.258492 #40673]  INFO -- ddtrace: [ddtrace] DATADOG CONFIGURATION - CORE - {"date":"2024-09-23T18:03:39Z","os_name":"x86_64-pc-linux-gnu","version":"1.23.3","lang":"ruby","lang_version":"3.1.6","env":null,"service":"rails","dd_version":null,"debug":false,"tags":null,"runtime_metrics_enabled":false,"vm":"ruby-3.1.6","health_metrics_enabled":false,"profiling_enabled":false}
ivoanjo commented 1 month ago

Hey @jshah yes, there's a way! You can do it via environment variables:

$ DD_TRACE_STARTUP_LOGS=true bundle exec ruby -e "require 'datadog'; Datadog.configure {}"
I, [2024-09-24T10:42:29.681675 #76173]  INFO -- datadog: [datadog] DATADOG CONFIGURATION - CORE - {"date":"2024-09-24T09:42:29Z","os_name":"x86_64-pc-linux-gnu","version":"2.3.0","lang":"ruby","lang_version":"3.1.4","env":null,"service":"-e","dd_version":null,"debug":false,"tags":null,"runtime_metrics_enabled":false,"vm":"ruby-3.1.4","health_metrics_enabled":false,"profiling_enabled":false}

$ DD_TRACE_STARTUP_LOGS=false bundle exec ruby -e "require 'datadog'; Datadog.configure {}"
# (no output)

or via code:

$ bundle exec ruby -e "require 'datadog'; Datadog.configure { |c| c.diagnostics.startup_logs.enabled = false }"
# (no output)

Let me know if this works for you! :smiley: