-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb8e08e
commit 8ed3f05
Showing
26 changed files
with
632 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
deployments/ansible/molecule/with_instrumentation_preload_custom/Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../default/Dockerfile.j2 |
18 changes: 18 additions & 0 deletions
18
deployments/ansible/molecule/with_instrumentation_preload_custom/converge.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- 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_resource_attributes: deployment.environment=test | ||
splunk_otel_auto_instrumentation_service_name: test | ||
splunk_otel_auto_instrumentation_enable_profiler: true | ||
splunk_otel_auto_instrumentation_enable_profiler_memory: true | ||
splunk_otel_auto_instrumentation_enable_metrics: true | ||
splunk_otel_auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317 | ||
tasks: | ||
- name: "Include signalfx.splunk_otel_collector.collector role" | ||
include_role: | ||
name: "collector" |
1 change: 1 addition & 0 deletions
1
deployments/ansible/molecule/with_instrumentation_preload_custom/molecule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
101 changes: 101 additions & 0 deletions
101
deployments/ansible/molecule/with_instrumentation_preload_custom/verify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
- 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 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: 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 path to java agent | ||
ansible.builtin.lineinfile: | ||
line: JAVA_TOOL_OPTIONS=-javaagent:/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar | ||
dest: /etc/splunk/zeroconfig/java.conf | ||
state: present | ||
check_mode: yes | ||
register: config | ||
failed_when: config is changed | ||
|
||
- 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 }},\ | ||
deployment.environment=test" | ||
dest: /etc/splunk/zeroconfig/java.conf | ||
state: present | ||
check_mode: yes | ||
register: config | ||
failed_when: config is changed | ||
|
||
- name: Assert instrumentation config contains OTEL_SERVICE_NAME | ||
ansible.builtin.lineinfile: | ||
line: OTEL_SERVICE_NAME=test | ||
dest: /etc/splunk/zeroconfig/java.conf | ||
state: present | ||
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=true | ||
dest: /etc/splunk/zeroconfig/java.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=true | ||
dest: /etc/splunk/zeroconfig/java.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=true | ||
dest: /etc/splunk/zeroconfig/java.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://0.0.0.0:4317 | ||
dest: /etc/splunk/zeroconfig/java.conf | ||
state: present | ||
check_mode: yes | ||
register: config | ||
failed_when: config is changed |
1 change: 1 addition & 0 deletions
1
deployments/ansible/molecule/with_instrumentation_preload_default/Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../default/Dockerfile.j2 |
12 changes: 12 additions & 0 deletions
12
deployments/ansible/molecule/with_instrumentation_preload_default/converge.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- 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 | ||
tasks: | ||
- name: "Include signalfx.splunk_otel_collector.collector role" | ||
include_role: | ||
name: "collector" |
1 change: 1 addition & 0 deletions
1
deployments/ansible/molecule/with_instrumentation_preload_default/molecule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
100 changes: 100 additions & 0 deletions
100
deployments/ansible/molecule/with_instrumentation_preload_default/verify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
- 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 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: 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 path to java agent | ||
ansible.builtin.lineinfile: | ||
line: JAVA_TOOL_OPTIONS=-javaagent:/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar | ||
dest: /etc/splunk/zeroconfig/java.conf | ||
state: present | ||
check_mode: yes | ||
register: config | ||
failed_when: config is changed | ||
|
||
- 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 | ||
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/java.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/java.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/java.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/java.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/java.conf | ||
state: present | ||
check_mode: yes | ||
register: config | ||
failed_when: config is changed |
1 change: 1 addition & 0 deletions
1
deployments/ansible/molecule/with_instrumentation_systemd_custom/Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../default/Dockerfile.j2 |
Oops, something went wrong.