diff --git a/deployments/chef/CHANGELOG.md b/deployments/chef/CHANGELOG.md index 8fcb183963..edbcbafc73 100644 --- a/deployments/chef/CHANGELOG.md +++ b/deployments/chef/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## chef-v0.17.0 + +- Remove the option `with_signalfx_dotnet_auto_instrumentation` used to +install the deprecated +[SignalFx Auto Instrumentation for .NET]( +https://docs.splunk.com/Observability/gdi/get-data-in/application/dotnet/get-started.html) +on Windows. + ## chef-v0.16.0 - Add support for the `auto_instrumentation_logs_exporter` option to configure the `OTEL_LOGS_EXPORTER` environment variable. diff --git a/deployments/chef/README.md b/deployments/chef/README.md index 6f0fb157c4..69200e11ae 100644 --- a/deployments/chef/README.md +++ b/deployments/chef/README.md @@ -299,136 +299,11 @@ after installation/configuration in order for any change to take effect. (**default:** `''`, i.e. defer to the default `OTEL_LOGS_EXPORTER` value for each activated SDK) -### Auto Instrumentation for .NET on Windows - -***Warning:*** The `Environment` property in the -`HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC` registry key will -be overwritten by the options specified below to enable/configure auto -instrumentation for IIS. Use the -`signalfx_dotnet_auto_instrumentation_additional_options` option (see below for -details) to include any other environment variables required for IIS. - -**Note:** By default, IIS will be restarted with the `iisreset` command (if it -exists) after installation/configuration. Applications ***not*** running within -IIS need to be restarted/managed separately in order for any changes to take -effect. - -- `with_signalfx_dotnet_auto_instrumentation` (Windows only): Whether to - install/manage [SignalFx Auto Instrumentation for .NET]( - https://docs.splunk.com/Observability/gdi/get-data-in/application/dotnet/get-started.html). - When set to `true`, the `signalfx-dotnet-tracing` MSI package will be - downloaded and installed, and the Windows registry will be updated based on - the options below. (**default:** `false`) - -- `signalfx_dotnet_auto_instrumentation_version` (Windows only): Version of the - `signalfx-dotnet-tracing` MSI package to download and install from - [GitHub Releases](https://github.com/signalfx/signalfx-dotnet-tracing/releases). - (**default:** `1.1.0`) - -- `signalfx_dotnet_auto_instrumentation_msi_url` (Windows only): Specify the - URL to download the MSI from a custom host, for example - `https://my.host/signalfx-dotnet-tracing-1.0.0-x64.msi`. If specified, the - `signalfx_dotnet_auto_instrumentation_version` option is ignored. - (**default:** `https://github.com/signalfx/signalfx-dotnet-tracing/releases/download/v{{ signalfx_dotnet_auto_instrumentation_version }}/signalfx-dotnet-tracing-{{ signalfx_dotnet_auto_instrumentation_version }}-x64.msi`) - -- `signalfx_dotnet_auto_instrumentation_iisreset` (Windows only): By default, - the `iisreset.exe` command (if it exists) will be executed after - installation/configuration in order for any changes to take effect for IIS - applications. Set this option to `false` to skip this step if IIS is managed - separately or is not applicable. (**default:** `true`) - -- `signalfx_dotnet_auto_instrumentation_system_wide` (Windows only): By - default, the `Environment` property in the - `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC` registry key - will be configured for the following environment variables and any from the - `signalfx_dotnet_auto_instrumentation_additional_options` option to - enable/configure auto instrumentation for ***only*** IIS applications: - ```yaml - COR_ENABLE_PROFILING: true # Required - COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required - CORECLR_ENABLE_PROFILING: true # Required - CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required - SIGNALFX_ENV: "{{ signalfx_dotnet_auto_instrumentation_environment }}" - SIGNALFX_PROFILER_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler }}" - SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler_memory }}" - SIGNALFX_SERVICE_NAME: "{{ signalfx_dotnet_auto_instrumentation_service_name }}" - ``` - Set this option to `true` to also add these environment variables and any - from the `signalfx_dotnet_auto_instrumentation_additional_options` option to - the - `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment` - registry key to enable/configure auto instrumentation for ***all*** .NET - applications on the node. (**default:** `false`) - -- `signalfx_dotnet_auto_instrumentation_environment` (Windows only): Configure - this option to set the "Environment" value to be reported to Splunk APM, for - example `production`. The value is assigned to the `SIGNALFX_ENV` environment - variable in the Windows registry (**default:** `''`, i.e. the "Environment" - will appear as `unknown` in Splunk APM for the instrumented - service/application) - -- `signalfx_dotnet_auto_instrumentation_service_name` (Windows only): Configure - this variable to override the [auto-generated service name]( - https://docs.splunk.com/Observability/gdi/get-data-in/application/dotnet/configuration/advanced-dotnet-configuration.html#changing-the-default-service-name) - for the instrumented service/application, for example `my-service-name`. The - value is assigned to the `SIGNALFX_SERVICE_NAME` environment variable in the - Windows registry. (**default:** `''`) - -- `signalfx_dotnet_auto_instrumentation_enable_profiler` (Windows only): Set - this option to `true` to enable AlwaysOn Profiling. The value will be - assigned to the `SIGNALFX_PROFILER_ENABLED` environment variable in the - Windows registry. (**default:** `false`) - -- `signalfx_dotnet_auto_instrumentation_enable_profiler_memory` (Windows only): - Set this option to `true` to enable AlwaysOn Memory Profiling. The value will - be assigned to the `SIGNALFX_PROFILER_MEMORY_ENABLED` environment variable in - the Windows registry. (**default:** `false`) - -- `signalfx_dotnet_auto_instrumentation_additional_options` (Windows only): - Hash of additional options to be added to the Windows registry - ***in addition*** to the options above. (**default:** `{}`) - - For example: - ```yaml - signalfx_dotnet_auto_instrumentation_additional_options: { - 'SIGNALFX_VERSION': '1.2.3', - 'SIGNALFX_FILE_LOG_ENABLED': false, - # Hint: If the signalfx_dotnet_auto_instrumentation_system_wide option is - # set to true, all .NET applications on the node will be instrumented. Use - # the following options to include/exclude processes from auto - # instrumentation. - 'SIGNALFX_PROFILER_PROCESSES': 'MyApp.exe;dotnet.exe', - 'SIGNALFX_PROFILER_EXCLUDE_PROCESSES': 'ReservedProcess.exe;powershell.exe', - } - ``` - Check the [Advanced Configuration Guide]( - https://docs.splunk.com/Observability/gdi/get-data-in/application/dotnet/configuration/advanced-dotnet-configuration.html) - for more details about the options above and other supported options. - -To uninstall the `signalfx-dotnet-tracing` MSI and disable auto -instrumentation, include the following in your recipe and restart all -applicable services: -``` -windows_package 'SignalFx .NET Tracing 64-bit' do - action :remove -end - -# If the "signalfx_dotnet_auto_instrumentation_system_wide" option was set to -# "true", include the following to remove the values from the -# "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" -# registry key: - -registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' do - values [ - { name: 'COR_ENABLE_PROFILING', type: :string, data: '' }, - { name: 'COR_PROFILER', type: :string, data: '' }, - { name: 'CORECLR_ENABLE_PROFILING', type: :string, data: '' }, - { name: 'CORECLR_PROFILER', type: :string, data: '' }, - { name: 'SIGNALFX_ENV', type: :string, data: '' }, - { name: 'SIGNALFX_PROFILER_ENABLED', type: :string, data: '' }, - { name: 'SIGNALFX_PROFILER_MEMORY_ENABLED', type: :string, data: '' }, - { name: 'SIGNALFX_SERVICE_NAME', type: :string, data: '' }, - ] - action :delete -end -``` +### SignalFx Auto Instrumentation for .NET on Windows + +The option to install the [SignalFx Auto Instrumentation for .NET]( +https://docs.splunk.com/Observability/gdi/get-data-in/application/dotnet/get-started.html) +`with_signalfx_dotnet_auto_instrumentation` is deprecated and +will have no effect after release `0.16.0`. +Install the [Splunk Distribution of OpenTelemetry .NET](https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-dotnet/get-started.html#instrument-net-applications-for-splunk-observability-cloud-opentelemetry) +instead. diff --git a/deployments/chef/attributes/default.rb b/deployments/chef/attributes/default.rb index 0eb3c71db1..b74e79c3f8 100644 --- a/deployments/chef/attributes/default.rb +++ b/deployments/chef/attributes/default.rb @@ -50,21 +50,6 @@ default['splunk_otel_collector']['fluentd_config_dest'] = "#{ENV['SystemDrive']}\\opt\\td-agent\\etc\\td-agent\\td-agent.conf" default['splunk_otel_collector']['fluentd_version_file'] = "#{collector_install_dir}\\fluentd_version.txt" - default['splunk_otel_collector']['with_signalfx_dotnet_auto_instrumentation'] = false - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_version'] = '1.1.0' - - signalfx_dotnet_base_url = 'https://github.com/signalfx/signalfx-dotnet-tracing/releases/download' - signalfx_dotnet_version = node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_version'].sub(/^v/, '') - signalfx_dotnet_msi_name = "signalfx-dotnet-tracing-#{signalfx_dotnet_version}-x64.msi" - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_msi_url'] = "#{signalfx_dotnet_base_url}/v#{signalfx_dotnet_version}/#{signalfx_dotnet_msi_name}" - - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_iisreset'] = true - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_system_wide'] = false - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_environment'] = '' - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_service_name'] = '' - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_enable_profiler'] = false - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_enable_profiler_memory'] = false - default['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_additional_options'] = {} elsif platform_family?('debian', 'rhel', 'amazon', 'suse') default['splunk_otel_collector']['collector_version'] = 'latest' diff --git a/deployments/chef/kitchen.windows.yml b/deployments/chef/kitchen.windows.yml index aaeb27e5ee..6b9bed7d15 100644 --- a/deployments/chef/kitchen.windows.yml +++ b/deployments/chef/kitchen.windows.yml @@ -64,39 +64,3 @@ suites: name: shell remote_exec: true command: inspec exec custom_vars/test.rb - - - name: with_default_windows_dotnet_instrumentation - run_list: - - recipe[splunk_otel_collector] - attributes: - splunk_otel_collector: - splunk_access_token: testing123 - splunk_realm: test - with_signalfx_dotnet_auto_instrumentation: true - verifier: - name: shell - remote_exec: true - command: inspec exec with_default_windows_dotnet_instrumentation/test.rb - - - name: with_custom_windows_dotnet_instrumentation - run_list: - - recipe[splunk_otel_collector] - attributes: - splunk_otel_collector: - splunk_access_token: testing123 - splunk_realm: test - with_signalfx_dotnet_auto_instrumentation: true - signalfx_dotnet_auto_instrumentation_iisreset: false - signalfx_dotnet_auto_instrumentation_version: 1.0.0 - signalfx_dotnet_auto_instrumentation_system_wide: true - signalfx_dotnet_auto_instrumentation_environment: test-env - signalfx_dotnet_auto_instrumentation_service_name: test-service - signalfx_dotnet_auto_instrumentation_enable_profiler: true - signalfx_dotnet_auto_instrumentation_enable_profiler_memory: true - signalfx_dotnet_auto_instrumentation_additional_options: - MY_CUSTOM_OPTION1: value1 - MY_CUSTOM_OPTION2: value2 - verifier: - name: shell - remote_exec: true - command: inspec exec with_custom_windows_dotnet_instrumentation/test.rb diff --git a/deployments/chef/recipes/default.rb b/deployments/chef/recipes/default.rb index 442a5ba119..3de4676c37 100644 --- a/deployments/chef/recipes/default.rb +++ b/deployments/chef/recipes/default.rb @@ -42,10 +42,6 @@ if node['splunk_otel_collector']['with_fluentd'].to_s.downcase == 'true' include_recipe 'splunk_otel_collector::fluentd_win_install' end - - if node['splunk_otel_collector']['with_signalfx_dotnet_auto_instrumentation'].to_s.downcase == 'true' - include_recipe 'splunk_otel_collector::dotnet_instrumentation_win_install' - end elsif platform_family?('debian', 'rhel', 'amazon', 'suse') if platform_family?('debian') package %w(apt-transport-https gnupg) diff --git a/deployments/chef/recipes/dotnet_instrumentation_win_install.rb b/deployments/chef/recipes/dotnet_instrumentation_win_install.rb deleted file mode 100644 index f2b254aaa7..0000000000 --- a/deployments/chef/recipes/dotnet_instrumentation_win_install.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Cookbook:: splunk_otel_collector -# Recipe:: dotnet_instrumentation_win_install - -dotnet_instrumentation_env_vars = [ - { name: 'COR_ENABLE_PROFILING', type: :string, data: 'true' }, - { name: 'COR_PROFILER', type: :string, data: '{B4C89B0F-9908-4F73-9F59-0D77C5A06874}' }, - { name: 'CORECLR_ENABLE_PROFILING', type: :string, data: 'true' }, - { name: 'CORECLR_PROFILER', type: :string, data: '{B4C89B0F-9908-4F73-9F59-0D77C5A06874}' }, - { name: 'SIGNALFX_ENV', type: :string, data: node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_environment'].to_s }, - { name: 'SIGNALFX_PROFILER_ENABLED', type: :string, data: node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_enable_profiler'].to_s.downcase }, - { name: 'SIGNALFX_PROFILER_MEMORY_ENABLED', type: :string, data: node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_enable_profiler_memory'].to_s.downcase }, - { name: 'SIGNALFX_SERVICE_NAME', type: :string, data: node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_service_name'].to_s }, -] - -node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_additional_options'].each do |key, value| - dotnet_instrumentation_env_vars.push({ name: key, type: :string, data: value.to_s }) -end - -iis_env_vars = [] -dotnet_instrumentation_env_vars.each do |item| - iis_env_vars |= [ "#{item[:name]}=#{item[:data]}" ] -end - -msi_name = node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_msi_url'].split('/')[-1] -msi_path = "#{ENV['TEMP']}\\#{msi_name}" - -remote_file msi_path do - source node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_msi_url'] - action :create -end - -windows_package 'SignalFx .NET Tracing 64-bit' do - source msi_path - action :install - notifies :run, 'powershell_script[iisreset]', :delayed -end - -registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC' do - values [{ - name: 'Environment', - type: :multi_string, - data: iis_env_vars, - }] - action :create - notifies :run, 'powershell_script[iisreset]', :delayed -end - -registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' do - values dotnet_instrumentation_env_vars - action :create - notifies :run, 'powershell_script[iisreset]', :delayed - only_if { node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_system_wide'].to_s.downcase == 'true' } -end - -powershell_script 'iisreset' do - code <<-EOH - try { - Get-Command iisreset.exe - } Catch { - Exit - } - & { iisreset.exe } - EOH - action :nothing - only_if { node['splunk_otel_collector']['signalfx_dotnet_auto_instrumentation_iisreset'].to_s.downcase == 'true' } -end diff --git a/deployments/chef/test/integration/with_custom_windows_dotnet_instrumentation/test.rb b/deployments/chef/test/integration/with_custom_windows_dotnet_instrumentation/test.rb deleted file mode 100644 index 0bc27d97e4..0000000000 --- a/deployments/chef/test/integration/with_custom_windows_dotnet_instrumentation/test.rb +++ /dev/null @@ -1,38 +0,0 @@ -describe service('splunk-otel-collector') do - it { should be_enabled } - it { should be_running } -end - -describe service('fluentdwinsvc') do - it { should_not be_enabled } - it { should_not be_running } -end - -dotnet_instrumentation_env_vars = [ - { name: 'COR_ENABLE_PROFILING', type: :string, data: 'true' }, - { name: 'COR_PROFILER', type: :string, data: '{B4C89B0F-9908-4F73-9F59-0D77C5A06874}' }, - { name: 'CORECLR_ENABLE_PROFILING', type: :string, data: 'true' }, - { name: 'CORECLR_PROFILER', type: :string, data: '{B4C89B0F-9908-4F73-9F59-0D77C5A06874}' }, - { name: 'SIGNALFX_ENV', type: :string, data: 'test-env' }, - { name: 'SIGNALFX_PROFILER_ENABLED', type: :string, data: 'true' }, - { name: 'SIGNALFX_PROFILER_MEMORY_ENABLED', type: :string, data: 'true' }, - { name: 'SIGNALFX_SERVICE_NAME', type: :string, data: 'test-service' }, - { name: 'MY_CUSTOM_OPTION1', type: :string, data: 'value1' }, - { name: 'MY_CUSTOM_OPTION2', type: :string, data: 'value2' }, -] - -describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment') do - its('SIGNALFX_DOTNET_TRACER_HOME') { should cmp "#{ENV['ProgramFiles']}\\SignalFx\\.NET Tracing\\" } - dotnet_instrumentation_env_vars.each do |item| - its(item[:name]) { should eq item[:data] } - end -end - -iis_env = [] -dotnet_instrumentation_env_vars.each do |item| - iis_env |= [ "#{item[:name]}=#{item[:data]}" ] -end - -describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC') do - it { should have_property_value('Environment', :multi_string, iis_env) } -end diff --git a/deployments/chef/test/integration/with_default_windows_dotnet_instrumentation/test.rb b/deployments/chef/test/integration/with_default_windows_dotnet_instrumentation/test.rb deleted file mode 100644 index c56545e5ee..0000000000 --- a/deployments/chef/test/integration/with_default_windows_dotnet_instrumentation/test.rb +++ /dev/null @@ -1,36 +0,0 @@ -describe service('splunk-otel-collector') do - it { should be_enabled } - it { should be_running } -end - -describe service('fluentdwinsvc') do - it { should_not be_enabled } - it { should_not be_running } -end - -dotnet_instrumentation_env_vars = [ - { name: 'COR_ENABLE_PROFILING', type: :string, data: 'true' }, - { name: 'COR_PROFILER', type: :string, data: '{B4C89B0F-9908-4F73-9F59-0D77C5A06874}' }, - { name: 'CORECLR_ENABLE_PROFILING', type: :string, data: 'true' }, - { name: 'CORECLR_PROFILER', type: :string, data: '{B4C89B0F-9908-4F73-9F59-0D77C5A06874}' }, - { name: 'SIGNALFX_ENV', type: :string, data: '' }, - { name: 'SIGNALFX_PROFILER_ENABLED', type: :string, data: 'false' }, - { name: 'SIGNALFX_PROFILER_MEMORY_ENABLED', type: :string, data: 'false' }, - { name: 'SIGNALFX_SERVICE_NAME', type: :string, data: '' }, -] - -describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment') do - its('SIGNALFX_DOTNET_TRACER_HOME') { should cmp "#{ENV['ProgramFiles']}\\SignalFx\\.NET Tracing\\" } - dotnet_instrumentation_env_vars.each do |item| - it { should_not have_property(item[:name]) } - end -end - -iis_env = [] -dotnet_instrumentation_env_vars.each do |item| - iis_env |= [ "#{item[:name]}=#{item[:data]}" ] -end - -describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC') do - it { should have_property_value('Environment', :multi_string, iis_env) } -end