File tree Expand file tree Collapse file tree 5 files changed +12
-0
lines changed
test/integration/custom_vars Expand file tree Collapse file tree 5 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,10 @@ required `splunk_access_token` attribute and some optional attributes:
148
148
` HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\splunk-otel-collector `
149
149
registry key.
150
150
151
+ - ` collector_command_line_args ` : Additional command line arguments to pass to the
152
+ collector service. The value will be set to the ` OTELCOL_OPTIONS ` environment
153
+ variable for the collector service (** default:** ` '' ` ).
154
+
151
155
### Fluentd
152
156
153
157
- ` with_fluentd ` : Whether to install/manage Fluentd and dependencies for log
Original file line number Diff line number Diff line change 31
31
'4.3.2'
32
32
end
33
33
default [ 'splunk_otel_collector' ] [ 'collector_additional_env_vars' ] = { }
34
+ default [ 'splunk_otel_collector' ] [ 'collector_command_line_args' ] = ''
34
35
35
36
if platform_family? ( 'windows' )
36
37
default [ 'splunk_otel_collector' ] [ 'collector_version' ] = 'latest'
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ suites:
92
92
collector_additional_env_vars :
93
93
MY_CUSTOM_VAR1 : value1
94
94
MY_CUSTOM_VAR2 : value2
95
+ collector_command_line_args : --discovery
95
96
with_fluentd : true
96
97
97
98
- name : with_default_preload_instrumentation
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ SPLUNK_BUNDLE_DIR=<%= node['splunk_otel_collector']['splunk_bundle_dir'] %>
39
39
# This directory must be read/writable by the collector process.
40
40
SPLUNK_COLLECTD_DIR=<%= node['splunk_otel_collector']['splunk_collectd_dir'] %>
41
41
42
+ <% unless node['splunk_otel_collector']['collector_command_line_args'].to_s.strip.empty? -%>
43
+ # Additional command line arguments for the collector.
44
+ OTELCOL_OPTIONS=<%= node['splunk_otel_collector']['collector_command_line_args'] %>
45
+ <% end -%>
46
+
42
47
# Additional environment variables.
43
48
<% @node['splunk_otel_collector']['collector_additional_env_vars'].each do |key,value| -%>
44
49
<%= key %> =<%= value %>
Original file line number Diff line number Diff line change 65
65
its ( 'content' ) { should match /^SPLUNK_REALM=test$/ }
66
66
its ( 'content' ) { should match /^MY_CUSTOM_VAR1=value1$/ }
67
67
its ( 'content' ) { should match /^MY_CUSTOM_VAR2=value2$/ }
68
+ its ( 'content' ) { should match /^OTELCOL_OPTIONS=--discovery$/ }
68
69
end
69
70
describe file ( '/etc/systemd/system/splunk-otel-collector.service.d/service-owner.conf' ) do
70
71
its ( 'content' ) { should match /^User=custom-user$/ }
You can’t perform that action at this time.
0 commit comments