-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b23b937
commit 954ff04
Showing
13 changed files
with
224 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
deployments/chef/templates/00-splunk-otel-auto-instrumentation.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
NODE_OPTIONS=-r @splunk/otel/instrument | ||
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_resource_attributes']) && node['splunk_otel_collector']['auto_instrumentation_resource_attributes'] != "" -%> | ||
OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-<%= @installed_version %>,<%= node['splunk_otel_collector']['auto_instrumentation_resource_attributes'] %> | ||
<% else -%> | ||
OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-<%= @installed_version %> | ||
<% end -%> | ||
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_service_name']) && node['splunk_otel_collector']['auto_instrumentation_service_name'] != "" -%> | ||
OTEL_SERVICE_NAME=<%= node['splunk_otel_collector']['auto_instrumentation_service_name'] %> | ||
<% end -%> | ||
SPLUNK_PROFILER_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler'].to_s.downcase %> | ||
SPLUNK_PROFILER_MEMORY_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'].to_s.downcase %> | ||
SPLUNK_METRICS_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_metrics'].to_s.downcase %> | ||
OTEL_EXPORTER_OTLP_ENDPOINT=<%= node['splunk_otel_collector']['auto_instrumentation_otlp_endpoint'] %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...stom_preload_node_instrumentation/inspec/with_custom_preload_node_instrumentation_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
libsplunk_path = '/usr/lib/splunk-instrumentation/libsplunk.so' | ||
node_options = '-r @splunk/otel/instrument' | ||
otlp_endpoint = 'http://0.0.0.0:4317' | ||
ld_preload_line = '# my extra library' | ||
|
||
describe package('splunk-otel-auto-instrumentation') do | ||
it { should be_installed } | ||
end | ||
|
||
describe npm('splunk/otel') do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/ld.so.preload') do | ||
its('content') { should match /^#{libsplunk_path}$/ } | ||
its('content') { should match /^#{ld_preload_line}$/ } | ||
end | ||
|
||
describe file('/usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf') do | ||
it { should_not exist } | ||
end | ||
|
||
describe file('/etc/splunk/zeroconfig/java.conf') do | ||
it { should_not exist } | ||
end | ||
|
||
describe file('/etc/splunk/zeroconfig/node.conf') do | ||
its('content') { should match /^NODE_OPTIONS=#{node_options}$/ } | ||
its('content') { should match /^OTEL_RESOURCE_ATTRIBUTES=#{resource_attributes}$/ } | ||
its('content') { should match /^OTEL_SERVICE_NAME=test$/ } | ||
its('content') { should match /^SPLUNK_PROFILER_ENABLED=true$/ } | ||
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=true$/ } | ||
its('content') { should match /^SPLUNK_METRICS_ENABLED=true$/ } | ||
its('content') { should match /^OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}$/ } | ||
end | ||
|
||
describe service('splunk-otel-collector') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
describe service('td-agent') do | ||
it { should_not be_enabled } | ||
it { should_not be_running } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...stom_systemd_node_instrumentation/inspec/with_custom_systemd_node_instrumentation_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
libsplunk_path = '/usr/lib/splunk-instrumentation/libsplunk.so' | ||
node_options = '-r @splunk/otel/instrument' | ||
resource_attributes = 'splunk.zc.method=splunk-otel-auto-instrumentation-\d+\.\d+\.\d+-systemd,deployment.environment=test' | ||
otlp_endpoint = 'http://0.0.0.0:4317' | ||
|
||
describe package('splunk-otel-auto-instrumentation') do | ||
it { should be_installed } | ||
end | ||
|
||
describe npm('splunk/otel') do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/ld.so.preload') do | ||
its('content') { should_not match /^#{libsplunk_path}$/ } | ||
end | ||
|
||
describe file('/usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf') do | ||
its('content') { should_not match /.*JAVA_TOOL_OPTIONS.*/ } | ||
its('content') { should match /^DefaultEnvironment="NODE_OPTIONS=#{node_options}"$/ } | ||
its('content') { should match /^DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=#{resource_attributes}"$/ } | ||
its('content') { should match /^DefaultEnvironment="OTEL_SERVICE_NAME=test"$/ } | ||
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_ENABLED=true"$/ } | ||
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=true"$/ } | ||
its('content') { should match /^DefaultEnvironment="SPLUNK_METRICS_ENABLED=true"$/ } | ||
its('content') { should match /^DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=#{otlp_endpoint}"$/ } | ||
end | ||
|
||
describe service('splunk-otel-collector') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
describe service('td-agent') do | ||
it { should_not be_enabled } | ||
it { should_not be_running } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
.../with_default_systemd_instrumentation/inspec/with_default_systemd_instrumentation_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters