Skip to content

Commit

Permalink
[chef] Deprecate installing the SFx.NET instrumentation on Windows (#…
Browse files Browse the repository at this point in the history
…5865)

* [chef] Deprecate installing

* Fix spacing
  • Loading branch information
pjanotti authored Feb 5, 2025
1 parent 9eb4afa commit 2fa1993
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 328 deletions.
8 changes: 8 additions & 0 deletions deployments/chef/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
141 changes: 8 additions & 133 deletions deployments/chef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
15 changes: 0 additions & 15 deletions deployments/chef/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
36 changes: 0 additions & 36 deletions deployments/chef/kitchen.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions deployments/chef/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
66 changes: 0 additions & 66 deletions deployments/chef/recipes/dotnet_instrumentation_win_install.rb

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2fa1993

Please sign in to comment.