Skip to content

Commit 1aa61c5

Browse files
chef: support splunk-otel-java v2 (#5160)
1 parent eecf7e3 commit 1aa61c5

File tree

27 files changed

+139
-28
lines changed

27 files changed

+139
-28
lines changed

deployments/chef/CHANGELOG.md

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

3+
## chef-v0.15.0
4+
5+
- Breaking Change: The default for the `auto_instrumentation_otlp_endpoint` option has been changed from
6+
`http://127.0.0.1:4317` to `''` (empty), i.e. defer to the default `OTEL_EXPORTER_OTLP_ENDPOINT` value for each
7+
activated SDK.
8+
- Add support for the `auto_instrumentation_otlp_endpoint_protocol` and `auto_instrumentation_metrics_exporter` options
9+
to configure the `OTEL_EXPORTER_OTLP_PROTOCOL` and `OTEL_METRICS_EXPORTER` environment variables, respectively.
10+
311
## chef-v0.14.0
412

513
- Initial support for [Splunk OpenTelemetry for .NET](https://github.com/signalfx/splunk-otel-dotnet) Auto

deployments/chef/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,26 @@ after installation/configuration in order for any change to take effect.
271271
- `auto_instrumentation_enable_metrics` (Linux only): Enable or disable
272272
exporting instrumentation metrics. (**default**: `false`)
273273

274-
- `auto_instrumentation_otlp_endpoint` (Linux only): Set the OTLP gRPC endpoint
275-
for captured traces. Only applicable if `auto_instrumentation_version` is
276-
`latest` or >= `0.87.0`. (**default:** `http://127.0.0.1:4317`)
274+
- `auto_instrumentation_otlp_endpoint` (Linux only): Set the OTLP endpoint for
275+
captured traces. The value will be set to the `OTEL_EXPORTER_OTLP_ENDPOINT`
276+
environment variable. Only applicable if `auto_instrumentation_version` is
277+
`latest` or >= `0.87.0`. (**default:** `''`, i.e. defer to the default
278+
`OTEL_EXPORTER_OTLP_ENDPOINT` value for each activated SDK)
279+
280+
- `auto_instrumentation_otlp_endpoint_protocol` (Linux only): Set the protocol
281+
for the OTLP endpoint, for example `grpc` or `http/protobuf`. The value will
282+
be set to the `OTEL_EXPORTER_OTLP_PROTOCOL` environment variable. Only
283+
applicable if `auto_instrumentation_version` is `latest` or >= `0.104.0`.
284+
(**default:** `''`, i.e. defer to the default `OTEL_EXPORTER_OTLP_PROTOCOL`
285+
value for each activated SDK)
286+
287+
- `auto_instrumentation_metrics_exporter` (Linux only): Comma-separated list of
288+
exporters for collected metrics by all activated SDKs, for example
289+
`otlp,prometheus`. Set the value to `none` to disable collection and export
290+
of metrics. The value will be set to the `OTEL_METRICS_EXPORTER` environment
291+
variable. Only applicable if `auto_instrumentation_version` is `latest` or >=
292+
`0.104.0`. (**default:** `''`, i.e. defer to the default
293+
`OTEL_METRICS_EXPORTER` value for each activated SDK)
277294

278295
### Auto Instrumentation for .NET on Windows
279296

deployments/chef/attributes/default.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@
9999
default['splunk_otel_collector']['auto_instrumentation_enable_profiler'] = false
100100
default['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'] = false
101101
default['splunk_otel_collector']['auto_instrumentation_enable_metrics'] = false
102-
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] = 'http://127.0.0.1:4317'
102+
default['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] = ''
103+
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] = ''
104+
default['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] = ''
103105
default['splunk_otel_collector']['with_auto_instrumentation_sdks'] = %w(java nodejs dotnet)
104106
default['splunk_otel_collector']['auto_instrumentation_npm_path'] = 'npm'
105107
end

deployments/chef/kitchen.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ suites:
175175
auto_instrumentation_enable_profiler_memory: true
176176
auto_instrumentation_enable_metrics: true
177177
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
178+
auto_instrumentation_otlp_endpoint_protocol: grpc
179+
auto_instrumentation_metrics_exporter: none
178180

179181
- name: with_default_systemd_instrumentation
180182
run_list:
@@ -208,6 +210,8 @@ suites:
208210
auto_instrumentation_enable_profiler_memory: true
209211
auto_instrumentation_enable_metrics: true
210212
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
213+
auto_instrumentation_otlp_endpoint_protocol: grpc
214+
auto_instrumentation_metrics_exporter: none
211215

212216
- name: with_default_preload_java_instrumentation
213217
run_list:
@@ -237,6 +241,8 @@ suites:
237241
auto_instrumentation_enable_profiler_memory: true
238242
auto_instrumentation_enable_metrics: true
239243
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
244+
auto_instrumentation_otlp_endpoint_protocol: grpc
245+
auto_instrumentation_metrics_exporter: none
240246

241247
- name: with_default_systemd_java_instrumentation
242248
run_list:
@@ -267,6 +273,8 @@ suites:
267273
auto_instrumentation_enable_profiler_memory: true
268274
auto_instrumentation_enable_metrics: true
269275
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
276+
auto_instrumentation_otlp_endpoint_protocol: grpc
277+
auto_instrumentation_metrics_exporter: none
270278

271279
- name: with_default_preload_node_instrumentation
272280
run_list:
@@ -302,6 +310,8 @@ suites:
302310
auto_instrumentation_enable_profiler_memory: true
303311
auto_instrumentation_enable_metrics: true
304312
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
313+
auto_instrumentation_otlp_endpoint_protocol: grpc
314+
auto_instrumentation_metrics_exporter: none
305315

306316
- name: with_default_systemd_node_instrumentation
307317
run_list:
@@ -338,6 +348,8 @@ suites:
338348
auto_instrumentation_enable_profiler_memory: true
339349
auto_instrumentation_enable_metrics: true
340350
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
351+
auto_instrumentation_otlp_endpoint_protocol: grpc
352+
auto_instrumentation_metrics_exporter: none
341353

342354
- name: with_default_preload_dotnet_instrumentation
343355
run_list:
@@ -367,6 +379,8 @@ suites:
367379
auto_instrumentation_enable_profiler_memory: true
368380
auto_instrumentation_enable_metrics: true
369381
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
382+
auto_instrumentation_otlp_endpoint_protocol: grpc
383+
auto_instrumentation_metrics_exporter: none
370384

371385
- name: with_default_systemd_dotnet_instrumentation
372386
run_list:
@@ -397,6 +411,8 @@ suites:
397411
auto_instrumentation_enable_profiler_memory: true
398412
auto_instrumentation_enable_metrics: true
399413
auto_instrumentation_otlp_endpoint: http://0.0.0.0:4317
414+
auto_instrumentation_otlp_endpoint_protocol: grpc
415+
auto_instrumentation_metrics_exporter: none
400416

401417
- name: with_default_preload_instrumentation_without_npm
402418
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.14.0'
6+
version '0.15.0'
77
chef_version '>= 16.0'
88

99
supports 'amazon'

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ DefaultEnvironment="OTEL_SERVICE_NAME=<%= node['splunk_otel_collector']['auto_in
2626
DefaultEnvironment="SPLUNK_PROFILER_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler'].to_s.downcase %>"
2727
DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'].to_s.downcase %>"
2828
DefaultEnvironment="SPLUNK_METRICS_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_metrics'].to_s.downcase %>"
29+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] != "" -%>
2930
DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] %>"
31+
<% end -%>
32+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] != "" -%>
33+
DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] %>"
34+
<% end -%>
35+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
36+
DefaultEnvironment="OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>"
37+
<% end -%>

deployments/chef/templates/dotnet.conf.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,12 @@ OTEL_SERVICE_NAME=<%= node['splunk_otel_collector']['auto_instrumentation_servic
1717
SPLUNK_PROFILER_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler'].to_s.downcase %>
1818
SPLUNK_PROFILER_MEMORY_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'].to_s.downcase %>
1919
SPLUNK_METRICS_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_metrics'].to_s.downcase %>
20+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] != "" -%>
2021
OTEL_EXPORTER_OTLP_ENDPOINT=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] %>
22+
<% end -%>
23+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] != "" -%>
24+
OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] %>
25+
<% end -%>
26+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
27+
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
28+
<% end -%>

deployments/chef/templates/java.conf.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@ OTEL_SERVICE_NAME=<%= node['splunk_otel_collector']['auto_instrumentation_servic
1010
SPLUNK_PROFILER_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler'].to_s.downcase %>
1111
SPLUNK_PROFILER_MEMORY_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'].to_s.downcase %>
1212
SPLUNK_METRICS_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_metrics'].to_s.downcase %>
13+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] != "" -%>
1314
OTEL_EXPORTER_OTLP_ENDPOINT=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] %>
15+
<% end -%>
16+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] != "" -%>
17+
OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] %>
18+
<% end -%>
19+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
20+
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
21+
<% end -%>

deployments/chef/templates/node.conf.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@ OTEL_SERVICE_NAME=<%= node['splunk_otel_collector']['auto_instrumentation_servic
1010
SPLUNK_PROFILER_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler'].to_s.downcase %>
1111
SPLUNK_PROFILER_MEMORY_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'].to_s.downcase %>
1212
SPLUNK_METRICS_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_metrics'].to_s.downcase %>
13+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] != "" -%>
1314
OTEL_EXPORTER_OTLP_ENDPOINT=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] %>
15+
<% end -%>
16+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol']) && node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] != "" -%>
17+
OTEL_EXPORTER_OTLP_PROTOCOL=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint_protocol'] %>
18+
<% end -%>
19+
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_metrics_exporter']) && node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] != "" -%>
20+
OTEL_METRICS_EXPORTER=<%= node['splunk_otel_collector']['auto_instrumentation_metrics_exporter'] %>
21+
<% end -%>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ }
4949
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ }
5050
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
51+
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
52+
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
5153
end
5254

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

deployments/chef/test/integration/with_custom_preload_instrumentation/test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ }
3636
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ }
3737
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
38+
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
39+
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
3840
end
3941

4042
describe file('/etc/splunk/zeroconfig/node.conf') do
@@ -45,6 +47,8 @@
4547
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ }
4648
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ }
4749
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
50+
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
51+
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
4852
end
4953

5054
describe file('/etc/splunk/zeroconfig/dotnet.conf') do
@@ -62,6 +66,8 @@
6266
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ }
6367
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ }
6468
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
69+
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
70+
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
6571
end
6672

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

deployments/chef/test/integration/with_custom_preload_java_instrumentation/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ }
4242
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ }
4343
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
44+
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
45+
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
4446
end
4547

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

deployments/chef/test/integration/with_custom_preload_node_instrumentation/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ }
4242
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ }
4343
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
44+
its('content') { should match /^OTEL_EXPORTER_OTLP_PROTOCOL=grpc$/ }
45+
its('content') { should match /^OTEL_METRICS_EXPORTER=none$/ }
4446
end
4547

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

deployments/chef/test/integration/with_custom_systemd_dotnet_instrumentation/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=true"$/ }
4949
its('content') { should match /^DefaultEnvironment="SPLUNK_METRICS_ENABLED=true"$/ }
5050
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
51+
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
52+
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
5153
end
5254

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

deployments/chef/test/integration/with_custom_systemd_instrumentation/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=true"$/ }
5151
its('content') { should match /^DefaultEnvironment="SPLUNK_METRICS_ENABLED=true"$/ }
5252
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
53+
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
54+
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
5355
end
5456

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

deployments/chef/test/integration/with_custom_systemd_java_instrumentation/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=true"$/ }
4949
its('content') { should match /^DefaultEnvironment="SPLUNK_METRICS_ENABLED=true"$/ }
5050
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
51+
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
52+
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
5153
end
5254

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

deployments/chef/test/integration/with_custom_systemd_node_instrumentation/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=true"$/ }
4949
its('content') { should match /^DefaultEnvironment="SPLUNK_METRICS_ENABLED=true"$/ }
5050
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ }
51+
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_PROTOCOL=grpc"$/ }
52+
its('content') { should match /^DefaultEnvironment="OTEL_METRICS_EXPORTER=none"$/ }
5153
end
5254

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

deployments/chef/test/integration/with_default_preload_dotnet_instrumentation/test.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
libsplunk_path = '/usr/lib/splunk-instrumentation/libsplunk.so'
22
resource_attributes = 'splunk.zc.method=splunk-otel-auto-instrumentation-\d+\.\d+\.\d+'
3-
otlp_endpoint = 'http://127.0.0.1:4317'
43
dotnet_home = '/usr/lib/splunk-instrumentation/splunk-otel-dotnet'
54

65
describe package('splunk-otel-auto-instrumentation') do
@@ -45,7 +44,9 @@
4544
its('content') { should match /^SPLUNK_PROFILER_ENABLED=false$/ }
4645
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=false$/ }
4746
its('content') { should match /^SPLUNK_METRICS_ENABLED=false$/ }
48-
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
47+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
48+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
49+
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
4950
end
5051

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

deployments/chef/test/integration/with_default_preload_instrumentation/test.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
java_tool_options = '-javaagent:/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar'
33
node_options = '-r /usr/lib/splunk-instrumentation/splunk-otel-js/node_modules/@splunk/otel/instrument'
44
resource_attributes = 'splunk.zc.method=splunk-otel-auto-instrumentation-\d+\.\d+\.\d+'
5-
otlp_endpoint = 'http://127.0.0.1:4317'
65
dotnet_home = '/usr/lib/splunk-instrumentation/splunk-otel-dotnet'
76

87
describe package('splunk-otel-auto-instrumentation') do
@@ -32,7 +31,9 @@
3231
its('content') { should match /^SPLUNK_PROFILER_ENABLED=false$/ }
3332
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=false$/ }
3433
its('content') { should match /^SPLUNK_METRICS_ENABLED=false$/ }
35-
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
34+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
35+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
36+
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
3637
end
3738

3839
describe file('/etc/splunk/zeroconfig/node.conf') do
@@ -42,7 +43,9 @@
4243
its('content') { should match /^SPLUNK_PROFILER_ENABLED=false$/ }
4344
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=false$/ }
4445
its('content') { should match /^SPLUNK_METRICS_ENABLED=false$/ }
45-
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
46+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
47+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
48+
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
4649
end
4750

4851
describe file('/etc/splunk/zeroconfig/dotnet.conf') do
@@ -59,7 +62,9 @@
5962
its('content') { should match /^SPLUNK_PROFILER_ENABLED=false$/ }
6063
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=false$/ }
6164
its('content') { should match /^SPLUNK_METRICS_ENABLED=false$/ }
62-
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ }
65+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_ENDPOINT.*/ }
66+
its('content') { should_not match /.*OTEL_EXPORTER_OTLP_PROTOCOL.*/ }
67+
its('content') { should_not match /.*OTEL_METRICS_EXPORTER.*/ }
6368
end
6469

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

0 commit comments

Comments
 (0)