Skip to content

Commit

Permalink
chef: add logs exporter option
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk committed Aug 28, 2024
1 parent 4b8f0f1 commit 5613106
Show file tree
Hide file tree
Showing 27 changed files with 52 additions and 1 deletion.
4 changes: 4 additions & 0 deletions deployments/chef/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## chef-v0.16.0

- Add support for the ``auto_instrumentation_logs_exporter` option to configure the `OTEL_LOGS_EXPORTER` environment variable.

## chef-v0.15.0

- Breaking Change: The default for the `auto_instrumentation_otlp_endpoint` option has been changed from
Expand Down
8 changes: 8 additions & 0 deletions deployments/chef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ after installation/configuration in order for any change to take effect.
`0.104.0`. (**default:** `''`, i.e. defer to the default
`OTEL_METRICS_EXPORTER` value for each activated SDK)

- `auto_instrumentation_logs_exporter` (Linux only): Set the exporter for
collected logs by all activated SDKs, for example `otlp`. Set the value to
`none` to disable collection and export of logs. The value will be set to the
`OTEL_LOGS_EXPORTER` environment variable. Only applicable if
`auto_instrumentation_version` is `latest` or >= `0.108.0`.
(**default:** `''`, i.e. defer to the default `OTEL_LOGS_EXPORTER` value for
each activated SDK)

### Auto Instrumentation for .NET on Windows

***Warning:*** The `Environment` property in the
Expand Down
1 change: 1 addition & 0 deletions deployments/chef/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
default['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'] = false
default['splunk_otel_collector']['auto_instrumentation_enable_metrics'] = false
default['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] = ''
default['splunk_otel_collector']['auto_instrumentation_logs_exporter'] = ''
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] = ''
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] = ''
default['splunk_otel_collector']['with_auto_instrumentation_sdks'] = %w(java nodejs dotnet)
Expand Down
8 changes: 8 additions & 0 deletions deployments/chef/kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_systemd_instrumentation
run_list:
Expand Down Expand Up @@ -212,6 +213,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_preload_java_instrumentation
run_list:
Expand Down Expand Up @@ -243,6 +245,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_systemd_java_instrumentation
run_list:
Expand Down Expand Up @@ -275,6 +278,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_preload_node_instrumentation
run_list:
Expand Down Expand Up @@ -312,6 +316,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_systemd_node_instrumentation
run_list:
Expand Down Expand Up @@ -350,6 +355,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_preload_dotnet_instrumentation
run_list:
Expand Down Expand Up @@ -381,6 +387,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_systemd_dotnet_instrumentation
run_list:
Expand Down Expand Up @@ -413,6 +420,7 @@ suites:
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
auto_instrumentation_otlp_endpoint_protocol: grpc
auto_instrumentation_metrics_exporter: none
auto_instrumentation_logs_exporter: none

- name: with_default_preload_instrumentation_without_npm
run_list:
Expand Down
2 changes: 1 addition & 1 deletion deployments/chef/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email '[email protected]'
license 'Apache-2.0'
description 'Install/Configure the Splunk OpenTelemetry Collector'
version '0.15.0'
version '0.16.0'
chef_version '>= 16.0'

supports 'amazon'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector'
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
DefaultEnvironment="OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>"
<% end -%>
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
DefaultEnvironment="OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>"
<% end -%>
3 changes: 3 additions & 0 deletions deployments/chef/templates/dotnet.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentat
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
<% end -%>
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>
<% end -%>
3 changes: 3 additions & 0 deletions deployments/chef/templates/java.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentat
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
<% end -%>
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>
<% end -%>
3 changes: 3 additions & 0 deletions deployments/chef/templates/node.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentat
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
<% end -%>
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_logs_exporter']) && node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] != "" -%>
OTEL_LOGS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_logs_exporter'] %>
<% end -%>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
its('content') { should match /^OTEL_LOGS_EXPORTER=none$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
its('content') { should match /^OTEL_LOGS_EXPORTER=none$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
its('content') { should match /^OTEL_LOGS_EXPORTER=none$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
its('content') { should match /^OTEL_LOGS_EXPORTER=none$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_LOGS_EXPORTER=none"$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_LOGS_EXPORTER=none"$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_LOGS_EXPORTER=none"$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
its('content') { should match /^DefaultEnvironment="OTEL_LOGS_EXPORTER=none"$/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
its('content') { should_not match /.*OTEL_LOGS_EXPORTER.*/ }
end

describe service('splunk-otel-collector') do
Expand Down

0 comments on commit 5613106

Please sign in to comment.