diff --git a/deployments/ansible/CHANGELOG.md b/deployments/ansible/CHANGELOG.md index be201b4974..e0c7c123ba 100644 --- a/deployments/ansible/CHANGELOG.md +++ b/deployments/ansible/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## ansible-v0.28.0 + +- Initial support for [Splunk OpenTelemetry for .NET](https://github.com/signalfx/splunk-otel-dotnet) Auto + Instrumentation on Linux (x86_64/amd64 only): + - The .NET SDK is activated by default if the `install_splunk_otel_auto_instrumentation` option is set to `true` and + `splunk_otel_auto_instrumentation_version` is `latest` or >= `0.99.0`. + - Set the `splunk_otel_auto_instrumentation_sdks` option to `java` and/or `nodejs` to skip .NET auto instrumentation. ## ansible-v0.27.0 diff --git a/deployments/ansible/galaxy.yml b/deployments/ansible/galaxy.yml index cffedeacc2..89ba739423 100644 --- a/deployments/ansible/galaxy.yml +++ b/deployments/ansible/galaxy.yml @@ -2,7 +2,7 @@ namespace: signalfx name: splunk_otel_collector description: Ansible collection for Splunk OpenTelemetry Collector -version: 0.27.0 +version: 0.28.0 readme: README.md authors: - Splunk Inc. diff --git a/deployments/ansible/molecule/with_instrumentation/verify.yml b/deployments/ansible/molecule/with_instrumentation/verify.yml index 66786b681f..09bc028cb9 100644 --- a/deployments/ansible/molecule/with_instrumentation/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/verify.yml @@ -23,6 +23,7 @@ loop: - /etc/splunk/zeroconfig/java.conf - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf register: new_config_files - name: Assert the new config files do not exist diff --git a/deployments/ansible/molecule/with_instrumentation_preload_custom/verify.yml b/deployments/ansible/molecule/with_instrumentation_preload_custom/verify.yml index 61edec7a22..de3cd59a42 100644 --- a/deployments/ansible/molecule/with_instrumentation_preload_custom/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_preload_custom/verify.yml @@ -76,6 +76,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "{{ item }}" + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "OTEL_RESOURCE_ATTRIBUTES=\ @@ -89,6 +107,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains OTEL_SERVICE_NAME ansible.builtin.lineinfile: @@ -101,6 +120,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED ansible.builtin.lineinfile: @@ -113,6 +133,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED ansible.builtin.lineinfile: @@ -125,6 +146,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED ansible.builtin.lineinfile: @@ -137,6 +159,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT ansible.builtin.lineinfile: @@ -149,3 +172,4 @@ loop: - java.conf - node.conf + - dotnet.conf diff --git a/deployments/ansible/molecule/with_instrumentation_preload_default/verify.yml b/deployments/ansible/molecule/with_instrumentation_preload_default/verify.yml index 455a128b53..20c30deb8b 100644 --- a/deployments/ansible/molecule/with_instrumentation_preload_default/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_preload_default/verify.yml @@ -67,6 +67,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "{{ item }}" + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "OTEL_RESOURCE_ATTRIBUTES=\ @@ -79,6 +97,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config does not contain OTEL_SERVICE_NAME ansible.builtin.lineinfile: @@ -91,6 +110,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED ansible.builtin.lineinfile: @@ -103,6 +123,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED ansible.builtin.lineinfile: @@ -115,6 +136,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED ansible.builtin.lineinfile: @@ -127,6 +149,7 @@ loop: - java.conf - node.conf + - dotnet.conf - name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT ansible.builtin.lineinfile: @@ -139,3 +162,4 @@ loop: - java.conf - node.conf + - dotnet.conf diff --git a/deployments/ansible/molecule/with_instrumentation_preload_dotnet/Dockerfile.j2 b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/Dockerfile.j2 new file mode 120000 index 0000000000..867ec5c3dc --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/Dockerfile.j2 @@ -0,0 +1 @@ +../default/Dockerfile.j2 \ No newline at end of file diff --git a/deployments/ansible/molecule/with_instrumentation_preload_dotnet/converge.yml b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/converge.yml new file mode 100644 index 0000000000..41fd359f62 --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/converge.yml @@ -0,0 +1,16 @@ +--- +- name: Converge scenario with auto-instrumentation installation + hosts: all + become: yes + vars: + splunk_access_token: fake-token + splunk_realm: fake-realm + install_splunk_otel_auto_instrumentation: true + splunk_otel_auto_instrumentation_sdks: + - dotnet + tasks: + - name: "Install nodejs for tests" + ansible.builtin.import_tasks: ../shared/install_nodejs.yml + - name: "Include signalfx.splunk_otel_collector.collector role" + include_role: + name: "collector" diff --git a/deployments/ansible/molecule/with_instrumentation_preload_dotnet/molecule.yml b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/molecule.yml new file mode 100644 index 0000000000..2333d7016e --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/molecule.yml @@ -0,0 +1 @@ +# no default config provided, make sure to set --base-config molecule argument instead diff --git a/deployments/ansible/molecule/with_instrumentation_preload_dotnet/verify.yml b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/verify.yml new file mode 100644 index 0000000000..5f033e0655 --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_preload_dotnet/verify.yml @@ -0,0 +1,143 @@ +--- +- name: Verify scenario with auto-instrumentation installation + hosts: all + gather_facts: false + tasks: + - name: Populate service facts + ansible.builtin.service_facts: + + - name: Assert splunk-otel-collector service is running + assert: + that: ansible_facts.services['splunk-otel-collector.service'].state == 'running' + + - name: Populate package facts + ansible.builtin.package_facts: + + - name: Get splunk-otel-auto-instrumentation version + set_fact: + auto_instrumentation_version: "{{ ansible_facts.packages['splunk-otel-auto-instrumentation'][0].version }}" + + - name: Check if splunk-otel-js is installed + shell: npm ls @splunk/otel + args: + chdir: /usr/lib/splunk-instrumentation/splunk-otel-js + register: npm_ls + failed_when: npm_ls.rc == 0 + + - name: Check for the old config file + ansible.builtin.stat: + path: /usr/lib/splunk-instrumentation/instrumentation.conf + register: old_config + + - name: Assert the old config file does not exist + assert: + that: not old_config.stat.exists + + - name: Check for systemd drop-in file + ansible.builtin.stat: + path: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + register: systemd + + - name: Assert systemd drop-in file does not exist + assert: + that: not systemd.stat.exists + + - name: Check for Java config file + ansible.builtin.stat: + path: /etc/splunk/zeroconfig/java.conf + register: java_config + + - name: Assert Java config file does not exist + assert: + that: not java_config.stat.exists + + - name: Check for Node.js config file + ansible.builtin.stat: + path: /etc/splunk/zeroconfig/node.conf + register: node_config + + - name: Assert Node.js config file does not exist + assert: + that: not node_config.stat.exists + + - name: Assert /etc/ld.so.preload contains path to libsplunk.so + ansible.builtin.lineinfile: + line: /usr/lib/splunk-instrumentation/libsplunk.so + dest: /etc/ld.so.preload + state: present + check_mode: yes + register: preload + failed_when: preload is changed + + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "{{ item }}" + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES + ansible.builtin.lineinfile: + line: "OTEL_RESOURCE_ATTRIBUTES=\ + splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}" + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config does not contain OTEL_SERVICE_NAME + ansible.builtin.lineinfile: + regexp: '.*OTEL_SERVICE_NAME.*' + dest: /etc/splunk/zeroconfig/dotnet.conf + state: absent + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED + ansible.builtin.lineinfile: + line: SPLUNK_PROFILER_ENABLED=false + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED + ansible.builtin.lineinfile: + line: SPLUNK_PROFILER_MEMORY_ENABLED=false + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED + ansible.builtin.lineinfile: + line: SPLUNK_METRICS_ENABLED=false + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT + ansible.builtin.lineinfile: + line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317 + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed diff --git a/deployments/ansible/molecule/with_instrumentation_preload_java/verify.yml b/deployments/ansible/molecule/with_instrumentation_preload_java/verify.yml index 3360d88ef7..b8f128fd1f 100644 --- a/deployments/ansible/molecule/with_instrumentation_preload_java/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_preload_java/verify.yml @@ -51,6 +51,15 @@ assert: that: not node_config.stat.exists + - name: Check for .NET config file + ansible.builtin.stat: + path: /etc/splunk/zeroconfig/dotnet.conf + register: dotnet_config + + - name: Assert .NET config file does not exist + assert: + that: not dotnet_config.stat.exists + - name: Assert /etc/ld.so.preload contains path to libsplunk.so ansible.builtin.lineinfile: line: /usr/lib/splunk-instrumentation/libsplunk.so diff --git a/deployments/ansible/molecule/with_instrumentation_preload_nodejs/verify.yml b/deployments/ansible/molecule/with_instrumentation_preload_nodejs/verify.yml index 2abb12d616..ce54e04222 100644 --- a/deployments/ansible/molecule/with_instrumentation_preload_nodejs/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_preload_nodejs/verify.yml @@ -49,6 +49,15 @@ assert: that: not java_config.stat.exists + - name: Check for .NET config file + ansible.builtin.stat: + path: /etc/splunk/zeroconfig/dotnet.conf + register: dotnet_config + + - name: Assert .NET config file does not exist + assert: + that: not dotnet_config.stat.exists + - name: Assert /etc/ld.so.preload contains path to libsplunk.so ansible.builtin.lineinfile: line: /usr/lib/splunk-instrumentation/libsplunk.so diff --git a/deployments/ansible/molecule/with_instrumentation_preload_without_npm/verify.yml b/deployments/ansible/molecule/with_instrumentation_preload_without_npm/verify.yml index f1103dd33b..488fcb5d32 100644 --- a/deployments/ansible/molecule/with_instrumentation_preload_without_npm/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_preload_without_npm/verify.yml @@ -60,57 +60,93 @@ register: config failed_when: config is changed + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "{{ item }}" + dest: /etc/splunk/zeroconfig/dotnet.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "OTEL_RESOURCE_ATTRIBUTES=\ splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}" - dest: /etc/splunk/zeroconfig/java.conf + dest: "/etc/splunk/zeroconfig/{{ item }}" state: present check_mode: yes register: config failed_when: config is changed + loop: + - java.conf + - dotnet.conf - name: Assert instrumentation config does not contain OTEL_SERVICE_NAME ansible.builtin.lineinfile: regexp: '.*OTEL_SERVICE_NAME.*' - dest: /etc/splunk/zeroconfig/java.conf + dest: "/etc/splunk/zeroconfig/{{ item }}" state: absent check_mode: yes register: config failed_when: config is changed + loop: + - java.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED ansible.builtin.lineinfile: line: SPLUNK_PROFILER_ENABLED=false - dest: /etc/splunk/zeroconfig/java.conf + dest: "/etc/splunk/zeroconfig/{{ item }}" state: present check_mode: yes register: config failed_when: config is changed + loop: + - java.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED ansible.builtin.lineinfile: line: SPLUNK_PROFILER_MEMORY_ENABLED=false - dest: /etc/splunk/zeroconfig/java.conf + dest: "/etc/splunk/zeroconfig/{{ item }}" state: present check_mode: yes register: config failed_when: config is changed + loop: + - java.conf + - dotnet.conf - name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED ansible.builtin.lineinfile: line: SPLUNK_METRICS_ENABLED=false - dest: /etc/splunk/zeroconfig/java.conf + dest: "/etc/splunk/zeroconfig/{{ item }}" state: present check_mode: yes register: config failed_when: config is changed + loop: + - java.conf + - dotnet.conf - name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT ansible.builtin.lineinfile: line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317 - dest: /etc/splunk/zeroconfig/java.conf + dest: "/etc/splunk/zeroconfig/{{ item }}" state: present check_mode: yes register: config failed_when: config is changed + loop: + - java.conf + - dotnet.conf diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_custom/verify.yml b/deployments/ansible/molecule/with_instrumentation_systemd_custom/verify.yml index 4b1cc43e7f..3078484951 100644 --- a/deployments/ansible/molecule/with_instrumentation_systemd_custom/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_systemd_custom/verify.yml @@ -38,6 +38,7 @@ - /usr/lib/splunk-instrumentation/instrumentation.conf - /etc/splunk/zeroconfig/java.conf - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf register: config_files - name: Assert preload config files do not exist @@ -65,6 +66,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "DefaultEnvironment=\"{{ item }}\"" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "DefaultEnvironment=\"OTEL_RESOURCE_ATTRIBUTES=\ diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_default/verify.yml b/deployments/ansible/molecule/with_instrumentation_systemd_default/verify.yml index 3dd9a3ac3d..3993695b75 100644 --- a/deployments/ansible/molecule/with_instrumentation_systemd_default/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_systemd_default/verify.yml @@ -38,6 +38,7 @@ - /usr/lib/splunk-instrumentation/instrumentation.conf - /etc/splunk/zeroconfig/java.conf - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf register: config_files - name: Assert preload config files do not exist @@ -65,6 +66,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "DefaultEnvironment=\"{{ item }}\"" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "DefaultEnvironment=\"OTEL_RESOURCE_ATTRIBUTES=\ diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/Dockerfile.j2 b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/Dockerfile.j2 new file mode 120000 index 0000000000..867ec5c3dc --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/Dockerfile.j2 @@ -0,0 +1 @@ +../default/Dockerfile.j2 \ No newline at end of file diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/converge.yml b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/converge.yml new file mode 100644 index 0000000000..ff49eecc50 --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/converge.yml @@ -0,0 +1,17 @@ +--- +- name: Converge scenario with auto-instrumentation installation + hosts: all + become: yes + vars: + splunk_access_token: fake-token + splunk_realm: fake-realm + install_splunk_otel_auto_instrumentation: true + splunk_otel_auto_instrumentation_systemd: true + splunk_otel_auto_instrumentation_sdks: + - dotnet + tasks: + - name: "Install nodejs for tests" + ansible.builtin.import_tasks: ../shared/install_nodejs.yml + - name: "Include signalfx.splunk_otel_collector.collector role" + include_role: + name: "collector" diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/molecule.yml b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/molecule.yml new file mode 100644 index 0000000000..2333d7016e --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/molecule.yml @@ -0,0 +1 @@ +# no default config provided, make sure to set --base-config molecule argument instead diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/verify.yml b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/verify.yml new file mode 100644 index 0000000000..10c3e98b05 --- /dev/null +++ b/deployments/ansible/molecule/with_instrumentation_systemd_dotnet/verify.yml @@ -0,0 +1,140 @@ +--- +- name: Verify scenario with auto-instrumentation installation + hosts: all + gather_facts: false + tasks: + - name: Populate service facts + ansible.builtin.service_facts: + + - name: Assert splunk-otel-collector service is running + assert: + that: ansible_facts.services['splunk-otel-collector.service'].state == 'running' + + - name: Populate package facts + ansible.builtin.package_facts: + + - name: Get splunk-otel-auto-instrumentation version + set_fact: + auto_instrumentation_version: "{{ ansible_facts.packages['splunk-otel-auto-instrumentation'][0].version }}" + + - name: Check if splunk-otel-js is installed + shell: npm ls @splunk/otel + args: + chdir: /usr/lib/splunk-instrumentation/splunk-otel-js + register: npm_ls + failed_when: npm_ls.rc == 0 + + - name: Assert /etc/ld.so.preload does not contain path to libsplunk.so + ansible.builtin.lineinfile: + line: /usr/lib/splunk-instrumentation/libsplunk.so + dest: /etc/ld.so.preload + state: absent + check_mode: yes + register: preload + failed_when: preload is changed + + - name: Check for preload config files + ansible.builtin.stat: + path: "{{ item }}" + loop: + - /usr/lib/splunk-instrumentation/instrumentation.conf + - /etc/splunk/zeroconfig/java.conf + - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf + register: config_files + + - name: Assert preload config files do not exist + assert: + that: not item.stat.exists + loop: "{{ config_files.results }}" + + - name: Assert instrumentation config does not contain JAVA_TOOL_OPTIONS + ansible.builtin.lineinfile: + regexp: '.*JAVA_TOOL_OPTIONS.*' + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: absent + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config does not contain NODE_OPTIONS + ansible.builtin.lineinfile: + regexp: '.*NODE_OPTIONS.*' + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: absent + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "DefaultEnvironment=\"{{ item }}\"" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES + ansible.builtin.lineinfile: + line: "DefaultEnvironment=\"OTEL_RESOURCE_ATTRIBUTES=\ + splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}-systemd\"" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config does not contain OTEL_SERVICE_NAME + ansible.builtin.lineinfile: + regexp: '.*OTEL_SERVICE_NAME.*' + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: absent + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED + ansible.builtin.lineinfile: + line: DefaultEnvironment="SPLUNK_PROFILER_ENABLED=false" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED + ansible.builtin.lineinfile: + line: DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=false" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED + ansible.builtin.lineinfile: + line: DefaultEnvironment="SPLUNK_METRICS_ENABLED=false" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + + - name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT + ansible.builtin.lineinfile: + line: DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_java/verify.yml b/deployments/ansible/molecule/with_instrumentation_systemd_java/verify.yml index 75bdb92627..83f151c9b1 100644 --- a/deployments/ansible/molecule/with_instrumentation_systemd_java/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_systemd_java/verify.yml @@ -40,6 +40,7 @@ - /usr/lib/splunk-instrumentation/instrumentation.conf - /etc/splunk/zeroconfig/java.conf - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf register: config_files - name: Assert preload config files do not exist @@ -66,6 +67,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config does not contain .NET env vars + ansible.builtin.lineinfile: + regexp: ".*{{ item }}.*" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: absent + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING + - CORECLR_PROFILER + - CORECLR_PROFILER_PATH + - DOTNET_ADDITIONAL_DEPS + - DOTNET_SHARED_STORE + - DOTNET_STARTUP_HOOKS + - OTEL_DOTNET_AUTO_HOME + - OTEL_DOTNET_AUTO_PLUGINS + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "DefaultEnvironment=\"OTEL_RESOURCE_ATTRIBUTES=\ diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_nodejs/verify.yml b/deployments/ansible/molecule/with_instrumentation_systemd_nodejs/verify.yml index 963187a93f..ea0a90b132 100644 --- a/deployments/ansible/molecule/with_instrumentation_systemd_nodejs/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_systemd_nodejs/verify.yml @@ -38,6 +38,7 @@ - /usr/lib/splunk-instrumentation/instrumentation.conf - /etc/splunk/zeroconfig/java.conf - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf register: config_files - name: Assert preload config files do not exist @@ -64,6 +65,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config does not contain .NET env vars + ansible.builtin.lineinfile: + regexp: ".*{{ item }}.*" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: absent + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING + - CORECLR_PROFILER + - CORECLR_PROFILER_PATH + - DOTNET_ADDITIONAL_DEPS + - DOTNET_SHARED_STORE + - DOTNET_STARTUP_HOOKS + - OTEL_DOTNET_AUTO_HOME + - OTEL_DOTNET_AUTO_PLUGINS + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "DefaultEnvironment=\"OTEL_RESOURCE_ATTRIBUTES=\ diff --git a/deployments/ansible/molecule/with_instrumentation_systemd_without_npm/verify.yml b/deployments/ansible/molecule/with_instrumentation_systemd_without_npm/verify.yml index 75bdb92627..f9f8fc9d6d 100644 --- a/deployments/ansible/molecule/with_instrumentation_systemd_without_npm/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation_systemd_without_npm/verify.yml @@ -40,6 +40,7 @@ - /usr/lib/splunk-instrumentation/instrumentation.conf - /etc/splunk/zeroconfig/java.conf - /etc/splunk/zeroconfig/node.conf + - /etc/splunk/zeroconfig/dotnet.conf register: config_files - name: Assert preload config files do not exist @@ -66,6 +67,24 @@ register: config failed_when: config is changed + - name: Assert instrumentation config contains .NET env vars + ansible.builtin.lineinfile: + line: "DefaultEnvironment=\"{{ item }}\"" + dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf + state: present + check_mode: yes + register: config + failed_when: config is changed + loop: + - CORECLR_ENABLE_PROFILING=1 + - CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} + - CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + - DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps + - DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store + - DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll + - OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet + - OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation + - name: Assert instrumentation config contains OTEL_RESOURCE_ATTRIBUTES ansible.builtin.lineinfile: line: "DefaultEnvironment=\"OTEL_RESOURCE_ATTRIBUTES=\ diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 3e79ed61e5..fcae227979 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -207,11 +207,12 @@ to take effect. - `splunk_otel_auto_instrumentation_sdks`: List of Splunk OpenTelemetry Auto Instrumentation SDKs to install, configure, and activate. (**default:** - `['java', 'nodejs']`) + `['java', 'nodejs', 'dotnet']`) Currently, the following values are supported: - `java`: [Splunk OpenTelemetry for Java](https://github.com/signalfx/splunk-otel-java) - `nodejs`: [Splunk OpenTelemetry for Node.js](https://github.com/signalfx/splunk-otel-js) + - `dotnet` [Splunk OpenTelemetry for .NET](https://github.com/signalfx/splunk-otel-dotnet) (x86_64/amd64 only) **Note:** This role does not manage the installation/configuration of Node.js, `npm`, or Node.js applications. If `nodejs` is included in this @@ -221,7 +222,8 @@ to take effect. - `splunk_otel_auto_instrumentation_version` (Linux only): Version of the `splunk-otel-auto-instrumentation` package to install, e.g. `0.50.0`. The minimum supported version is `0.48.0`. The minimum supported version for - Node.js auto instrumentation is `0.87.0`. (**default:** `latest`) + Node.js auto instrumentation is `0.87.0`. The minimum supported version for + .NET auto instrumentation is `0.99.0` (**default:** `latest`) - `splunk_otel_auto_instrumentation_systemd` (Linux only): By default, the `/etc/ld.so.preload` file on the node will be configured for the diff --git a/deployments/ansible/roles/collector/defaults/main.yml b/deployments/ansible/roles/collector/defaults/main.yml index e3849decdc..c4da3b3bd8 100644 --- a/deployments/ansible/roles/collector/defaults/main.yml +++ b/deployments/ansible/roles/collector/defaults/main.yml @@ -77,6 +77,7 @@ splunk_otel_auto_instrumentation_otlp_endpoint: http://127.0.0.1:4317 splunk_otel_auto_instrumentation_sdks: - java - nodejs + - dotnet splunk_otel_auto_instrumentation_npm_path: npm # Custom environment variables for the collector service diff --git a/deployments/ansible/roles/collector/tasks/linux_auto_instrumentation.yml b/deployments/ansible/roles/collector/tasks/linux_auto_instrumentation.yml index 20ec31e7a7..075e618390 100644 --- a/deployments/ansible/roles/collector/tasks/linux_auto_instrumentation.yml +++ b/deployments/ansible/roles/collector/tasks/linux_auto_instrumentation.yml @@ -31,6 +31,9 @@ with_java: "{{ 'java' in (splunk_otel_auto_instrumentation_sdks | default([])) }}" with_nodejs: "{{ 'nodejs' in (splunk_otel_auto_instrumentation_sdks | default([])) \ and auto_instrumentation_version is version('0.87.0', '>=') }}" + with_dotnet: "{{ 'dotnet' in (splunk_otel_auto_instrumentation_sdks | default([])) \ + and auto_instrumentation_version is version('0.99.0', '>=') \ + and ansible_architecture in ('x86_64', 'amd64') }}" - name: Check for npm shell: npm --version @@ -81,6 +84,12 @@ state: absent when: with_systemd or not with_new_instrumentation or not with_nodejs or not npm_found +- name: Delete the Splunk OpenTelemetry Auto Instrumentation for .NET config file + ansible.builtin.file: + path: /etc/splunk/zeroconfig/dotnet.conf + state: absent + when: with_systemd or not with_new_instrumentation or not with_dotnet + - name: Set up the Splunk OpenTelemetry Auto Instrumentation config file ansible.builtin.template: src: splunk-otel-auto-instrumentation.conf.j2 @@ -108,6 +117,15 @@ mode: '644' when: with_nodejs and npm_found and not with_systemd +- name: Set up the Splunk OpenTelemetry Auto Instrumentation for .NET config file + ansible.builtin.template: + src: dotnet.conf.j2 + dest: /etc/splunk/zeroconfig/dotnet.conf + owner: root + group: root + mode: '644' + when: with_dotnet and not with_systemd + - name: Ensure the system.conf.d directory exists ansible.builtin.file: path: /usr/lib/systemd/system.conf.d @@ -121,7 +139,7 @@ owner: root group: root mode: '644' - when: with_systemd and (with_java or (with_nodejs and npm_found)) + when: with_systemd and (with_java or (with_nodejs and npm_found) or with_dotnet) notify: "Reload systemd daemon" - name: Set up /etc/ld.so.preload for Splunk OpenTelemetry Auto Instrumentation diff --git a/deployments/ansible/roles/collector/templates/00-splunk-otel-auto-instrumentation.conf.j2 b/deployments/ansible/roles/collector/templates/00-splunk-otel-auto-instrumentation.conf.j2 index 606853605b..979f24e085 100644 --- a/deployments/ansible/roles/collector/templates/00-splunk-otel-auto-instrumentation.conf.j2 +++ b/deployments/ansible/roles/collector/templates/00-splunk-otel-auto-instrumentation.conf.j2 @@ -5,6 +5,16 @@ DefaultEnvironment="JAVA_TOOL_OPTIONS=-javaagent:{{ splunk_otel_auto_instrumenta {% if with_nodejs and npm_found %} DefaultEnvironment="NODE_OPTIONS=-r /usr/lib/splunk-instrumentation/splunk-otel-js/node_modules/@splunk/otel/instrument" {% endif %} +{% if with_dotnet %} +DefaultEnvironment="CORECLR_ENABLE_PROFILING=1" +DefaultEnvironment="CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}" +DefaultEnvironment="CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so" +DefaultEnvironment="DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps" +DefaultEnvironment="DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store" +DefaultEnvironment="DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll" +DefaultEnvironment="OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet" +DefaultEnvironment="OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation" +{% endif %} {% if splunk_otel_auto_instrumentation_resource_attributes is defined and splunk_otel_auto_instrumentation_resource_attributes %} DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}-systemd,{{ splunk_otel_auto_instrumentation_resource_attributes }}" {% else %} diff --git a/deployments/ansible/roles/collector/templates/dotnet.conf.j2 b/deployments/ansible/roles/collector/templates/dotnet.conf.j2 new file mode 100644 index 0000000000..715148d7fb --- /dev/null +++ b/deployments/ansible/roles/collector/templates/dotnet.conf.j2 @@ -0,0 +1,20 @@ +CORECLR_ENABLE_PROFILING=1 +CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} +CORECLR_PROFILER_PATH=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so +DOTNET_ADDITIONAL_DEPS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/AdditionalDeps +DOTNET_SHARED_STORE=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/store +DOTNET_STARTUP_HOOKS=/usr/lib/splunk-instrumentation/splunk-otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll +OTEL_DOTNET_AUTO_HOME=/usr/lib/splunk-instrumentation/splunk-otel-dotnet +OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation +{% if splunk_otel_auto_instrumentation_resource_attributes is defined and splunk_otel_auto_instrumentation_resource_attributes %} +OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }},{{ splunk_otel_auto_instrumentation_resource_attributes }} +{% else %} +OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }} +{% endif %} +{% if splunk_otel_auto_instrumentation_service_name is defined and splunk_otel_auto_instrumentation_service_name %} +OTEL_SERVICE_NAME={{ splunk_otel_auto_instrumentation_service_name }} +{% endif %} +SPLUNK_PROFILER_ENABLED={{ splunk_otel_auto_instrumentation_enable_profiler | string | lower }} +SPLUNK_PROFILER_MEMORY_ENABLED={{ splunk_otel_auto_instrumentation_enable_profiler_memory | string | lower }} +SPLUNK_METRICS_ENABLED={{ splunk_otel_auto_instrumentation_enable_metrics | string | lower }} +OTEL_EXPORTER_OTLP_ENDPOINT={{ splunk_otel_auto_instrumentation_otlp_endpoint }} diff --git a/deployments/ansible/roles/collector/templates/ld_so_preload.j2 b/deployments/ansible/roles/collector/templates/ld_so_preload.j2 index c4a77fa5b9..c96e937b39 100644 --- a/deployments/ansible/roles/collector/templates/ld_so_preload.j2 +++ b/deployments/ansible/roles/collector/templates/ld_so_preload.j2 @@ -1,4 +1,4 @@ -{% if not with_systemd and (with_java or (with_nodejs and npm_found)) %} +{% if not with_systemd and (with_java or (with_nodejs and npm_found) or with_dotnet) %} /usr/lib/splunk-instrumentation/libsplunk.so {% endif %} {% if splunk_otel_auto_instrumentation_ld_so_preload is defined and splunk_otel_auto_instrumentation_ld_so_preload %}