Skip to content

Commit 29381f5

Browse files
ansible: add logs exporter option (#5295)
1 parent 9f116f0 commit 29381f5

File tree

22 files changed

+150
-1
lines changed

22 files changed

+150
-1
lines changed

deployments/ansible/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## ansible-v0.30.0
4+
5+
### 💡 Enhancements 💡
6+
7+
- Add support for the `splunk_otel_auto_instrumentation_logs_exporter` option to configure the `OTEL_LOGS_EXPORTER` environment variable.
8+
39
## ansible-v0.29.0
410

511
### 🛑 Breaking changes 🛑

deployments/ansible/galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace: signalfx
33
name: splunk_otel_collector
44
description: Ansible collection for Splunk OpenTelemetry Collector
5-
version: 0.29.0
5+
version: 0.30.0
66
readme: README.md
77
authors:
88
- Splunk Inc.

deployments/ansible/molecule/with_instrumentation_preload_custom/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
splunk_otel_auto_instrumentation_enable_profiler_memory: true
1414
splunk_otel_auto_instrumentation_enable_metrics: true
1515
splunk_otel_auto_instrumentation_metrics_exporter: none
16+
splunk_otel_auto_instrumentation_logs_exporter: none
1617
splunk_otel_auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
1718
splunk_otel_auto_instrumentation_otlp_endpoint_protocol: grpc
1819
tasks:

deployments/ansible/molecule/with_instrumentation_preload_custom/verify.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@
199199
- java.conf
200200
- node.conf
201201
- dotnet.conf
202+
203+
- name: Assert instrumentation config contains OTEL_LOGS_EXPORTER
204+
ansible.builtin.lineinfile:
205+
line: OTEL_LOGS_EXPORTER=none
206+
dest: "/etc/splunk/zeroconfig/{{ item }}"
207+
state: present
208+
check_mode: yes
209+
register: config
210+
failed_when: config is changed
211+
loop:
212+
- java.conf
213+
- node.conf
214+
- dotnet.conf

deployments/ansible/molecule/with_instrumentation_preload_default/verify.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,16 @@
189189
- java.conf
190190
- node.conf
191191
- dotnet.conf
192+
193+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
194+
ansible.builtin.lineinfile:
195+
regexp: '.*OTEL_LOGS_EXPORTER.*'
196+
dest: "/etc/splunk/zeroconfig/{{ item }}"
197+
state: absent
198+
check_mode: yes
199+
register: config
200+
failed_when: config is changed
201+
loop:
202+
- java.conf
203+
- node.conf
204+
- dotnet.conf

deployments/ansible/molecule/with_instrumentation_preload_dotnet/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,12 @@
159159
check_mode: yes
160160
register: config
161161
failed_when: config is changed
162+
163+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
164+
ansible.builtin.lineinfile:
165+
regexp: '.*OTEL_LOGS_EXPORTER.*'
166+
dest: /etc/splunk/zeroconfig/dotnet.conf
167+
state: absent
168+
check_mode: yes
169+
register: config
170+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_preload_java/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,12 @@
150150
check_mode: yes
151151
register: config
152152
failed_when: config is changed
153+
154+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
155+
ansible.builtin.lineinfile:
156+
regexp: '.*OTEL_LOGS_EXPORTER.*'
157+
dest: /etc/splunk/zeroconfig/java.conf
158+
state: absent
159+
check_mode: yes
160+
register: config
161+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_preload_nodejs/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,12 @@
148148
check_mode: yes
149149
register: config
150150
failed_when: config is changed
151+
152+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
153+
ansible.builtin.lineinfile:
154+
regexp: '.*OTEL_LOGS_EXPORTER.*'
155+
dest: /etc/splunk/zeroconfig/node.conf
156+
state: absent
157+
check_mode: yes
158+
register: config
159+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_preload_without_npm/verify.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,15 @@
174174
loop:
175175
- java.conf
176176
- dotnet.conf
177+
178+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
179+
ansible.builtin.lineinfile:
180+
regexp: '.*OTEL_LOGS_EXPORTER.*'
181+
dest: "/etc/splunk/zeroconfig/{{ item }}"
182+
state: absent
183+
check_mode: yes
184+
register: config
185+
failed_when: config is changed
186+
loop:
187+
- java.conf
188+
- dotnet.conf

deployments/ansible/molecule/with_instrumentation_systemd_custom/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
splunk_otel_auto_instrumentation_enable_profiler_memory: true
1414
splunk_otel_auto_instrumentation_enable_metrics: true
1515
splunk_otel_auto_instrumentation_metrics_exporter: none
16+
splunk_otel_auto_instrumentation_logs_exporter: none
1617
splunk_otel_auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
1718
splunk_otel_auto_instrumentation_otlp_endpoint_protocol: grpc
1819
tasks:

deployments/ansible/molecule/with_instrumentation_systemd_custom/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,12 @@
155155
check_mode: yes
156156
register: config
157157
failed_when: config is changed
158+
159+
- name: Assert instrumentation config contains OTEL_LOGS_EXPORTER
160+
ansible.builtin.lineinfile:
161+
line: DefaultEnvironment="OTEL_LOGS_EXPORTER=none"
162+
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
163+
state: present
164+
check_mode: yes
165+
register: config
166+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_systemd_default/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,12 @@
156156
check_mode: yes
157157
register: config
158158
failed_when: config is changed
159+
160+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
161+
ansible.builtin.lineinfile:
162+
regexp: '.*OTEL_LOGS_EXPORTER.*'
163+
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
164+
state: absent
165+
check_mode: yes
166+
register: config
167+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_systemd_dotnet/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,12 @@
156156
check_mode: yes
157157
register: config
158158
failed_when: config is changed
159+
160+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
161+
ansible.builtin.lineinfile:
162+
regexp: '.*OTEL_LOGS_EXPORTER.*'
163+
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
164+
state: absent
165+
check_mode: yes
166+
register: config
167+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_systemd_java/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,12 @@
157157
check_mode: yes
158158
register: config
159159
failed_when: config is changed
160+
161+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
162+
ansible.builtin.lineinfile:
163+
regexp: '.*OTEL_LOGS_EXPORTER.*'
164+
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
165+
state: absent
166+
check_mode: yes
167+
register: config
168+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_systemd_nodejs/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,12 @@
155155
check_mode: yes
156156
register: config
157157
failed_when: config is changed
158+
159+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
160+
ansible.builtin.lineinfile:
161+
regexp: '.*OTEL_LOGS_EXPORTER.*'
162+
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
163+
state: absent
164+
check_mode: yes
165+
register: config
166+
failed_when: config is changed

deployments/ansible/molecule/with_instrumentation_systemd_without_npm/verify.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,12 @@
157157
check_mode: yes
158158
register: config
159159
failed_when: config is changed
160+
161+
- name: Assert instrumentation config does not contain OTEL_LOGS_EXPORTER
162+
ansible.builtin.lineinfile:
163+
regexp: '.*OTEL_LOGS_EXPORTER.*'
164+
dest: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
165+
state: absent
166+
check_mode: yes
167+
register: config
168+
failed_when: config is changed

deployments/ansible/roles/collector/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,15 @@ to take effect.
315315
(**default:** ```, i.e. defer to the default `OTEL_METRICS_EXPORTER` value
316316
for each activated SDK)
317317

318+
- `splunk_otel_auto_instrumentation_logs_exporter` (Linux only):
319+
Set the exporter for collected logs by all activated SDKs, for example
320+
`otlp`. Set the value to `none` to disable collection and export of logs.
321+
The value will be set to the `OTEL_LOGS_EXPORTER` environment variable. Only
322+
applicable if `splunk_otel_auto_instrumentation_version` is `latest` or >=
323+
`0.108.0`.
324+
(**default:** ```, i.e. defer to the default `OTEL_LOGS_EXPORTER` value
325+
for each activated SDK)
326+
318327
### Auto Instrumentation for .NET on Windows
319328

320329
***Warning:*** The `Environment` property in the

deployments/ansible/roles/collector/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ splunk_otel_auto_instrumentation_enable_profiler: false
7474
splunk_otel_auto_instrumentation_enable_profiler_memory: false
7575
splunk_otel_auto_instrumentation_enable_metrics: false
7676
splunk_otel_auto_instrumentation_metrics_exporter: ""
77+
splunk_otel_auto_instrumentation_logs_exporter: ""
7778
splunk_otel_auto_instrumentation_otlp_endpoint: ""
7879
splunk_otel_auto_instrumentation_otlp_endpoint_protocol: ""
7980
splunk_otel_auto_instrumentation_sdks:

deployments/ansible/roles/collector/templates/00-splunk-otel-auto-instrumentation.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL={{ splunk_otel_auto_instrumentat
3535
{% if splunk_otel_auto_instrumentation_metrics_exporter is defined and splunk_otel_auto_instrumentation_metrics_exporter %}
3636
DefaultEnvironment="OTEL_METRICS_EXPORTER={{ splunk_otel_auto_instrumentation_metrics_exporter }}"
3737
{% endif %}
38+
{% if splunk_otel_auto_instrumentation_logs_exporter is defined and splunk_otel_auto_instrumentation_logs_exporter %}
39+
DefaultEnvironment="OTEL_LOGS_EXPORTER={{ splunk_otel_auto_instrumentation_logs_exporter }}"
40+
{% endif %}

deployments/ansible/roles/collector/templates/dotnet.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL={{ splunk_otel_auto_instrumentation_otlp_endpoint_pr
2626
{% if splunk_otel_auto_instrumentation_metrics_exporter is defined and splunk_otel_auto_instrumentation_metrics_exporter %}
2727
OTEL_METRICS_EXPORTER={{ splunk_otel_auto_instrumentation_metrics_exporter }}
2828
{% endif %}
29+
{% if splunk_otel_auto_instrumentation_logs_exporter is defined and splunk_otel_auto_instrumentation_logs_exporter %}
30+
OTEL_LOGS_EXPORTER={{ splunk_otel_auto_instrumentation_logs_exporter }}
31+
{% endif %}

deployments/ansible/roles/collector/templates/java.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL={{ splunk_otel_auto_instrumentation_otlp_endpoint_pr
1919
{% if splunk_otel_auto_instrumentation_metrics_exporter is defined and splunk_otel_auto_instrumentation_metrics_exporter %}
2020
OTEL_METRICS_EXPORTER={{ splunk_otel_auto_instrumentation_metrics_exporter }}
2121
{% endif %}
22+
{% if splunk_otel_auto_instrumentation_logs_exporter is defined and splunk_otel_auto_instrumentation_logs_exporter %}
23+
OTEL_LOGS_EXPORTER={{ splunk_otel_auto_instrumentation_logs_exporter }}
24+
{% endif %}

deployments/ansible/roles/collector/templates/node.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL={{ splunk_otel_auto_instrumentation_otlp_endpoint_pr
1919
{% if splunk_otel_auto_instrumentation_metrics_exporter is defined and splunk_otel_auto_instrumentation_metrics_exporter %}
2020
OTEL_METRICS_EXPORTER={{ splunk_otel_auto_instrumentation_metrics_exporter }}
2121
{% endif %}
22+
{% if splunk_otel_auto_instrumentation_logs_exporter is defined and splunk_otel_auto_instrumentation_logs_exporter %}
23+
OTEL_LOGS_EXPORTER={{ splunk_otel_auto_instrumentation_logs_exporter }}
24+
{% endif %}

0 commit comments

Comments
 (0)