From e090ee6a045f51838a160368dffa3db4a085ce45 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 16 Sep 2024 15:24:56 +0200 Subject: [PATCH] Add SSI entry point --- lib-injection/host_inject.rb | 2 +- lib/datadog/single_step_instrument.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lib/datadog/single_step_instrument.rb diff --git a/lib-injection/host_inject.rb b/lib-injection/host_inject.rb index 8baf5e18293..6583f8c4536 100644 --- a/lib-injection/host_inject.rb +++ b/lib-injection/host_inject.rb @@ -197,7 +197,7 @@ def bundler_supported? bundle_add_cmd = "bundle add #{gem} --skip-install --version #{gem_version_mapping[gem]} " bundle_add_cmd << ' --verbose ' if ENV['DD_TRACE_DEBUG'] == 'true' - bundle_add_cmd << '--require datadog/auto_instrument' if gem == 'datadog' + bundle_add_cmd << '--require datadog/single_step_instrument' if gem == 'datadog' utils.debug "Injection with `#{bundle_add_cmd}`" diff --git a/lib/datadog/single_step_instrument.rb b/lib/datadog/single_step_instrument.rb new file mode 100644 index 00000000000..c0f8288ce1c --- /dev/null +++ b/lib/datadog/single_step_instrument.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# +# Entrypoint file for single step instrumentation. +# +# This file's path is private. Do not reference this file. +# +begin + require_relative 'auto_instrument' + + module Datadog + module SingleStepInstrument + LOADED = true + end + end +rescue StandardError, LoadError => e + $stderr.warn "Single step instrumentation failed: #{e.class}, #{e.message}" +end