From 6e96e259e5994025a8ae1fee104ab29f0a54142c Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 21 Jan 2025 12:45:24 -0800 Subject: [PATCH 01/31] Rename `signalfx_dotnet` to `splunk_dotnet` Ansible vars --- .../molecule/custom_vars/windows-converge.yml | 18 +++---- .../with_instrumentation/windows-converge.yml | 4 +- deployments/ansible/roles/collector/README.md | 52 +++++++++---------- .../ansible/roles/collector/defaults/main.yml | 24 ++++----- .../ansible/roles/collector/handlers/main.yml | 2 +- .../ansible/roles/collector/tasks/vars.yml | 10 ++-- .../roles/collector/tasks/win_install.yml | 2 +- ...in_install_dotnet_auto_instrumentation.yml | 26 +++++----- 8 files changed, 69 insertions(+), 69 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index d78f955ed7..fdc3dde795 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -20,15 +20,15 @@ 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: + install_splunk_dotnet_auto_instrumentation: true + splunk_dotnet_auto_instrumentation_version: 1.0.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_global_tags: dotnet-tag:dotnet-tag-value + splunk_dotnet_auto_instrumentation_additional_options: SIGNALFX_DOTNET_VAR1: dotnet-value1 SIGNALFX_DOTNET_VAR2: dotnet-value2 tasks: 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/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index a562e28a6a..96c40edd8e 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -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,14 +334,14 @@ effect. For proxy options, see the [Windows Proxy](#windows-proxy) section. -- `install_signalfx_dotnet_auto_instrumentation` (Windows only): Whether to +- `install_splunk_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 +- `splunk_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). By default, a request will be made to @@ -349,96 +349,96 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. 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 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/signalfx-dotnet-tracing/releases/download/v{{ splunk_dotnet_auto_instrumentation_version }}/signalfx-dotnet-tracing-{{ splunk_dotnet_auto_instrumentation_version }}-x64.msi`. (**default:** `latest`) -- `signalfx_dotnet_auto_instrumentation_msi_url` (Windows only): Specify the +- `splunk_dotnet_auto_instrumentation_msi_url` (Windows only): Specify the URL to download the `signalfx-dotnet-tracing` MSI 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. + `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 + `splunk_dotnet_auto_instrumentation_version` is `latest` or when not using + `splunk_dotnet_auto_instrumentation_msi_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 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 }}" + SIGNALFX_ENV: "{{ splunk_dotnet_auto_instrumentation_environment }}" + SIGNALFX_GLOBAL_TAGS: "{{ splunk_dotnet_auto_instrumentation_global_tags }}" + SIGNALFX_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" + SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler_memory }}" + SIGNALFX_SERVICE_NAME: "{{ splunk_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 + 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 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 +- `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) 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 +- `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 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 the Windows registry. (**default:** `false`) -- `signalfx_dotnet_auto_instrumentation_global_tags` (Windows only): +- `splunk_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: + splunk_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 + # Hint: If the splunk_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. diff --git a/deployments/ansible/roles/collector/defaults/main.yml b/deployments/ansible/roles/collector/defaults/main.yml index 8fefa7c393..9a944cd675 100644 --- a/deployments/ansible/roles/collector/defaults/main.yml +++ b/deployments/ansible/roles/collector/defaults/main.yml @@ -87,15 +87,15 @@ 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_msi_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_global_tags: "" +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..f8ba5afc33 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -64,11 +64,11 @@ COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" 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 }}" + SIGNALFX_ENV: "{{ splunk_dotnet_auto_instrumentation_environment }}" + SIGNALFX_SERVICE_NAME: "{{ splunk_dotnet_auto_instrumentation_service_name }}" + SIGNALFX_GLOBAL_TAGS: "{{ splunk_dotnet_auto_instrumentation_global_tags }}" + SIGNALFX_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" + SIGNALFX_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..21be4492ae 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 @@ -5,24 +5,24 @@ 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_msi_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_msi_url -%} + {{ splunk_dotnet_auto_instrumentation_msi_url }} {%- else -%} - {%- if signalfx_dotnet_auto_instrumentation_version != "latest" -%} - {%- set version = signalfx_dotnet_auto_instrumentation_version.lstrip("v") -%} + {%- if splunk_dotnet_auto_instrumentation_version != "latest" -%} + {%- set version = splunk_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 -%} + {%- 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 {%- endif -%} @@ -77,11 +77,11 @@ {%- 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(",") -%} + {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | 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 }} - name: Set IIS registry value ansible.windows.win_regedit: @@ -96,7 +96,7 @@ 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: @@ -113,11 +113,11 @@ {%- 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(",") -%} + {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | 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" From ed81ee3bff3052edaf9c8744d3cc43fa8e415590 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 21 Jan 2025 13:04:57 -0800 Subject: [PATCH 02/31] Rename custom env vars for .NET instrumentation --- deployments/ansible/molecule/custom_vars/windows-converge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index fdc3dde795..1d5e7c06e2 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -29,8 +29,8 @@ splunk_dotnet_auto_instrumentation_enable_profiler_memory: true splunk_dotnet_auto_instrumentation_global_tags: dotnet-tag:dotnet-tag-value splunk_dotnet_auto_instrumentation_additional_options: - SIGNALFX_DOTNET_VAR1: dotnet-value1 - SIGNALFX_DOTNET_VAR2: dotnet-value2 + SPLUNK_DOTNET_VAR1: dotnet-value1 + SPLUNK_DOTNET_VAR2: dotnet-value2 tasks: - name: "Include signalfx.splunk_otel_collector.collector role" include_role: From c98ee605968622959bc2ca36c53a97cf79b98cc7 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 21 Jan 2025 13:31:37 -0800 Subject: [PATCH 03/31] Remove verification of machine wide env vars --- .../molecule/custom_vars/windows-verify.yml | 23 +++++-------------- .../with_instrumentation/windows-verify.yml | 10 -------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index b73a921820..5726549483 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -19,15 +19,12 @@ COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" 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\' + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method:splunk-dotnet-tracing-1.0.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: @@ -132,11 +129,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-verify.yml b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml index 654b1cf439..34a0fab862 100644 --- a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml @@ -21,8 +21,6 @@ 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\' tasks: - name: Check splunk-otel-collector service ansible.windows.win_service: @@ -75,11 +73,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 }}" From 27ad8d74bf20bd4dd27a5c696c3975a8e8883603 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 21 Jan 2025 13:50:49 -0800 Subject: [PATCH 04/31] Adjust env vars --- .../with_instrumentation/windows-verify.yml | 21 ++--------- deployments/ansible/roles/collector/README.md | 35 ++++++++----------- .../ansible/roles/collector/tasks/vars.yml | 9 +++-- 3 files changed, 20 insertions(+), 45 deletions(-) diff --git a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml index 34a0fab862..69e1eb229f 100644 --- a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml @@ -17,10 +17,8 @@ COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" 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" + SPLUNK_PROFILER_ENABLED: "false" + SPLUNK_PROFILER_MEMORY_ENABLED: "false" tasks: - name: Check splunk-otel-collector service ansible.windows.win_service: @@ -29,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 diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 96c40edd8e..d9dc80cc8c 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -386,11 +386,10 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required CORECLR_ENABLE_PROFILING: "1" # Required CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required - SIGNALFX_ENV: "{{ splunk_dotnet_auto_instrumentation_environment }}" - SIGNALFX_GLOBAL_TAGS: "{{ splunk_dotnet_auto_instrumentation_global_tags }}" - SIGNALFX_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" - SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler_memory }}" - SIGNALFX_SERVICE_NAME: "{{ splunk_dotnet_auto_instrumentation_service_name }}" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-dotnet-tracing-1.0.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 `splunk_dotnet_auto_instrumentation_additional_options` option to @@ -401,32 +400,32 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. - `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. - `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) 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:** ``) - `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`) - `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`) - `splunk_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 + 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 + added to the `OTEL_RESOURCE_ATTRIBUTES` environment variable in the Windows registry. (**default**: ``) - `splunk_dotnet_auto_instrumentation_additional_options` (Windows only): @@ -436,14 +435,8 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. For example: ```yaml splunk_dotnet_auto_instrumentation_additional_options: - SIGNALFX_VERSION: "1.2.3" - SIGNALFX_FILE_LOG_ENABLED: false - # Hint: If the splunk_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 + 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) diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index f8ba5afc33..36180bafcc 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -64,11 +64,10 @@ COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" - SIGNALFX_ENV: "{{ splunk_dotnet_auto_instrumentation_environment }}" - SIGNALFX_SERVICE_NAME: "{{ splunk_dotnet_auto_instrumentation_service_name }}" - SIGNALFX_GLOBAL_TAGS: "{{ splunk_dotnet_auto_instrumentation_global_tags }}" - SIGNALFX_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" - SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler_memory }}" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-dotnet-tracing-1.0.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 }}" iis_registry_key: HKLM:\SYSTEM\CurrentControlSet\Services\W3SVC splunk_otel_collector_options: SPLUNK_ACCESS_TOKEN: "{{ splunk_access_token }}" From f26688964ae97cadb4c9f588284bbed06ba77951 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 21 Jan 2025 14:11:50 -0800 Subject: [PATCH 05/31] Update Splunk doc links --- deployments/ansible/roles/collector/README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index d9dc80cc8c..5135d75302 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -335,11 +335,8 @@ effect. For proxy options, see the [Windows Proxy](#windows-proxy) section. - `install_splunk_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/manage [Splunk Distribution of OpenTelemetry .NET]( + https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-dotnet/get-started.html). (**default:** `false`) - `splunk_dotnet_auto_instrumentation_version` (Windows only): Version of the `signalfx-dotnet-tracing` MSI package to download and install from @@ -407,7 +404,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. - `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 `OTEL_SERVICE_NAME` environment variable in the Windows registry. (**default:** ``) @@ -438,6 +435,6 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. 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. From e4d8f9d6bfe37e392237ff74b4ded37b7b9eaeca Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 21 Jan 2025 14:25:52 -0800 Subject: [PATCH 06/31] Update Ansible changelog --- deployments/ansible/CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) 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 💡 From 822b435a00146a751c62de4c7f9a5f0b9136b036 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 12:04:45 -0800 Subject: [PATCH 07/31] Download and running Splunk OTel .NET Install --- deployments/ansible/roles/collector/README.md | 22 +++--- .../ansible/roles/collector/defaults/main.yml | 2 +- ...in_install_dotnet_auto_instrumentation.yml | 69 ++++++++++--------- 3 files changed, 49 insertions(+), 44 deletions(-) diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 5135d75302..67d683074a 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -339,22 +339,22 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. https://docs.splunk.com/observability/en/gdi/get-data-in/application/otel-dotnet/get-started.html). (**default:** `false`) - `splunk_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-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{{ splunk_dotnet_auto_instrumentation_version }}/signalfx-dotnet-tracing-{{ splunk_dotnet_auto_instrumentation_version }}-x64.msi`. + `https://github.com/signalfx/splunk-otel-dotnet/releases/download/v{{ splunk_dotnet_auto_instrumentation_version }}`. (**default:** `latest`) -- `splunk_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 + `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:** ``) @@ -362,7 +362,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. a token to authenticate with the GitHub API when making requests to get the latest `signalfx-dotnet-tracing` release. A token is recommended when `splunk_dotnet_auto_instrumentation_version` is `latest` or when not using - `splunk_dotnet_auto_instrumentation_msi_url` since unauthenticated requests + `splunk_dotnet_auto_instrumentation_url` since unauthenticated requests are [rate-limited](https://docs.github.com/en/rest/rate-limit) by GitHub. (**default:** ``) diff --git a/deployments/ansible/roles/collector/defaults/main.yml b/deployments/ansible/roles/collector/defaults/main.yml index 9a944cd675..a63f71985b 100644 --- a/deployments/ansible/roles/collector/defaults/main.yml +++ b/deployments/ansible/roles/collector/defaults/main.yml @@ -89,7 +89,7 @@ splunk_otel_collector_additional_env_vars: {} # Configure Auto Instrumentation for .NET install_splunk_dotnet_auto_instrumentation: false splunk_dotnet_auto_instrumentation_version: latest -splunk_dotnet_auto_instrumentation_msi_url: "" +splunk_dotnet_auto_instrumentation_url: "" splunk_dotnet_auto_instrumentation_github_token: "" splunk_dotnet_auto_instrumentation_system_wide: false splunk_dotnet_auto_instrumentation_environment: "" 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 21be4492ae..5f4d01ee26 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,7 +1,7 @@ --- -- 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: @@ -11,54 +11,59 @@ proxy_username: "{{ win_proxy_username | default(omit) }}" use_proxy: "{{ win_use_proxy }}" register: latest_dotnet_release - when: splunk_dotnet_auto_instrumentation_version == "latest" and not splunk_dotnet_auto_instrumentation_msi_url + when: splunk_dotnet_auto_instrumentation_version == "latest" and not splunk_dotnet_auto_instrumentation_url + +- name: Set splunk-otel-dotnet version + set_fact: + splunk_dotnet_version: "{{ latest_dotnet_release.json.tag_name }}" + 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 splunk_dotnet_auto_instrumentation_msi_url -%} - {{ splunk_dotnet_auto_instrumentation_msi_url }} + {%- if splunk_dotnet_auto_instrumentation_url -%} + {{ splunk_dotnet_auto_instrumentation_url }} {%- else -%} {%- if splunk_dotnet_auto_instrumentation_version != "latest" -%} {%- set version = splunk_dotnet_auto_instrumentation_version.lstrip("v") -%} - {{ base_url }}/v{{ version }}/signalfx-dotnet-tracing-{{ version }}-x64.msi + {{ 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: Get installed signalfx-dotnet-tracing MSI version + +- name: Install splunk-otel-dotnet 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 + $ErrorActionPreference = "Stop" + Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" + Install-OpenTelemetryCore -LocalPath "${Env:TEMP}\splunk-opentelemetry-dotnet-windows.zip" + if ((Get-Service -name "W3SVC" -ErrorAction SilentlyContinue) -And (Get-Service -name "WAS" -ErrorAction SilentlyContinue)) { Register-OpenTelemetryForIIS } + + notify: "reset iis" - name: Create registry path ansible.windows.win_regedit: @@ -74,8 +79,8 @@ {%- 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) -%} + {%- if splunk_dotnet_version.stdout != "" -%} + {%- set method = "splunk.zc.method:splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} {%- endif -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} @@ -110,8 +115,8 @@ {%- 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) -%} + {%- if splunk_dotnet_version.stdout != "" -%} + {%- set method = "splunk.zc.method:splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} {%- endif -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} From 55cac931be87b66be83229717b8efce5142a9d95 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 12:45:06 -0800 Subject: [PATCH 08/31] Lint fixes --- deployments/ansible/roles/collector/tasks/vars.yml | 5 ++++- .../tasks/win_install_dotnet_auto_instrumentation.yml | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index 36180bafcc..2f0a249975 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -64,7 +64,10 @@ COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-dotnet-tracing-1.0.0" + OTEL_RESOURCE_ATTRIBUTES: >- + deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, + {{ splunk_dotnet_auto_instrumentation_global_tags }}, + splunk.zc.method=splunk-dotnet-tracing-1.0.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 }}" 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 5f4d01ee26..3934621bc2 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 @@ -61,8 +61,9 @@ $ErrorActionPreference = "Stop" Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" Install-OpenTelemetryCore -LocalPath "${Env:TEMP}\splunk-opentelemetry-dotnet-windows.zip" - if ((Get-Service -name "W3SVC" -ErrorAction SilentlyContinue) -And (Get-Service -name "WAS" -ErrorAction SilentlyContinue)) { Register-OpenTelemetryForIIS } - + $w3svc = Get-Service -name "W3SVC" -ErrorAction SilentlyContinue + $was = Get-Service -name "WAS" -ErrorAction SilentlyContinue + if ($w3svc -And $was) { Register-OpenTelemetryForIIS } notify: "reset iis" - name: Create registry path From 36c0e74d1d70446e811b182f94348c1e9b944985 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 13:07:51 -0800 Subject: [PATCH 09/31] Change version for converge test --- deployments/ansible/molecule/custom_vars/windows-converge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index 1d5e7c06e2..1e2e9cbce9 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -21,7 +21,7 @@ MY_CUSTOM_VAR1: value1 MY_CUSTOM_VAR2: value2 install_splunk_dotnet_auto_instrumentation: true - splunk_dotnet_auto_instrumentation_version: 1.0.0 + 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 From ba681571cab1c8a78c885586de9285920af3dbe8 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 15:16:30 -0800 Subject: [PATCH 10/31] Use win_powershell instead of the generic win_shell --- .../win_install_dotnet_auto_instrumentation.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 3934621bc2..397b9a573e 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 @@ -55,15 +55,15 @@ use_proxy: "{{ win_use_proxy }}" register: splunk_dotnet_zip - - name: Install splunk-otel-dotnet - ansible.windows.win_shell: | - $ErrorActionPreference = "Stop" - 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 } + 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 } notify: "reset iis" - name: Create registry path From c003faf5166faf11d919ed15214563c7c1299089 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 16:24:22 -0800 Subject: [PATCH 11/31] Update CLR Profiler GUID --- deployments/ansible/molecule/custom_vars/windows-verify.yml | 4 ++-- .../ansible/molecule/with_instrumentation/windows-verify.yml | 4 ++-- deployments/ansible/roles/collector/README.md | 4 ++-- deployments/ansible/roles/collector/tasks/vars.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index 5726549483..a4349baefa 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -16,9 +16,9 @@ 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}" + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method:splunk-dotnet-tracing-1.0.0" OTEL_SERVICE_NAME: "test-service-name" SPLUNK_PROFILER_ENABLED: "true" diff --git a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml index 69e1eb229f..502f481961 100644 --- a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml @@ -14,9 +14,9 @@ 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}" + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" SPLUNK_PROFILER_ENABLED: "false" SPLUNK_PROFILER_MEMORY_ENABLED: "false" tasks: diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 67d683074a..816b2af55b 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -380,9 +380,9 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. 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 + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-dotnet-tracing-1.0.0" OTEL_SERVICE_NAME: "{{ splunk_dotnet_auto_instrumentation_service_name }}" SPLUNK_PROFILER_ENABLED: "{{ splunk_dotnet_auto_instrumentation_enable_profiler }}" diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index 2f0a249975..80fce4edb7 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -61,9 +61,9 @@ 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}" + CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" OTEL_RESOURCE_ATTRIBUTES: >- deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, {{ splunk_dotnet_auto_instrumentation_global_tags }}, From e15eedfa9b79aab968933cb1a3dd77e1e2b81b77 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 16:27:58 -0800 Subject: [PATCH 12/31] Remove hardcoded version --- deployments/ansible/roles/collector/tasks/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index 80fce4edb7..de500c475d 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -67,7 +67,7 @@ OTEL_RESOURCE_ATTRIBUTES: >- deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, {{ splunk_dotnet_auto_instrumentation_global_tags }}, - splunk.zc.method=splunk-dotnet-tracing-1.0.0 + splunk.zc.method=splunk-dotnet-tracing-{{ splunk_dotnet_auto_instrumentation_version }} 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 }}" From f776e896f119103418b4a9b75921a940cc27f181 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 16:52:30 -0800 Subject: [PATCH 13/31] Missed replacements --- .../molecule/custom_vars/windows-verify.yml | 20 +------------------ deployments/ansible/roles/collector/README.md | 4 ++-- .../ansible/roles/collector/tasks/vars.yml | 2 +- ...in_install_dotnet_auto_instrumentation.yml | 5 ++--- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index a4349baefa..6b1ad30ade 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -19,7 +19,7 @@ COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method:splunk-dotnet-tracing-1.0.0" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method=splunk-otel-dotnet-1.8.0" OTEL_SERVICE_NAME: "test-service-name" SPLUNK_PROFILER_ENABLED: "true" SPLUNK_PROFILER_MEMORY_ENABLED: "true" @@ -90,24 +90,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 diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 816b2af55b..b45778bf3e 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -360,7 +360,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. - `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 + 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. @@ -383,7 +383,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required CORECLR_ENABLE_PROFILING: "1" # Required CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-dotnet-tracing-1.0.0" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},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 }}" diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index de500c475d..5aa6f076a2 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -67,7 +67,7 @@ OTEL_RESOURCE_ATTRIBUTES: >- deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, {{ splunk_dotnet_auto_instrumentation_global_tags }}, - splunk.zc.method=splunk-dotnet-tracing-{{ splunk_dotnet_auto_instrumentation_version }} + splunk.zc.method=splunk-otel-dotnet-{{ splunk_dotnet_version }} 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 }}" 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 397b9a573e..2baf1c655f 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 @@ -64,7 +64,6 @@ $w3svc = Get-Service -name "W3SVC" -ErrorAction SilentlyContinue $was = Get-Service -name "WAS" -ErrorAction SilentlyContinue if ($w3svc -And $was) { Register-OpenTelemetryForIIS } - notify: "reset iis" - name: Create registry path ansible.windows.win_regedit: @@ -81,7 +80,7 @@ {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} {%- set method = "" -%} {%- if splunk_dotnet_version.stdout != "" -%} - {%- set method = "splunk.zc.method:splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} {%- endif -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} @@ -117,7 +116,7 @@ {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} {%- set method = "" -%} {%- if splunk_dotnet_version.stdout != "" -%} - {%- set method = "splunk.zc.method:splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} {%- endif -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} From ff6a39bdfc29e294cec3821b39333eb1bbb23f9a Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Thu, 23 Jan 2025 17:22:25 -0800 Subject: [PATCH 14/31] Do not set OTel zc for dotnet on default env vars --- deployments/ansible/roles/collector/tasks/vars.yml | 3 +-- .../tasks/win_install_dotnet_auto_instrumentation.yml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index 5aa6f076a2..4d81ca6212 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -66,8 +66,7 @@ CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" OTEL_RESOURCE_ATTRIBUTES: >- deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, - {{ splunk_dotnet_auto_instrumentation_global_tags }}, - splunk.zc.method=splunk-otel-dotnet-{{ splunk_dotnet_version }} + {{ splunk_dotnet_auto_instrumentation_global_tags }} 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 }}" 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 2baf1c655f..2e515daa32 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 @@ -77,7 +77,7 @@ {%- if (item.value | type_debug) == "bool" -%} {%- set value = item.value | string | lower -%} {%- endif -%} - {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} + {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} {%- set method = "" -%} {%- if splunk_dotnet_version.stdout != "" -%} {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} @@ -113,7 +113,7 @@ {%- if (item.value | type_debug) == "bool" -%} {%- set value = item.value | string | lower -%} {%- endif -%} - {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} + {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} {%- set method = "" -%} {%- if splunk_dotnet_version.stdout != "" -%} {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} From 95d09e3d79fa942f0b93c9d99e3935f76ac97948 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Fri, 24 Jan 2025 14:42:29 -0800 Subject: [PATCH 15/31] Fix splunk.zc.method --- .../win_install_dotnet_auto_instrumentation.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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 2e515daa32..f5fec1f425 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 @@ -13,11 +13,6 @@ register: latest_dotnet_release when: splunk_dotnet_auto_instrumentation_version == "latest" and not splunk_dotnet_auto_instrumentation_url -- name: Set splunk-otel-dotnet version - set_fact: - splunk_dotnet_version: "{{ latest_dotnet_release.json.tag_name }}" - 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: |- @@ -78,10 +73,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "" -%} - {%- if splunk_dotnet_version.stdout != "" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} - {%- endif -%} + {%- set method = "splunk.zc.method=splunk-ansible" -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} @@ -114,10 +106,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "" -%} - {%- if splunk_dotnet_version.stdout != "" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + (splunk_dotnet_version.stdout | trim) -%} - {%- endif -%} + {%- set method = "splunk.zc.method=splunk-ansible" -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} {{ value | string }} From 28e878f0d9cde691a64867b8026fd69183d5e05a Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Fri, 24 Jan 2025 15:18:37 -0800 Subject: [PATCH 16/31] Skip molecure idempotence test for install splunk-otel-dotnet --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 1 + 1 file changed, 1 insertion(+) 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 f5fec1f425..037ac2a723 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 @@ -59,6 +59,7 @@ $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: Create registry path ansible.windows.win_regedit: From 6096e43e436f55cf878af3c97992d59d80f382cc Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Sat, 25 Jan 2025 07:51:33 -0800 Subject: [PATCH 17/31] Change splunk.zc.method --- deployments/ansible/molecule/custom_vars/windows-verify.yml | 2 +- deployments/ansible/roles/collector/README.md | 2 +- .../tasks/win_install_dotnet_auto_instrumentation.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index 6b1ad30ade..8bff04919e 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -19,7 +19,7 @@ COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method=splunk-otel-dotnet-1.8.0" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method=splunk-otel-dotnet-1.0.0 OTEL_SERVICE_NAME: "test-service-name" SPLUNK_PROFILER_ENABLED: "true" SPLUNK_PROFILER_MEMORY_ENABLED: "true" diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index b45778bf3e..573011a27c 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -383,7 +383,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required CORECLR_ENABLE_PROFILING: "1" # Required CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-otel-dotnet-1.8.0" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-otel-dotnet-1.0.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 }}" 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 037ac2a723..816267895e 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 @@ -74,7 +74,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-ansible" -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-1.0.0" -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} @@ -107,7 +107,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-ansible" -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-1.0.0" -%} {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} {%- endif -%} {{ value | string }} From ba471b69f9093252914b465a884e65f208a2d360 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Sat, 25 Jan 2025 08:37:55 -0800 Subject: [PATCH 18/31] Fix missing double-quotes --- deployments/ansible/molecule/custom_vars/windows-verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index 8bff04919e..d471361e79 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -19,7 +19,7 @@ COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method=splunk-otel-dotnet-1.0.0 + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method=splunk-otel-dotnet-1.0.0" OTEL_SERVICE_NAME: "test-service-name" SPLUNK_PROFILER_ENABLED: "true" SPLUNK_PROFILER_MEMORY_ENABLED: "true" From a54c14bc0e1dec7f9187e8bb36fe46b89b36642e Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 16:31:27 -0800 Subject: [PATCH 19/31] Fix OTEL_RESOURCE_ATTRIBUTES --- .../molecule/custom_vars/windows-converge.yml | 2 +- .../molecule/custom_vars/windows-verify.yml | 2 +- deployments/ansible/roles/collector/README.md | 10 ++-------- .../ansible/roles/collector/defaults/main.yml | 1 - .../win_install_dotnet_auto_instrumentation.yml | 17 +++++++++++++---- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index 1e2e9cbce9..a3b4a8c642 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -27,7 +27,7 @@ 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_global_tags: dotnet-tag:dotnet-tag-value + splunk_dotnet_auto_instrumentation_global_tags: dotnet-tag=dotnet-tag-value splunk_dotnet_auto_instrumentation_additional_options: SPLUNK_DOTNET_VAR1: dotnet-value1 SPLUNK_DOTNET_VAR2: dotnet-value2 diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index d471361e79..f85250b7f8 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -19,7 +19,7 @@ COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,splunk.zc.method=splunk-otel-dotnet-1.0.0" + OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=test-environment,dotnet-tag=dotnet-tag-value,splunk.zc.method=splunk-otel-dotnet-1.8.0" OTEL_SERVICE_NAME: "test-service-name" SPLUNK_PROFILER_ENABLED: "true" SPLUNK_PROFILER_MEMORY_ENABLED: "true" diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 573011a27c..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:** ``) @@ -383,7 +383,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required CORECLR_ENABLE_PROFILING: "1" # Required CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" # Required - OTEL_RESOURCE_ATTRIBUTES: "deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }},{{ splunk_dotnet_auto_instrumentation_global_tags }},splunk.zc.method=splunk-otel-dotnet-1.0.0" + 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 }}" @@ -419,12 +419,6 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. be assigned to the `SPLUNK_PROFILER_MEMORY_ENABLED` environment variable in the Windows registry. (**default:** `false`) -- `splunk_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 - added to the `OTEL_RESOURCE_ATTRIBUTES` environment variable in the Windows - registry. (**default**: ``) - - `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:** `{}`) diff --git a/deployments/ansible/roles/collector/defaults/main.yml b/deployments/ansible/roles/collector/defaults/main.yml index a63f71985b..d46b97129d 100644 --- a/deployments/ansible/roles/collector/defaults/main.yml +++ b/deployments/ansible/roles/collector/defaults/main.yml @@ -96,6 +96,5 @@ 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_global_tags: "" splunk_dotnet_auto_instrumentation_iisreset: true splunk_dotnet_auto_instrumentation_additional_options: {} 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 816267895e..a74fe9e7f9 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 @@ -61,6 +61,15 @@ if ($w3svc -And $was) { Register-OpenTelemetryForIIS } tags: molecule-idempotence-notest +- name: Get installed Splunk OpenTelemetry .NET version + ansible.windows.win_powershell: + error_action: stop + script: | + Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" + $splunk_otel_dotnet_installed_version = Get-OpenTelemetryDotNetVersion + echo $splunk_otel_dotnet_installed_version + register: splunk_otel_dotnet_installed_version + - name: Create registry path ansible.windows.win_regedit: path: "{{ iis_registry_key }}" @@ -74,8 +83,8 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-1.0.0" -%} - {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_installed_version.lstrip("v") -%} + {%- set value = (item.value + "," + method) | trim(",") -%} {%- endif -%} {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} loop: > @@ -107,8 +116,8 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-1.0.0" -%} - {%- set value = (method + "," + splunk_dotnet_auto_instrumentation_global_tags) | trim(",") -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_installed_version.lstrip("v") -%} + {%- set value = (item.value + "," + method) | trim(",") -%} {%- endif -%} {{ value | string }} type: string From 5b4aabf606b2fbbf6cedc831533c6a2dca115eb0 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 16:39:03 -0800 Subject: [PATCH 20/31] Fix line too long --- deployments/ansible/molecule/custom_vars/windows-verify.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index f85250b7f8..e1bf7e0265 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -19,7 +19,8 @@ COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" 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.8.0" + OTEL_RESOURCE_ATTRIBUTES: >- + deployment.environment=test-environment,dotnet-tag=dotnet-tag-value,splunk.zc.method=splunk-otel-dotnet-1.8.0 OTEL_SERVICE_NAME: "test-service-name" SPLUNK_PROFILER_ENABLED: "true" SPLUNK_PROFILER_MEMORY_ENABLED: "true" From 79d0cc5e6c656bd1a81c2a71c9bf2c789d060d52 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 17:13:20 -0800 Subject: [PATCH 21/31] Remove leftover *_global_tags --- deployments/ansible/molecule/custom_vars/windows-converge.yml | 2 +- deployments/ansible/roles/collector/tasks/vars.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index a3b4a8c642..237673f8cc 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -27,10 +27,10 @@ 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_global_tags: dotnet-tag=dotnet-tag-value 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/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index 4d81ca6212..d3a5758259 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -66,7 +66,7 @@ CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" OTEL_RESOURCE_ATTRIBUTES: >- deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, - {{ splunk_dotnet_auto_instrumentation_global_tags }} + {{ 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 }}" From fa243640b052951d626775a24d52b78907a213e5 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 17:48:09 -0800 Subject: [PATCH 22/31] Fix cmdlet name typo --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a74fe9e7f9..b63cf2049c 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 @@ -66,7 +66,7 @@ error_action: stop script: | Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" - $splunk_otel_dotnet_installed_version = Get-OpenTelemetryDotNetVersion + $splunk_otel_dotnet_installed_version = Get-OpenTelemetryInstallVersion echo $splunk_otel_dotnet_installed_version register: splunk_otel_dotnet_installed_version From 54bd4ba96436a8e15779cc29bbdb5985bbd8bed6 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 19:38:04 -0800 Subject: [PATCH 23/31] Fix code to get installed version --- .../tasks/win_install_dotnet_auto_instrumentation.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 b63cf2049c..d6dc136787 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 @@ -65,9 +65,8 @@ ansible.windows.win_powershell: error_action: stop script: | - Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" - $splunk_otel_dotnet_installed_version = Get-OpenTelemetryInstallVersion - echo $splunk_otel_dotnet_installed_version + Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" | Out-Null + Get-OpenTelemetryInstallVersion register: splunk_otel_dotnet_installed_version - name: Create registry path From 5139af42c1d96021fd3fdce1eadacd0aa7ad11c1 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 20:04:42 -0800 Subject: [PATCH 24/31] Return value for win_powershell --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d6dc136787..756441a787 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 @@ -82,7 +82,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_installed_version.lstrip("v") -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_installed_version.output[0].lstrip("v") -%} {%- set value = (item.value + "," + method) | trim(",") -%} {%- endif -%} {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} From ec518201055d40c49dd282be94f70392203cce14 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 20:20:59 -0800 Subject: [PATCH 25/31] Fix lint: long line --- .../tasks/win_install_dotnet_auto_instrumentation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 756441a787..e1759e1f55 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 @@ -67,7 +67,7 @@ script: | Import-Module "${Env:TEMP}\Splunk.OTel.DotNet.psm1" | Out-Null Get-OpenTelemetryInstallVersion - register: splunk_otel_dotnet_installed_version + register: splunk_otel_dotnet_version - name: Create registry path ansible.windows.win_regedit: @@ -82,7 +82,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_installed_version.output[0].lstrip("v") -%} + {%- 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)] }} @@ -115,7 +115,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_installed_version.lstrip("v") -%} + {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_version.lstrip("v") -%} {%- set value = (item.value + "," + method) | trim(",") -%} {%- endif -%} {{ value | string }} From 81cf2ffdab19ad495cd910ef00d94cf51ca2526f Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 20:43:24 -0800 Subject: [PATCH 26/31] Fix "Set system-wide registry value" task --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e1759e1f55..6da86be6bf 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 @@ -115,7 +115,7 @@ {%- set value = item.value | string | lower -%} {%- endif -%} {%- if item.key == "OTEL_RESOURCE_ATTRIBUTES" -%} - {%- set method = "splunk.zc.method=splunk-otel-dotnet-" + splunk_otel_dotnet_version.lstrip("v") -%} + {%- 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 }} From 372af13b0c019ab07ecc3c91f0a73ad62d295734 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 21:06:01 -0800 Subject: [PATCH 27/31] Task to get .NET instrumentation is not idempotent --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 1 + 1 file changed, 1 insertion(+) 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 6da86be6bf..553cb50924 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 @@ -68,6 +68,7 @@ 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: From 67b6ed0f0043ab395e29fc991ca10b9aaed6538e Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 22:06:38 -0800 Subject: [PATCH 28/31] Another idempotency skip --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 2 ++ 1 file changed, 2 insertions(+) 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 553cb50924..212deba4d7 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 @@ -89,6 +89,7 @@ {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} loop: > {{ dotnet_options | default({}) | combine(splunk_dotnet_auto_instrumentation_additional_options) | dict2items }} + tags: molecule-idempotence-notest - name: Set IIS registry value ansible.windows.win_regedit: @@ -125,3 +126,4 @@ {{ 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 From e8c6f7d6e8a10097151a9b1e2ec8fc85c1de5ade Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 22:26:29 -0800 Subject: [PATCH 29/31] Skip idempotency test for "Set IIS registry value" --- .../collector/tasks/win_install_dotnet_auto_instrumentation.yml | 1 + 1 file changed, 1 insertion(+) 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 212deba4d7..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 @@ -99,6 +99,7 @@ data: "{{ options_list | sort }}" type: multistring notify: "reset iis" + tags: molecule-idempotence-notest - name: Create registry path ansible.windows.win_regedit: From f22af2ff2e6e805cd6fa52d9427e53917e940663 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 23:11:19 -0800 Subject: [PATCH 30/31] Fix multiline initialization --- deployments/ansible/roles/collector/tasks/vars.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index d3a5758259..3c6baf5a4a 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -64,9 +64,10 @@ COR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" CORECLR_ENABLE_PROFILING: "1" CORECLR_PROFILER: "{918728DD-259F-4A6A-AC2B-B85E1B658318}" - OTEL_RESOURCE_ATTRIBUTES: >- - deployment.environment={{ splunk_dotnet_auto_instrumentation_environment }}, - {{ splunk_otel_auto_instrumentation_resource_attributes }} + 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 }}" From d6ee313082aff7ba6014658176d822c3af677bac Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Mon, 27 Jan 2025 23:43:03 -0800 Subject: [PATCH 31/31] Workaround version returning version of OTel not Splunk --- deployments/ansible/molecule/custom_vars/windows-verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index e1bf7e0265..7e4adbc351 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -20,7 +20,7 @@ CORECLR_ENABLE_PROFILING: "1" 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.8.0 + 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"