diff --git a/.gitlab/prepare-oci-package.sh b/.gitlab/prepare-oci-package.sh index d542c2ca78b..c616c3e1f97 100755 --- a/.gitlab/prepare-oci-package.sh +++ b/.gitlab/prepare-oci-package.sh @@ -5,10 +5,11 @@ set -e mkdir sources cp ../lib-injection/host_inject.rb sources -sed -i "s#/opt/datadog/apm/library/ruby/#/opt/datadog-packages/datadog-apm-library-ruby/$RUBY_PACKAGE_VERSION/#g" sources/host_inject.rb - # Kubernetes injection expects a different path -cp sources/host_inject.rb source/auto_inject.rb +cp sources/host_inject.rb sources/auto_inject.rb + +sed -i "s#PATH_PLACEHOLDER#/opt/datadog-packages/datadog-apm-library-ruby/${RUBY_PACKAGE_VERSION}#g" sources/host_inject.rb +sed -i "s#PATH_PLACEHOLDER#/datadog-lib#g" sources/auto_inject.rb cp -r ../tmp/${ARCH}/* sources diff --git a/lib-injection/host_inject.rb b/lib-injection/host_inject.rb index 1f1b56a6837..7e516cb344a 100644 --- a/lib-injection/host_inject.rb +++ b/lib-injection/host_inject.rb @@ -26,8 +26,10 @@ def dd_skip_injection! def dd_send_telemetry(events) pid = Process.respond_to?(:pid) ? Process.pid : 0 # Not available on all platforms - tracer_version = if File.exist?('/opt/datadog/apm/library/ruby/version.txt') - File.read('/opt/datadog/apm/library/ruby/version.txt').chomp + tracer_version = if File.exist?('PATH_PLACEHOLDER/version.txt') + File.read('PATH_PLACEHOLDER/version.txt').chomp + elsif File.exist?('PATH_PLACEHOLDER/version') + File.read('PATH_PLACEHOLDER/version').chomp else 'unknown' end @@ -58,7 +60,7 @@ def dd_send_telemetry(events) major, minor, = RUBY_VERSION.split('.') ruby_api_version = "#{major}.#{minor}.0" - dd_lib_injection_path = "/opt/datadog/apm/library/ruby/#{ruby_api_version}" + dd_lib_injection_path = "PATH_PLACEHOLDER/#{ruby_api_version}" dd_debug_log "Loading from #{dd_lib_injection_path}..." supported_ruby_api_versions = ['2.7.0', '3.0.0', '3.1.0', '3.2.0'].freeze