From 4b0a7afa0b1240946780d5a905aeeaf11e6f621a Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 13 Jan 2025 13:58:38 -0500 Subject: [PATCH] condition initialization --- .../apps/rails-five/config/initializers/datadog.rb | 8 +++++--- .../apps/rails-seven/config/initializers/datadog.rb | 8 +++++--- integration/apps/rails-six/config/initializers/datadog.rb | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/integration/apps/rails-five/config/initializers/datadog.rb b/integration/apps/rails-five/config/initializers/datadog.rb index cfc4400b09a..8b8f91c1a67 100644 --- a/integration/apps/rails-five/config/initializers/datadog.rb +++ b/integration/apps/rails-five/config/initializers/datadog.rb @@ -29,7 +29,9 @@ end end - c.remote.enabled = true - c.dynamic_instrumentation.enabled = true - c.dynamic_instrumentation.internal.development = true + if c.respond_to?(:dynamic_instrumentation) + c.remote.enabled = true + c.dynamic_instrumentation.enabled = true + c.dynamic_instrumentation.internal.development = true + end end diff --git a/integration/apps/rails-seven/config/initializers/datadog.rb b/integration/apps/rails-seven/config/initializers/datadog.rb index 920cc4268b5..d2749049b11 100644 --- a/integration/apps/rails-seven/config/initializers/datadog.rb +++ b/integration/apps/rails-seven/config/initializers/datadog.rb @@ -26,7 +26,9 @@ c.profiling.exporter.transport = Datadog::DemoEnv.profiler_file_transport end - c.remote.enabled = true - c.dynamic_instrumentation.enabled = true - c.dynamic_instrumentation.internal.development = true + if c.respond_to?(:dynamic_instrumentation) + c.remote.enabled = true + c.dynamic_instrumentation.enabled = true + c.dynamic_instrumentation.internal.development = true + end end diff --git a/integration/apps/rails-six/config/initializers/datadog.rb b/integration/apps/rails-six/config/initializers/datadog.rb index ac936302752..4a323bb6be1 100644 --- a/integration/apps/rails-six/config/initializers/datadog.rb +++ b/integration/apps/rails-six/config/initializers/datadog.rb @@ -29,7 +29,9 @@ end end - c.remote.enabled = true - c.dynamic_instrumentation.enabled = true - c.dynamic_instrumentation.internal.development = true + if c.respond_to?(:dynamic_instrumentation) + c.remote.enabled = true + c.dynamic_instrumentation.enabled = true + c.dynamic_instrumentation.internal.development = true + end end