Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions deployments/ansible/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion deployments/ansible/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=\
Expand All @@ -89,6 +107,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_SERVICE_NAME
ansible.builtin.lineinfile:
Expand All @@ -101,6 +120,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED
ansible.builtin.lineinfile:
Expand All @@ -113,6 +133,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED
ansible.builtin.lineinfile:
Expand All @@ -125,6 +146,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED
ansible.builtin.lineinfile:
Expand All @@ -137,6 +159,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
Expand All @@ -149,3 +172,4 @@
loop:
- java.conf
- node.conf
- dotnet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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=\
Expand All @@ -79,6 +97,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config does not contain OTEL_SERVICE_NAME
ansible.builtin.lineinfile:
Expand All @@ -91,6 +110,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains SPLUNK_PROFILER_ENABLED
ansible.builtin.lineinfile:
Expand All @@ -103,6 +123,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains SPLUNK_PROFILER_MEMORY_ENABLED
ansible.builtin.lineinfile:
Expand All @@ -115,6 +136,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains SPLUNK_METRICS_ENABLED
ansible.builtin.lineinfile:
Expand All @@ -127,6 +149,7 @@
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
Expand All @@ -139,3 +162,4 @@
loop:
- java.conf
- node.conf
- dotnet.conf
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# no default config provided, make sure to set --base-config molecule argument instead
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading