diff --git a/deployments/ansible/CHANGELOG.md b/deployments/ansible/CHANGELOG.md index 66fbc77cee..05fdcdd8a5 100644 --- a/deployments/ansible/CHANGELOG.md +++ b/deployments/ansible/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## ansible-v0.31.0 + +### 🛑 Breaking changes 🛑 + +- 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 of the [SignalFx Instrumentation for .NET](https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-dotnet/sfx/sfx-instrumentation.html#signalfx-instrumentation-for-net-deprecated) + when setting `install_splunk_dotnet_auto_instrumentation` to `true`. + Corresponding configuration options were renamed from `signalfx_dotnet_*` to `splunk_dotnet_*`. + ## ansible-v0.30.0 ### 💡 Enhancements 💡 diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index d78f955ed7..237673f8cc 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -20,17 +20,17 @@ splunk_otel_collector_additional_env_vars: MY_CUSTOM_VAR1: value1 MY_CUSTOM_VAR2: value2 - install_signalfx_dotnet_auto_instrumentation: true - signalfx_dotnet_auto_instrumentation_version: 1.0.0 - signalfx_dotnet_auto_instrumentation_system_wide: true - signalfx_dotnet_auto_instrumentation_environment: test-environment - signalfx_dotnet_auto_instrumentation_service_name: test-service-name - signalfx_dotnet_auto_instrumentation_enable_profiler: true - signalfx_dotnet_auto_instrumentation_enable_profiler_memory: true - signalfx_dotnet_auto_instrumentation_global_tags: dotnet-tag:dotnet-tag-value - signalfx_dotnet_auto_instrumentation_additional_options: - SIGNALFX_DOTNET_VAR1: dotnet-value1 - SIGNALFX_DOTNET_VAR2: dotnet-value2 + install_splunk_dotnet_auto_instrumentation: true + splunk_dotnet_auto_instrumentation_version: 1.8.0 + splunk_dotnet_auto_instrumentation_system_wide: true + splunk_dotnet_auto_instrumentation_environment: test-environment + splunk_dotnet_auto_instrumentation_service_name: test-service-name + splunk_dotnet_auto_instrumentation_enable_profiler: true + splunk_dotnet_auto_instrumentation_enable_profiler_memory: true + splunk_dotnet_auto_instrumentation_additional_options: + SPLUNK_DOTNET_VAR1: dotnet-value1 + SPLUNK_DOTNET_VAR2: dotnet-value2 + splunk_otel_auto_instrumentation_resource_attributes: dotnet-tag=dotnet-tag-value tasks: - name: "Include signalfx.splunk_otel_collector.collector role" include_role: diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index b73a921820..7e4adbc351 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -16,18 +16,16 @@ MY_CUSTOM_VAR2: value2 iis_reg_values: COR_ENABLE_PROFILING: "1" - COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" + COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" - CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" - SIGNALFX_ENV: test-environment - SIGNALFX_SERVICE_NAME: test-service-name - SIGNALFX_PROFILER_ENABLED: "true" - SIGNALFX_PROFILER_MEMORY_ENABLED: "true" - SIGNALFX_GLOBAL_TAGS: splunk.zc.method:signalfx-dotnet-tracing-1.0.0,dotnet-tag:dotnet-tag-value - SIGNALFX_DOTNET_VAR1: dotnet-value1 - SIGNALFX_DOTNET_VAR2: dotnet-value2 - machine_reg_values: - SIGNALFX_DOTNET_TRACER_HOME: '{{ ansible_env.ProgramFiles }}\SignalFx\.NET Tracing\' + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" + OTEL_RESOURCE_ATTRIBUTES: >- + deployment.environment=test-environment,dotnet-tag=dotnet-tag-value,splunk.zc.method=splunk-otel-dotnet-1.9.0 + OTEL_SERVICE_NAME: "test-service-name" + SPLUNK_PROFILER_ENABLED: "true" + SPLUNK_PROFILER_MEMORY_ENABLED: "true" + SPLUNK_DOTNET_VAR1: dotnet-value1 + SPLUNK_DOTNET_VAR2: dotnet-value2 tasks: - name: Check splunk-otel-collector service ansible.windows.win_service: @@ -93,24 +91,6 @@ assert: that: custom_fluentd_config.stat.checksum == td_agent_config.stat.checksum - - name: Download signalfx-dotnet-tracing-1.0.0-x64.msi - ansible.windows.win_get_url: - url: "https://github.com/signalfx/signalfx-dotnet-tracing/releases/download/\ - v1.0.0/signalfx-dotnet-tracing-1.0.0-x64.msi" - dest: "{{ansible_env.TEMP}}" - register: dotnet_msi_package - - - name: Install signalfx-dotnet-tracing-1.0.0-x64.msi - ansible.windows.win_package: - path: "{{dotnet_msi_package.dest}}" - state: present - check_mode: yes - register: msi_installed - - - name: Assert signalfx-dotnet-tracing-1.0.0-x64.msi is already installed - assert: - that: not msi_installed.changed - - name: Get IIS env vars ansible.windows.win_reg_stat: path: HKLM:\SYSTEM\CurrentControlSet\Services\W3SVC @@ -132,11 +112,3 @@ assert: that: (item.key + '=' + (item.value | string)) in collector_env.value loop: "{{ collector_reg_values | dict2items }}" - - - name: Verify env vars - include_tasks: ../shared/verify_registry_key.yml - vars: - path: HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment - name: "{{ item.key }}" - value: "{{ item.value }}" - loop: "{{ machine_reg_values | dict2items }}" diff --git a/deployments/ansible/molecule/with_instrumentation/windows-converge.yml b/deployments/ansible/molecule/with_instrumentation/windows-converge.yml index 0fadf15047..718a01be14 100644 --- a/deployments/ansible/molecule/with_instrumentation/windows-converge.yml +++ b/deployments/ansible/molecule/with_instrumentation/windows-converge.yml @@ -6,8 +6,8 @@ splunk_access_token: fake-token splunk_realm: fake-realm install_fluentd: false - install_signalfx_dotnet_auto_instrumentation: true - signalfx_dotnet_auto_instrumentation_github_token: ${GITHUB_TOKEN} + install_splunk_dotnet_auto_instrumentation: true + splunk_dotnet_auto_instrumentation_github_token: ${GITHUB_TOKEN} tasks: - name: "Include signalfx.splunk_otel_collector.collector role" include_role: diff --git a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml index 654b1cf439..502f481961 100644 --- a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml @@ -14,15 +14,11 @@ SPLUNK_INGEST_URL: https://ingest.fake-realm.signalfx.com iis_reg_values: COR_ENABLE_PROFILING: "1" - COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" + COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" - CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" - SIGNALFX_ENV: "" - SIGNALFX_SERVICE_NAME: "" - SIGNALFX_PROFILER_ENABLED: "false" - SIGNALFX_PROFILER_MEMORY_ENABLED: "false" - machine_reg_values: - SIGNALFX_DOTNET_TRACER_HOME: '{{ ansible_env.ProgramFiles }}\SignalFx\.NET Tracing\' + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" + SPLUNK_PROFILER_ENABLED: "false" + SPLUNK_PROFILER_MEMORY_ENABLED: "false" tasks: - name: Check splunk-otel-collector service ansible.windows.win_service: @@ -31,21 +27,6 @@ check_mode: yes register: service_status - - name: Get installed signalfx-dotnet-tracing MSI version - ansible.windows.win_shell: | - $msi_version = "" - $msi_name = "SignalFx .NET Tracing 64-bit" - $regkey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall" - $msi_version = (Get-ItemProperty ${regkey}\* | Where { $_.DisplayName -eq "$msi_name" }).DisplayVersion - echo $msi_version - register: msi_version - - - name: Add SIGNALFX_GLOBAL_TAGS to iis_reg_values - set_fact: - iis_reg_values: |- - {%- set tags = "splunk.zc.method:signalfx-dotnet-tracing-" + (msi_version.stdout | trim) -%} - {{ iis_reg_values | combine({"SIGNALFX_GLOBAL_TAGS": tags}) }} - - name: Get IIS env vars ansible.windows.win_reg_stat: path: HKLM:\SYSTEM\CurrentControlSet\Services\W3SVC @@ -75,11 +56,3 @@ name: "{{ item.key }}" exists: false loop: "{{ iis_reg_values | dict2items }}" - - - name: Verify .NET tracing MSI env vars were added to the system - include_tasks: ../shared/verify_registry_key.yml - vars: - path: HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment - name: "{{ item.key }}" - value: "{{ item.value }}" - loop: "{{ machine_reg_values | dict2items }}" diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index a562e28a6a..245781fcf1 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -254,7 +254,7 @@ to take effect. **Note:** This role does not manage the installation/configuration of Node.js or `npm`. -- `splunk_otel_auto_instrumentation_resource_attributes` (Linux only): +- `splunk_otel_auto_instrumentation_resource_attributes`: Configure the OpenTelemetry instrumentation resource attributes, e.g. `deployment.environment=prod,my.key=value` (comma-separated `key=value` pairs. (**default:** ``) @@ -324,7 +324,7 @@ to take effect. `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 +`splunk_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 @@ -334,117 +334,101 @@ effect. For proxy options, see the [Windows Proxy](#windows-proxy) section. -- `install_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`) +- `install_splunk_dotnet_auto_instrumentation` (Windows only): Whether to + install/manage [Splunk Distribution of OpenTelemetry .NET]( + https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-dotnet/get-started.html). (**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). +- `splunk_dotnet_auto_instrumentation_version` (Windows only): Version of the + `splunk-otel-dotnet` project to download and install from + [GitHub Releases](https://github.com/signalfx/splunk-otel-dotnet/releases). By default, a request will be made to - `https://api.github.com/repos/signalfx/signalfx-dotnet-tracing/releases/latest` + `https://api.github.com/repos/signalfx/splunk-otel-dotnet/releases/latest` to determine the latest release. If a version is specified, for example - `1.0.0`, the API request will be skipped and the MSI package will be + `1.0.0`, the API request will be skipped and files will be downloaded from - `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`. + `https://github.com/signalfx/splunk-otel-dotnet/releases/download/v{{ splunk_dotnet_auto_instrumentation_version }}`. (**default:** `latest`) -- `signalfx_dotnet_auto_instrumentation_msi_url` (Windows only): Specify the - URL to download the `signalfx-dotnet-tracing` MSI to skip the GitHub API +- `splunk_dotnet_auto_instrumentation_url` (Windows only): Specify the + URL to download the `splunk-otel-dotnet` files to skip the GitHub API request, for example - `https://github.com/signalfx/signalfx-dotnet-tracing/releases/download/v1.0.0/signalfx-dotnet-tracing-1.0.0-x64.msi`, - or 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. + `https://github.com/signalfx/splunk-otel-dotnet/releases/download/v1.8.0`, + or to download the files from a custom host, for example + `https://my.host/`. If specified, the + `splunk_dotnet_auto_instrumentation_version` option is ignored. (**default:** ``) -- `signalfx_dotnet_auto_instrumentation_github_token` (Windows only): Specify +- `splunk_dotnet_auto_instrumentation_github_token` (Windows only): Specify a token to authenticate with the GitHub API when making requests to get the - latest `signalfx-dotnet-tracing` release. A token is recommended when - `signalfx_dotnet_auto_instrumentation_version` is `latest` or when not using - `signalfx_dotnet_auto_instrumentation_msi_url` since unauthenticated requests + latest `splunk-otel-dotnet` release. A token is recommended when + `splunk_dotnet_auto_instrumentation_version` is `latest` or when not using + `splunk_dotnet_auto_instrumentation_url` since unauthenticated requests are [rate-limited](https://docs.github.com/en/rest/rate-limit) by GitHub. (**default:** ``) -- `signalfx_dotnet_auto_instrumentation_iisreset` (Windows only): By default, +- `splunk_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 +- `splunk_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 + `splunk_dotnet_auto_instrumentation_additional_options` option to enable/configure auto instrumentation for ***only*** IIS applications: ```yaml COR_ENABLE_PROFILING: "1" # Required - COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required + COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required CORECLR_ENABLE_PROFILING: "1" # Required - CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required - SIGNALFX_ENV: "{{ signalfx_dotnet_auto_instrumentation_environment }}" - SIGNALFX_GLOBAL_TAGS: "{{ signalfx_dotnet_auto_instrumentation_global_tags }}" - 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 }}" + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_otel_auto_instrumentation_resource_attributes }},splunk.zc.method=splunk-otel-dotnet-1.8.0" + OTEL_SERVICE_NAME: "{{ splunk_dotnet_auto_instrumentation_service_name }}" + SPLUNK_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" + SPLUNK_PROFILER_MEMORY_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler_memory }}" ``` Set this option to `true` to also add these environment variables and any - from the `signalfx_dotnet_auto_instrumentation_additional_options` option to + from the `splunk_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 +- `splunk_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 + example `production`. The value is assigned to the `OTEL_RESOURCE_ATTRIBUTES` environment variable in the Windows registry (**default:** ``, i.e. the "Environment" will appear as `unknown` in Splunk APM for the instrumented - service/application) + service/application) using the `deployment.environment` attribute key. -- `signalfx_dotnet_auto_instrumentation_service_name` (Windows only): Configure +- `splunk_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) + https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-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 + value is assigned to the `OTEL_SERVICE_NAME` environment variable in the Windows registry. (**default:** ``) -- `signalfx_dotnet_auto_instrumentation_enable_profiler` (Windows only): Set +- `splunk_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 + assigned to the `SPLUNK_PROFILER_ENABLED` environment variable in the Windows registry. (**default:** `false`) -- `signalfx_dotnet_auto_instrumentation_enable_profiler_memory` (Windows only): +- `splunk_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 + be assigned to the `SPLUNK_PROFILER_MEMORY_ENABLED` environment variable in the Windows registry. (**default:** `false`) -- `signalfx_dotnet_auto_instrumentation_global_tags` (Windows only): - Comma-separated list of `key:value` pairs that specify global tags added to - all telemetry signals, for example `key1:val1,key2:val2`. The value will be - assigned to the `SIGNALFX_GLOBAL_TAGS` environment variable in the Windows - registry. (**default**: ``) - -- `signalfx_dotnet_auto_instrumentation_additional_options` (Windows only): +- `splunk_dotnet_auto_instrumentation_additional_options` (Windows only): Dictionary of environment variables 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 + splunk_dotnet_auto_instrumentation_additional_options: + SOME_ENV_VAR_00: "1.2.3" + SOME_ENV_VAR_01: "false" ``` - Check the [Advanced Configuration Guide]( - https://docs.splunk.com/Observability/gdi/get-data-in/application/dotnet/configuration/advanced-dotnet-configuration.html) + Check the [configuration options]( + https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-dotnet/configuration/advanced-dotnet-configuration.html#configure-the-splunk-distribution-of-opentelemetry-net) for more details about the options above and other supported options. diff --git a/deployments/ansible/roles/collector/defaults/main.yml b/deployments/ansible/roles/collector/defaults/main.yml index 8fefa7c393..d46b97129d 100644 --- a/deployments/ansible/roles/collector/defaults/main.yml +++ b/deployments/ansible/roles/collector/defaults/main.yml @@ -87,15 +87,14 @@ splunk_otel_auto_instrumentation_npm_path: npm splunk_otel_collector_additional_env_vars: {} # Configure Auto Instrumentation for .NET -install_signalfx_dotnet_auto_instrumentation: false -signalfx_dotnet_auto_instrumentation_version: latest -signalfx_dotnet_auto_instrumentation_msi_url: "" -signalfx_dotnet_auto_instrumentation_github_token: "" -signalfx_dotnet_auto_instrumentation_system_wide: false -signalfx_dotnet_auto_instrumentation_environment: "" -signalfx_dotnet_auto_instrumentation_service_name: "" -signalfx_dotnet_auto_instrumentation_enable_profiler: false -signalfx_dotnet_auto_instrumentation_enable_profiler_memory: false -signalfx_dotnet_auto_instrumentation_global_tags: "" -signalfx_dotnet_auto_instrumentation_iisreset: true -signalfx_dotnet_auto_instrumentation_additional_options: {} +install_splunk_dotnet_auto_instrumentation: false +splunk_dotnet_auto_instrumentation_version: latest +splunk_dotnet_auto_instrumentation_url: "" +splunk_dotnet_auto_instrumentation_github_token: "" +splunk_dotnet_auto_instrumentation_system_wide: false +splunk_dotnet_auto_instrumentation_environment: "" +splunk_dotnet_auto_instrumentation_service_name: "" +splunk_dotnet_auto_instrumentation_enable_profiler: false +splunk_dotnet_auto_instrumentation_enable_profiler_memory: false +splunk_dotnet_auto_instrumentation_iisreset: true +splunk_dotnet_auto_instrumentation_additional_options: {} diff --git a/deployments/ansible/roles/collector/handlers/main.yml b/deployments/ansible/roles/collector/handlers/main.yml index 0e92ff8772..a0a23d373f 100644 --- a/deployments/ansible/roles/collector/handlers/main.yml +++ b/deployments/ansible/roles/collector/handlers/main.yml @@ -65,4 +65,4 @@ & { iisreset.exe } listen: "reset iis" when: - - install_signalfx_dotnet_auto_instrumentation and signalfx_dotnet_auto_instrumentation_iisreset + - install_splunk_dotnet_auto_instrumentation and splunk_dotnet_auto_instrumentation_iisreset diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index cb7bf8ef05..3c6baf5a4a 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -61,14 +61,16 @@ win_use_proxy: "no" dotnet_options: COR_ENABLE_PROFILING: "1" - COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" + COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" - CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" - SIGNALFX_ENV: "{{ signalfx_dotnet_auto_instrumentation_environment }}" - SIGNALFX_SERVICE_NAME: "{{ signalfx_dotnet_auto_instrumentation_service_name }}" - SIGNALFX_GLOBAL_TAGS: "{{ signalfx_dotnet_auto_instrumentation_global_tags }}" - SIGNALFX_PROFILER_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler }}" - SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler_memory }}" + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" + OTEL_RESOURCE_ATTRIBUTES: + "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}\ + {{ ',' if splunk_otel_auto_instrumentation_resource_attributes else '' }}\ + {{ splunk_otel_auto_instrumentation_resource_attributes }}" + OTEL_SERVICE_NAME: "{{ splunk_dotnet_auto_instrumentation_service_name }}" + SPLUNK_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" + SPLUNK_PROFILER_MEMORY_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler_memory }}" iis_registry_key: HKLM:\SYSTEM\CurrentControlSet\Services\W3SVC splunk_otel_collector_options: SPLUNK_ACCESS_TOKEN: "{{ splunk_access_token }}" diff --git a/deployments/ansible/roles/collector/tasks/win_install.yml b/deployments/ansible/roles/collector/tasks/win_install.yml index 937942a01e..0ee8114256 100644 --- a/deployments/ansible/roles/collector/tasks/win_install.yml +++ b/deployments/ansible/roles/collector/tasks/win_install.yml @@ -13,4 +13,4 @@ - name: Install Auto Instrumentation for .NET ansible.builtin.import_tasks: win_install_dotnet_auto_instrumentation.yml - when: install_signalfx_dotnet_auto_instrumentation + when: install_splunk_dotnet_auto_instrumentation diff --git a/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml b/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml index 5b7d6014e0..b28da707fc 100644 --- a/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml +++ b/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml @@ -1,64 +1,74 @@ --- -- name: Get latest signalfx-dotnet-tracing release json +- name: Get latest splunk-otel-dotnet release json ansible.windows.win_uri: - url: "https://api.github.com/repos/signalfx/signalfx-dotnet-tracing/releases/latest" + url: "https://api.github.com/repos/signalfx/splunk-otel-dotnet/releases/latest" return_content: yes content_type: "application/json" headers: - Authorization: "{{ signalfx_dotnet_auto_instrumentation_github_token | default(omit) }}" + Authorization: "{{ splunk_dotnet_auto_instrumentation_github_token | default(omit) }}" proxy_password: "{{ win_proxy_password | default(omit) }}" proxy_url: "{{ win_proxy_url | default(omit) }}" proxy_username: "{{ win_proxy_username | default(omit) }}" use_proxy: "{{ win_use_proxy }}" register: latest_dotnet_release - when: signalfx_dotnet_auto_instrumentation_version == "latest" and not signalfx_dotnet_auto_instrumentation_msi_url + when: splunk_dotnet_auto_instrumentation_version == "latest" and not splunk_dotnet_auto_instrumentation_url - name: Set dotnet_download_url fact set_fact: dotnet_download_url: |- - {%- if signalfx_dotnet_auto_instrumentation_msi_url -%} - {{ signalfx_dotnet_auto_instrumentation_msi_url }} + {%- if splunk_dotnet_auto_instrumentation_url -%} + {{ splunk_dotnet_auto_instrumentation_url }} {%- else -%} - {%- if signalfx_dotnet_auto_instrumentation_version != "latest" -%} - {%- set version = signalfx_dotnet_auto_instrumentation_version.lstrip("v") -%} - {{ base_url }}/v{{ version }}/signalfx-dotnet-tracing-{{ version }}-x64.msi - {%- elif signalfx_dotnet_auto_instrumentation_version == "latest" and latest_dotnet_release is defined -%} + {%- if splunk_dotnet_auto_instrumentation_version != "latest" -%} + {%- set version = splunk_dotnet_auto_instrumentation_version.lstrip("v") -%} + {{ base_url }}/v{{ version }} + {%- elif splunk_dotnet_auto_instrumentation_version == "latest" and latest_dotnet_release is defined -%} {%- set version = latest_dotnet_release.json.tag_name.lstrip("v") -%} - {{ base_url }}/v{{ version }}/signalfx-dotnet-tracing-{{ version }}-x64.msi + {{ base_url }}/v{{ version }} {%- endif -%} {%- endif -%} vars: - base_url: https://github.com/signalfx/signalfx-dotnet-tracing/releases/download + base_url: https://github.com/signalfx/splunk-otel-dotnet/releases/download -- name: Download signalfx-dotnet-tracing MSI +- name: Download splunk-otel-dotnet install script ansible.windows.win_get_url: - url: "{{ dotnet_download_url }}" + url: "{{ dotnet_download_url }}/Splunk.OTel.DotNet.psm1" dest: "%TEMP%" proxy_password: "{{ win_proxy_password | default(omit) }}" proxy_url: "{{ win_proxy_url | default(omit) }}" proxy_username: "{{ win_proxy_username | default(omit) }}" use_proxy: "{{ win_use_proxy }}" - register: dotnet_msi + register: splunk_dotnet_psm1 -- name: Install signalfx-dotnet-tracing MSI - ansible.windows.win_package: - path: "{{ dotnet_msi.dest }}" - state: present - notify: "reset iis" +- name: Download splunk-otel-dotnet bundle + ansible.windows.win_get_url: + url: "{{ dotnet_download_url }}/splunk-opentelemetry-dotnet-windows.zip" + dest: "%TEMP%" + proxy_password: "{{ win_proxy_password | default(omit) }}" + proxy_url: "{{ win_proxy_url | default(omit) }}" + proxy_username: "{{ win_proxy_username | default(omit) }}" + use_proxy: "{{ win_use_proxy }}" + register: splunk_dotnet_zip + +- name: Install splunk-otel-dotnet + ansible.windows.win_powershell: + error_action: stop + script: | + Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" + Install-OpenTelemetryCore -LocalPath "${Env:TEMP}\splunk-opentelemetry-dotnet-windows.zip" + $w3svc = Get-Service -name "W3SVC" -ErrorAction SilentlyContinue + $was = Get-Service -name "WAS" -ErrorAction SilentlyContinue + if ($w3svc -And $was) { Register-OpenTelemetryForIIS } + tags: molecule-idempotence-notest -- name: Get installed signalfx-dotnet-tracing MSI version - ansible.windows.win_shell: | - $msi_version = "" - $msi_name = "SignalFx .NET Tracing 64-bit" - $regkey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall" - try { - $msi_version = (Get-ItemProperty ${regkey}\* | Where { $_.DisplayName -eq "$msi_name" }).DisplayVersion - } catch { - continue - } - echo $msi_version - changed_when: dotnet_msi.changed - register: msi_version +- name: Get installed Splunk OpenTelemetry .NET version + ansible.windows.win_powershell: + error_action: stop + script: | + Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" | Out-Null + Get-OpenTelemetryInstallVersion + register: splunk_otel_dotnet_version + tags: molecule-idempotence-notest - name: Create registry path ansible.windows.win_regedit: @@ -72,16 +82,14 @@ {%- if (item.value | type_debug) == "bool" -%} {%- set value = item.value | string | lower -%} {%- endif -%} - {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} - {%- set method = "" -%} - {%- if msi_version.stdout != "" -%} - {%- set method = "splunk.zc.method:signalfx-dotnet-tracing-" + (msi_version.stdout | trim) -%} - {%- endif -%} - {%- set value = (method + "," + signalfx_dotnet_auto_instrumentation_global_tags) | trim(",") -%} + {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_version.output[0].lstrip("v") -%} + {%- set value = (item.value + "," + method) | trim(",") -%} {%- endif -%} {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} loop: > - {{ dotnet_options | default({}) | combine(signalfx_dotnet_auto_instrumentation_additional_options) | dict2items }} + {{ dotnet_options | default({}) | combine(splunk_dotnet_auto_instrumentation_additional_options) | dict2items }} + tags: molecule-idempotence-notest - name: Set IIS registry value ansible.windows.win_regedit: @@ -91,12 +99,13 @@ data: "{{ options_list | sort }}" type: multistring notify: "reset iis" + tags: molecule-idempotence-notest - name: Create registry path ansible.windows.win_regedit: path: "{{ registry_key }}" state: present - when: signalfx_dotnet_auto_instrumentation_system_wide + when: splunk_dotnet_auto_instrumentation_system_wide - name: Set system-wide registry value ansible.windows.win_regedit: @@ -108,16 +117,14 @@ {%- if (item.value | type_debug) == "bool" -%} {%- set value = item.value | string | lower -%} {%- endif -%} - {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} - {%- set method = "" -%} - {%- if msi_version.stdout != "" -%} - {%- set method = "splunk.zc.method:signalfx-dotnet-tracing-" + (msi_version.stdout | trim) -%} - {%- endif -%} - {%- set value = (method + "," + signalfx_dotnet_auto_instrumentation_global_tags) | trim(",") -%} + {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_version.output[0].lstrip("v") -%} + {%- set value = (item.value + "," + method) | trim(",") -%} {%- endif -%} {{ value | string }} type: string loop: > - {{ dotnet_options | default({}) | combine(signalfx_dotnet_auto_instrumentation_additional_options) | dict2items }} - when: signalfx_dotnet_auto_instrumentation_system_wide + {{ dotnet_options | default({}) | combine(splunk_dotnet_auto_instrumentation_additional_options) | dict2items }} + when: splunk_dotnet_auto_instrumentation_system_wide notify: "reset iis" + tags: molecule-idempotence-notest