Skip to content

Commit

Permalink
ansible: Support splunk-otel-java v2 (#5133)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk authored Aug 15, 2024
1 parent 7e86004 commit c099196
Show file tree
Hide file tree
Showing 22 changed files with 341 additions and 34 deletions.
12 changes: 12 additions & 0 deletions deployments/ansible/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## ansible-v0.29.0

### 🛑 Breaking changes 🛑

- The default for the `splunk_otel_auto_instrumentation_otlp_endpoint` option has been changed from `http://127.0.0.1:4317`
to `''` (empty), i.e. defer to the default `OTEL_EXPORTER_OTLP_ENDPOINT` value for each activated SDK.

### 💡 Enhancements 💡

- Add support for the `splunk_otel_auto_instrumentation_otlp_endpoint_protocol` and `splunk_otel_auto_instrumentation_metrics_exporter`
options to configure the `OTEL_EXPORTER_OTLP_PROTOCOL` and `OTEL_METRICS_EXPORTER` environment variables, respectively.

## ansible-v0.28.0

- Initial support for [Splunk OpenTelemetry for .NET](https://github.com/signalfx/splunk-otel-dotnet) Auto
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.28.0
version: 0.29.0
readme: README.md
authors:
- Splunk Inc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
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_metrics_exporter: none
splunk_otel_auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
splunk_otel_auto_instrumentation_otlp_endpoint_protocol: grpc
tasks:
- name: "Install nodejs for tests"
ansible.builtin.import_tasks: ../shared/install_nodejs.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,29 @@
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
line: OTEL_EXPORTER_OTLP_PROTOCOL=grpc
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: present
check_mode: yes
register: config
failed_when: config is changed
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
line: OTEL_METRICS_EXPORTER=none
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: present
check_mode: yes
register: config
failed_when: config is changed
loop:
- java.conf
- node.conf
- dotnet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,37 @@
- node.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: absent
check_mode: yes
register: config
failed_when: config is changed
loop:
- java.conf
- node.conf
- dotnet.conf

- name: Assert instrumentation config does not contain OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: absent
check_mode: yes
register: config
failed_when: config is changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,29 @@
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: /etc/splunk/zeroconfig/dotnet.conf
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
dest: /etc/splunk/zeroconfig/dotnet.conf
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
dest: /etc/splunk/zeroconfig/dotnet.conf
state: absent
check_mode: yes
register: config
failed_when: config is changed
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,29 @@
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: /etc/splunk/zeroconfig/java.conf
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
dest: /etc/splunk/zeroconfig/java.conf
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
dest: /etc/splunk/zeroconfig/java.conf
state: absent
check_mode: yes
register: config
failed_when: config is changed
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,29 @@
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: /etc/splunk/zeroconfig/node.conf
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
dest: /etc/splunk/zeroconfig/node.conf
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
dest: /etc/splunk/zeroconfig/node.conf
state: absent
check_mode: yes
register: config
failed_when: config is changed
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,35 @@
- java.conf
- dotnet.conf

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed
loop:
- java.conf
- dotnet.conf

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
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 does not contain OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
dest: "/etc/splunk/zeroconfig/{{ item }}"
state: absent
check_mode: yes
register: config
failed_when: config is changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
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_metrics_exporter: none
splunk_otel_auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
splunk_otel_auto_instrumentation_otlp_endpoint_protocol: grpc
tasks:
- name: "Install nodejs for tests"
ansible.builtin.import_tasks: ../shared/install_nodejs.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,21 @@
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
line: DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"
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_METRICS_EXPORTER
ansible.builtin.lineinfile:
line: DefaultEnvironment="OTEL_METRICS_EXPORTER=none"
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
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,29 @@
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317"
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
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 OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
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
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,29 @@
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317"
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
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 OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
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
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,29 @@
register: config
failed_when: config is changed

- name: Assert instrumentation config contains OTEL_EXPORTER_OTLP_ENDPOINT
- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_ENDPOINT
ansible.builtin.lineinfile:
line: DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317"
regexp: '.*OTEL_EXPORTER_OTLP_ENDPOINT.*'
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
state: present
state: absent
check_mode: yes
register: config
failed_when: config is changed

- name: Assert instrumentation config does not contain OTEL_EXPORTER_OTLP_PROTOCOL
ansible.builtin.lineinfile:
regexp: '.*OTEL_EXPORTER_OTLP_PROTOCOL.*'
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 OTEL_METRICS_EXPORTER
ansible.builtin.lineinfile:
regexp: '.*OTEL_METRICS_EXPORTER.*'
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
Loading

0 comments on commit c099196

Please sign in to comment.