[Prod] Change how Datadog is enabled

This works fine here (filled in through dockers .env injection)
but on prod the application doesn't know about the API key
This commit is contained in:
Earlopain 2024-04-09 20:52:33 +02:00
parent 0b47770c49
commit f328836895
No known key found for this signature in database
GPG Key ID: 48860312319ADF61
2 changed files with 2 additions and 1 deletions

View File

@ -71,6 +71,7 @@
# Required:
# DD_API_KEY=
# DD_ENABLE=true
#
# Optional:
# DD_SITE=us5.datadoghq.com

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
Datadog.configure do |c|
c.tracing.enabled = !Rails.env.test? && ENV["DD_API_KEY"].present?
c.tracing.enabled = !Rails.env.test? && ENV["DD_ENABLE"] == "true"
c.logger.level = Logger::WARN
c.tracing.instrument :rack, quantize: {