-
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
cb8e08e
commit 3b08012
Showing
12 changed files
with
278 additions
and
7 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
14 changes: 14 additions & 0 deletions
14
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Manager] | ||
DefaultEnvironment="JAVA_TOOL_OPTIONS=-javaagent:<%= node['splunk_otel_collector']['auto_instrumentation_java_agent_jar'] %>" | ||
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_resource_attributes']) && node['splunk_otel_collector']['auto_instrumentation_resource_attributes'] != "" -%> | ||
DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-<%= @installed_version %>-systemd,<%= node['splunk_otel_collector']['auto_instrumentation_resource_attributes'] %>" | ||
<% else -%> | ||
DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-<%= @installed_version %>-systemd | ||
<% end -%> | ||
<% if defined?(node['splunk_otel_collector']['auto_instrumentation_service_name']) && node['splunk_otel_collector']['auto_instrumentation_service_name'] != "" -%> | ||
DefaultEnvironment="OTEL_SERVICE_NAME=<%= node['splunk_otel_collector']['auto_instrumentation_service_name'] %>" | ||
<% end -%> | ||
DefaultEnvironment="SPLUNK_PROFILER_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler'].to_s.downcase %>" | ||
DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_profiler_memory'].to_s.downcase %>" | ||
DefaultEnvironment="SPLUNK_METRICS_ENABLED=<%= node['splunk_otel_collector']['auto_instrumentation_enable_metrics'].to_s.downcase %>" | ||
DefaultEnvironment="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
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 @@ | ||
JAVA_TOOL_OPTIONS=-javaagent:<%= node['splunk_otel_collector']['auto_instrumentation_java_agent_jar'] %> | ||
<% 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'] %> |
36 changes: 36 additions & 0 deletions
36
...on/with_custom_preload_instrumentation/inspec/with_custom_preload_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,36 @@ | ||
libsplunk_path = '/usr/lib/splunk-instrumentation/libsplunk.so' | ||
java_agent_path = '/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar' | ||
resource_attributes = 'splunk.zc.method=splunk-otel-auto-instrumentation-0.87.0,deployment.environment=test' | ||
otlp_endpoint = 'http://0.0.0.0:4317' | ||
|
||
describe package('splunk-otel-auto-instrumentation') do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/ld.so.preload') do | ||
its('content') { should match /^#{libsplunk_path}$/ } | ||
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 | ||
its('content') { should match /^JAVA_TOOL_OPTIONS=-javaagent:#{java_agent_path}$/ } | ||
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 |
35 changes: 35 additions & 0 deletions
35
...on/with_custom_systemd_instrumentation/inspec/with_custom_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
java_tool_options = 'JAVA_TOOL_OPTIONS=-javaagent:/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar' | ||
resource_attributes = 'OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-0.87.0-systemd' | ||
otlp_endpoint = 'http://0.0.0.0.0:4317' | ||
|
||
describe package('splunk-otel-auto-instrumentation') do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/ld.so.preload') do | ||
its('content') { should match /^#{libsplunk_path}$/ } | ||
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 | ||
its('content') { should match /^DefaultEnvironment="#{java_tool_options}"$/ } | ||
its('content') { should match /^DefaultEnvironment="#{resource_attributes},deployment.environment=test"$/ } | ||
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 |
36 changes: 36 additions & 0 deletions
36
.../with_default_preload_instrumentation/inspec/with_default_preload_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,36 @@ | ||
libsplunk_path = '/usr/lib/splunk-instrumentation/libsplunk.so' | ||
java_agent_path = '/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar' | ||
resource_attributes = 'splunk.zc.method=splunk-otel-auto-instrumentation' | ||
otlp_endpoint = 'http://127.0.0.1:4317' | ||
|
||
describe package('splunk-otel-auto-instrumentation') do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/ld.so.preload') do | ||
its('content') { should match /^#{libsplunk_path}$/ } | ||
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 | ||
its('content') { should match /^JAVA_TOOL_OPTIONS=-javaagent:#{java_agent_path}$/ } | ||
its('content') { should match /^OTEL_RESOURCE_ATTRIBUTES=#{resource_attributes}-\d+\.\d+\.\d+$/ } | ||
its('content') { should_not match /.*OTEL_SERVICE_NAME.*/ } | ||
its('content') { should match /^SPLUNK_PROFILER_ENABLED=false$/ } | ||
its('content') { should match /^SPLUNK_PROFILER_MEMORY_ENABLED=false$/ } | ||
its('content') { should match /^SPLUNK_METRICS_ENABLED=false$/ } | ||
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 |
35 changes: 35 additions & 0 deletions
35
.../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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
java_tool_options = 'JAVA_TOOL_OPTIONS=-javaagent:/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar' | ||
resource_attributes = 'OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation' | ||
otlp_endpoint = 'http://127.0.0.1:4317' | ||
|
||
describe package('splunk-otel-auto-instrumentation') do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/ld.so.preload') do | ||
its('content') { should match /^#{libsplunk_path}$/ } | ||
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 | ||
its('content') { should match /^DefaultEnvironment="#{java_tool_options}"$/ } | ||
its('content') { should match /^DefaultEnvironment="#{resource_attributes}-\d+\.\d+\.\d+-systemd"$/ } | ||
its('content') { should_not match /.*OTEL_SERVICE_NAME.*/ } | ||
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_ENABLED=false"$/ } | ||
its('content') { should match /^DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=false"$/ } | ||
its('content') { should match /^DefaultEnvironment="SPLUNK_METRICS_ENABLED=false"$/ } | ||
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