Skip to content

Commit 5613106

Browse files
chef: add logs exporter option
1 parent 4b8f0f1 commit 5613106

File tree

27 files changed

+52
-1
lines changed

27 files changed

+52
-1
lines changed

deployments/chef/CHANGELOG.md

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

3+
## chef-v0.16.0
4+
5+
- Add support for the ``auto_instrumentation_logs_exporter` option to configure the `OTEL_LOGS_EXPORTER` environment variable.
6+
37
## chef-v0.15.0
48

59
- Breaking Change: The default for the `auto_instrumentation_otlp_endpoint` option has been changed from

deployments/chef/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ after installation/configuration in order for any change to take effect.
292292
`0.104.0`. (**default:** `''`, i.e. defer to the default
293293
`OTEL_METRICS_EXPORTER` value for each activated SDK)
294294

295+
- `auto_instrumentation_logs_exporter` (Linux only): Set the exporter for
296+
collected logs by all activated SDKs, for example `otlp`. Set the value to
297+
`none` to disable collection and export of logs. The value will be set to the
298+
`OTEL_LOGS_EXPORTER` environment variable. Only applicable if
299+
`auto_instrumentation_version` is `latest` or >= `0.108.0`.
300+
(**default:** `''`, i.e. defer to the default `OTEL_LOGS_EXPORTER` value for
301+
each activated SDK)
302+
295303
### Auto Instrumentation for .NET on Windows
296304

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

deployments/chef/attributes/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
default['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'] = false
101101
default['splunk_otel_collector']['auto_instrumentation_enable_metrics'] = false
102102
default['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] = ''
103+
default['splunk_otel_collector']['auto_instrumentation_logs_exporter'] = ''
103104
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] = ''
104105
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] = ''
105106
default['splunk_otel_collector']['with_auto_instrumentation_sdks'] = %w(java nodejs dotnet)

deployments/chef/kitchen.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ suites:
177177
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
178178
auto_instrumentation_otlp_endpoint_protocol: grpc
179179
auto_instrumentation_metrics_exporter: none
180+
auto_instrumentation_logs_exporter: none
180181

181182
- name: with_default_systemd_instrumentation
182183
run_list:
@@ -212,6 +213,7 @@ suites:
212213
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
213214
auto_instrumentation_otlp_endpoint_protocol: grpc
214215
auto_instrumentation_metrics_exporter: none
216+
auto_instrumentation_logs_exporter: none
215217

216218
- name: with_default_preload_java_instrumentation
217219
run_list:
@@ -243,6 +245,7 @@ suites:
243245
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
244246
auto_instrumentation_otlp_endpoint_protocol: grpc
245247
auto_instrumentation_metrics_exporter: none
248+
auto_instrumentation_logs_exporter: none
246249

247250
- name: with_default_systemd_java_instrumentation
248251
run_list:
@@ -275,6 +278,7 @@ suites:
275278
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
276279
auto_instrumentation_otlp_endpoint_protocol: grpc
277280
auto_instrumentation_metrics_exporter: none
281+
auto_instrumentation_logs_exporter: none
278282

279283
- name: with_default_preload_node_instrumentation
280284
run_list:
@@ -312,6 +316,7 @@ suites:
312316
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
313317
auto_instrumentation_otlp_endpoint_protocol: grpc
314318
auto_instrumentation_metrics_exporter: none
319+
auto_instrumentation_logs_exporter: none
315320

316321
- name: with_default_systemd_node_instrumentation
317322
run_list:
@@ -350,6 +355,7 @@ suites:
350355
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
351356
auto_instrumentation_otlp_endpoint_protocol: grpc
352357
auto_instrumentation_metrics_exporter: none
358+
auto_instrumentation_logs_exporter: none
353359

354360
- name: with_default_preload_dotnet_instrumentation
355361
run_list:
@@ -381,6 +387,7 @@ suites:
381387
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
382388
auto_instrumentation_otlp_endpoint_protocol: grpc
383389
auto_instrumentation_metrics_exporter: none
390+
auto_instrumentation_logs_exporter: none
384391

385392
- name: with_default_systemd_dotnet_instrumentation
386393
run_list:
@@ -413,6 +420,7 @@ suites:
413420
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
414421
auto_instrumentation_otlp_endpoint_protocol: grpc
415422
auto_instrumentation_metrics_exporter: none
423+
auto_instrumentation_logs_exporter: none
416424

417425
- name: with_default_preload_instrumentation_without_npm
418426
run_list:

deployments/chef/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
maintainer_email '[email protected]'
44
license 'Apache-2.0'
55
description 'Install/Configure the Splunk OpenTelemetry Collector'
6-
version '0.15.0'
6+
version '0.16.0'
77
chef_version '>= 16.0'
88

99
supports 'amazon'

deployments/chef/templates/00-splunk-otel-auto-instrumentation.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector'
3535
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
3636
DefaultEnvironment="OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>"
3737
<% end -%>
38+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
39+
DefaultEnvironment="OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>"
40+
<% end -%>

deployments/chef/templates/dotnet.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentat
2626
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
2727
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
2828
<% end -%>
29+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
30+
OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>
31+
<% end -%>

deployments/chef/templates/java.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentat
1919
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
2020
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
2121
<% end -%>
22+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
23+
OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>
24+
<% end -%>

deployments/chef/templates/node.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentat
1919
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
2020
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
2121
<% end -%>
22+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
23+
OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>
24+
<% end -%>

deployments/chef/test/integration/with_custom_preload_dotnet_instrumentation/test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
5151
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
5252
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
53+
its('content') { should match /^OTEL_LOGS_EXPORTER=none$/ }
5354
end
5455

5556
describe service('splunk-otel-collector') do

0 commit comments

Comments
 (0)