cookbook 'splunk_otel_collector', '= 0.12.0'
splunk_otel_collector
(16) Versions
0.12.0
-
Follow0
Install/Configure the Splunk OpenTelemetry Collector
cookbook 'splunk_otel_collector', '= 0.12.0', :supermarket
knife supermarket install splunk_otel_collector
knife supermarket download splunk_otel_collector
Splunk OpenTelemetry Collector Cookbook
This cookbook installs and configures the Splunk OpenTelemetry Collector to
collect metrics, traces and logs from Linux and Windows machines and sends
data to Splunk Observability Cloud.
Prerequisites
- Splunk Access Token
- Splunk Realm
- Double-check exposed ports to make sure your environment doesn't have conflicts. Ports can be changed in the collector's configuration.
Linux
Currently, the following Linux distributions and versions are supported:
- Amazon Linux: 2
- CentOS / Red Hat / Oracle: 7, 8, 9
- Debian: 9, 10, 11
- SUSE: 12, 15 (Note: Only for Collector versions v0.34.0 or higher. Log collection with Fluentd not currently supported.)
- Ubuntu: 18.04, 20.04, 22.04
Windows
Currently, the following Windows versions are supported:
- Windows Server 2019 64-bit
- Windows Server 2022 64-bit
On Windows, the collector is installed as a Windows service and its environment
variables are set at the service scope, i.e.: they are only available to the
collector service and not to the entire machine.
Usage
This cookbook can be downloaded and installed from Chef Supermarket.
To install the Collector, include the
splunk_otel_collector::default recipe in the run_list, and set the
attributes on the node's run_state. Below is an example to configure the
required splunk_access_token attribute and some optional attributes:
yaml
{
"splunk-otel-collector": {
"splunk_access_token": "<SPLUNK_ACCESS_TOKEN>",
"splunk_realm": "<SPLUNK_REALM>",
}
}
This cookbook accepts the following attributes
Collector
splunk_access_token(Required): The Splunk access token
to authenticate requests.splunk_realm: Which Splunk realm to send the data to, e.g.us1. The
SPLUNK_REALMenvironment variable will be set with this value for the
Collector service. This value will derive thesplunk_ingest_urland
splunk_api_urlattribute values unless they are explicitly set.
(default:us0)splunk_ingest_url: Explicitly set the Splunk ingest URL, e.g.
https://ingest.us0.signalfx.com, instead of the URL derived from the
splunk_realmattribute. TheSPLUNK_INGEST_URLenvironment variable will
be set with this value for the Collector service. (default:
https://ingest.{{ splunk_realm }}.signalfx.com)splunk_api_url: Explicitly set the Splunk API URL, e.g.
https://api.us0.signalfx.com, instead of the URL derived fromsplunk_realm
attribute. TheSPLUNK_API_URLenvironment variable will be set with this
value for the Collector service. (default:
https://api.{{ splunk_realm }}.signalfx.com)collector_version: Version of the Collector package to install, e.g.
0.34.0. (default:latest)collector_config_source: Source path to the Collector config YAML file.
This file will be copied to thecollector_config_destpath on the node. See
the source attribute of the
file resource for supported value types. The default source file is provided
by the Collector package. (default:
/etc/otel/collector/agent_config.yamlon Linux,
%ProgramFiles%\Splunk\OpenTelemetry Collector\agent_config.yamlon Windows)collector_config_dest: Destination path of the Collector config file on the
node. TheSPLUNK_CONFIGenvironment variable will be set with this value
for the Collector service. (default:
/etc/otel/collector/agent_config.yamlon Linux,
%PROGRAMDATA%\Splunk\OpenTelemetry Collector\agent_config.yamlon Windows)node['splunk_otel_collector']['collector_config']: The Collector
configuration object. Everything underneath this object gets directly
converted to YAML and becomes the Collector config file. Using this option
preemptscollector_config_sourcefunctionality. (default:{})splunk_memory_total_mib: Amount of memory in MiB allocated to the
Collector. TheSPLUNK_MEMORY_TOTAL_MIBenvironment variable will be set
with this value for the Collector service. (default:512)gomemlimit: TheGOMEMLIMITenvironment variable is introduced for the Splunk Otel Collector version >=0.97.0, allowing the limitation of memory usage in the GO runtime. This feature can help enhance GC (Garbage Collection) related performance and prevent GC related Out of Memory (OOM) situations.splunk_listen_interface: The network interface the collector receivers
will listen on (default0.0.0.0).splunk_service_userandsplunk_service_group(Linux only): Set the
user/group ownership for the Collector service. The user/group will be
created if they do not exist. (default:splunk-otel-collector)package_stage: The Collector package repository stage to use. Can be
release,beta, ortest. (default:release)splunk_bundle_dir: The path to the Smart Agent bundle directory.
The default path is provided by the Collector package. If the specified path
is changed from the default value, the path should be an existing directory
on the node. TheSPLUNK_BUNDLE_DIRenvironment variable will be set to
this value for the Collector service. (default:
/usr/lib/splunk-otel-collector/agent-bundleon Linux,
%ProgramFiles%\Splunk\OpenTelemetry Collector\agent-bundleon Windows)splunk_collectd_dir: The path to the collectd config directory for the
Smart Agent bundle. The default path is provided by the Collector package.
If the specified path is changed from the default value, the path should be
an existing directory on the node. TheSPLUNK_COLLECTD_DIRenvironment
variable will be set to this value for the Collector service.
(default:/usr/lib/splunk-otel-collector/agent-bundleon Linux,
%ProgramFiles%\Splunk\OpenTelemetry Collector\agent-bundle\run\collectd
on Windows)collector_additional_env_vars: Hash of additional environment variables
from the collector configuration file for the collector service
(default:{}).
For example, if the collector configuration file includes references to
${MY_CUSTOM_VAR1}and${MY_CUSTOM_VAR2}, specify the following to allow
the collector service to expand these variables:
ruby
collector_additional_env_vars: {'MY_CUSTOM_VAR1' => 'value1', 'MY_CUSTOM_VAR2' => 'value2'}
On Linux, the variables/values will be added to the
/etc/otel/collector/splunk-otel-collector.confsystemd environment file.
On Windows, the variables/values will be added to theEnvironmentvalue under the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\splunk-otel-collector
registry key.
Fluentd
with_fluentd: Whether to install/manage Fluentd and dependencies for log
collection. On Linux, the dependencies include capng_c for enabling
Linux capabilities,
fluent-plugin-systemd for systemd
journal log collection, and the required libraries/development tools.
(default:false)fluentd_version: Version of the td-agent (Fluentd) package to install (default:
3.7.1for Debian stretch, and4.3.1for all other Linux distros and
Windows)fluentd_config_source: Source path to the Fluentd config file. This file
will be copied to thefluentd_config_destpath on the node. See the
source attribute of the file
resource for supported value types. The default source file is provided by
the Collector package. Only applicable ifwith_fluentdis set to true.
(default:/etc/otel/collector/fluentd/fluent.confon Linux,
%SYSTEMDRIVE%\opt\td-agent\etc\td-agent\td-agent.confon Windows)fluentd_config_dest(Linux only): Destination path to the Fluentd config
file on the node. Only applicable ifwith_fluentdis set totrue.
Note: On Windows, the path will always be set to
%SYSTEMDRIVE%\opt\td-agent\etc\td-agent\td-agent.conf. (default:
/etc/otel/collector/fluentd/fluent.conf)
Auto Instrumentation on Linux
Note: The application(s) on the node need to be restarted separately
after installation/configuration in order for any change to take effect.
with_auto_instrumentation: Whether to install/manage Splunk OpenTelemetry
Auto Instrumentation. When set totrue, the
splunk-otel-auto-instrumentationdeb/rpm package will be downloaded and
installed from the Collector repository. (default:false)with_auto_instrumentation_sdks: List of Splunk OpenTelemetry Auto
Instrumentation SDKs to install, configure, and activate. (default:
%w(java nodejs))
Currently, the following values are supported:
- java: Splunk OpenTelemetry for Java
- nodejs: Splunk OpenTelemetry for Node.js
Note: This recipe does not manage the installation/configuration of
Node.js, npm, or Node.js applications. If nodejs is included in this
option, Node.js and npm are required to be pre-installed on the node in
order to install and activate the Node.js SDK.
auto_instrumentation_version: Version of the
splunk-otel-auto-instrumentationpackage to install, e.g.0.50.0. The
minimum supported version is0.48.0. The minimum supported version for
Node.js auto instrumentation is0.87.0. (default:latest)auto_instrumentation_systemd(Linux only): By default, the
/etc/ld.so.preloadfile on the node will be configured for the
/usr/lib/splunk-instrumentation/libsplunk.soshared object library
provided by thesplunk-otel-auto-instrumentationpackage to activate and
configure auto instrumentation system-wide for all supported applications.
Alternatively, set this option totrueto activate and configure auto
instrumentation only for supported applications running assystemd
services. If this option is set totrue,
/usr/lib/splunk-instrumentation/libsplunk.sowill not be added to
/etc/ld.so.preload. Instead, the
/usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
systemddrop-in file will be created and configured for environment
variables based on the default and specified options. (default:false)auto_instrumentation_ld_so_preload(Linux only): Configure this variable to
include additional library paths, e.g./path/to/my.library.so, to
/etc/ld.so.preload. (default: ``)auto_instrumentation_java_agent_path: Path to the Splunk OpenTelemetry
Java agent. The default path
is provided by thesplunk-otel-auto-instrumentationpackage. If the path is
changed from the default value, the path should be an existing file on the
node. (default:/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar)auto_instrumentation_npm_path: If thewith_auto_instrumentation_sdks
option includesnodejs, the Splunk OpenTelemetry for Node.js SDK will be
installed only ifnpmis found on the node with the
bash -c 'command -v npm'shell command. Use this option to specify a
custom path on the node fornpm, for example/my/custom/path/to/npm.
(default:npm)
Note: This recipe does not manage the installation/configuration of
Node.js or npm.
auto_instrumentation_resource_attributes: Configure the OpenTelemetry auto
instrumentation resource attributes, e.g.
deployment.environment=prod,my.key=value(comma-separatedkey=valuepairs.).
(default:'')auto_instrumentation_service_name: Explicitly set the service name for
all instrumented applications on the node, e.g.my.service. By
default, the service name is automatically generated for each instrumented
application. (default:'')DEPRECATED
auto_instrumentation_generate_service_name: Set this option
tofalseto prevent the preloader from setting theOTEL_SERVICE_NAME
environment variable. Only applicable ifauto_instrumentation_versionis <
0.87.0. (default:true)DEPRECATED
auto_instrumentation_disable_telemetry(Linux only): Enable
or disable the preloader from sending thesplunk.linux-autoinstr.executions
metric to the local collector. Only applicable if
auto_instrumentation_versionis <0.87.0. (default:false)auto_instrumentation_enable_profiler(Linux only): Enable or disable
AlwaysOn CPU Profiling. (default:false)auto_instrumentation_enable_profiler_memory(Linux only): Enable or disable
AlwaysOn Memory Profiling. (default:false)auto_instrumentation_enable_metrics(Linux only): Enable or disable
exporting instrumentation metrics. (default:false)auto_instrumentation_otlp_endpoint(Linux only): Set the OTLP gRPC endpoint
for captured traces. Only applicable ifauto_instrumentation_versionis
latestor >=0.87.0. (default:http://127.0.0.1:4317)
Auto Instrumentation for .NET on Windows
Warning: The Environment property in the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC registry key will
be overwritten by the options specified below to enable/configure auto
instrumentation for IIS. Use the
signalfx_dotnet_auto_instrumentation_additional_options option (see below for
details) to include any other environment variables required for IIS.
Note: By default, IIS will be restarted with the iisreset command (if it
exists) after installation/configuration. Applications not running within
IIS need to be restarted/managed separately in order for any changes to take
effect.
with_signalfx_dotnet_auto_instrumentation(Windows only): Whether to
install/manage SignalFx Auto Instrumentation for .NET.
When set totrue, thesignalfx-dotnet-tracingMSI package will be
downloaded and installed, and the Windows registry will be updated based on
the options below. (default:false)signalfx_dotnet_auto_instrumentation_version(Windows only): Version of the
signalfx-dotnet-tracingMSI package to download and install from
GitHub Releases.
(default:1.1.0)signalfx_dotnet_auto_instrumentation_msi_url(Windows only): Specify the
URL to download the MSI from a custom host, for example
https://my.host/signalfx-dotnet-tracing-1.0.0-x64.msi. If specified, the
signalfx_dotnet_auto_instrumentation_versionoption is ignored.
(default:https://github.com/signalfx/signalfx-dotnet-tracing/releases/download/v{{ signalfx_dotnet_auto_instrumentation_version }}/signalfx-dotnet-tracing-{{ signalfx_dotnet_auto_instrumentation_version }}-x64.msi)signalfx_dotnet_auto_instrumentation_iisreset(Windows only): By default,
theiisreset.execommand (if it exists) will be executed after
installation/configuration in order for any changes to take effect for IIS
applications. Set this option tofalseto skip this step if IIS is managed
separately or is not applicable. (default:true)signalfx_dotnet_auto_instrumentation_system_wide(Windows only): By
default, theEnvironmentproperty in the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVCregistry key
will be configured for the following environment variables and any from the
signalfx_dotnet_auto_instrumentation_additional_optionsoption to
enable/configure auto instrumentation for only IIS applications:
yaml
COR_ENABLE_PROFILING: true # Required
COR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required
CORECLR_ENABLE_PROFILING: true # Required
CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required
SIGNALFX_ENV: "{{ signalfx_dotnet_auto_instrumentation_environment }}"
SIGNALFX_PROFILER_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler }}"
SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler_memory }}"
SIGNALFX_SERVICE_NAME: "{{ signalfx_dotnet_auto_instrumentation_service_name }}"
Set this option totrueto also add these environment variables and any
from thesignalfx_dotnet_auto_instrumentation_additional_optionsoption to
the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
registry key to enable/configure auto instrumentation for all .NET
applications on the node. (default:false)signalfx_dotnet_auto_instrumentation_environment(Windows only): Configure
this option to set the "Environment" value to be reported to Splunk APM, for
exampleproduction. The value is assigned to theSIGNALFX_ENVenvironment
variable in the Windows registry (default:'', i.e. the "Environment"
will appear asunknownin Splunk APM for the instrumented
service/application)signalfx_dotnet_auto_instrumentation_service_name(Windows only): Configure
this variable to override the auto-generated service name
for the instrumented service/application, for examplemy-service-name. The
value is assigned to theSIGNALFX_SERVICE_NAMEenvironment variable in the
Windows registry. (default:'')signalfx_dotnet_auto_instrumentation_enable_profiler(Windows only): Set
this option totrueto enable AlwaysOn Profiling. The value will be
assigned to theSIGNALFX_PROFILER_ENABLEDenvironment variable in the
Windows registry. (default:false)signalfx_dotnet_auto_instrumentation_enable_profiler_memory(Windows only):
Set this option totrueto enable AlwaysOn Memory Profiling. The value will
be assigned to theSIGNALFX_PROFILER_MEMORY_ENABLEDenvironment variable in
the Windows registry. (default:false)signalfx_dotnet_auto_instrumentation_additional_options(Windows only):
Hash of additional options to be added to the Windows registry
in addition to the options above. (default:{})
For example:
yaml
signalfx_dotnet_auto_instrumentation_additional_options: {
'SIGNALFX_VERSION': '1.2.3',
'SIGNALFX_FILE_LOG_ENABLED': false,
# Hint: If the signalfx_dotnet_auto_instrumentation_system_wide option is
# set to true, all .NET applications on the node will be instrumented. Use
# the following options to include/exclude processes from auto
# instrumentation.
'SIGNALFX_PROFILER_PROCESSES': 'MyApp.exe;dotnet.exe',
'SIGNALFX_PROFILER_EXCLUDE_PROCESSES': 'ReservedProcess.exe;powershell.exe',
}
Check the Advanced Configuration Guide
for more details about the options above and other supported options.
To uninstall the signalfx-dotnet-tracing MSI and disable auto
instrumentation, include the following in your recipe and restart all
applicable services:
```
windows_package 'SignalFx .NET Tracing 64-bit' do
action :remove
end
If the "signalfx_dotnet_auto_instrumentation_system_wide" option was set to
"true", include the following to remove the values from the
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
registry key:
registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' do
values [
{ name: 'COR_ENABLE_PROFILING', type: :string, data: '' },
{ name: 'COR_PROFILER', type: :string, data: '' },
{ name: 'CORECLR_ENABLE_PROFILING', type: :string, data: '' },
{ name: 'CORECLR_PROFILER', type: :string, data: '' },
{ name: 'SIGNALFX_ENV', type: :string, data: '' },
{ name: 'SIGNALFX_PROFILER_ENABLED', type: :string, data: '' },
{ name: 'SIGNALFX_PROFILER_MEMORY_ENABLED', type: :string, data: '' },
{ name: 'SIGNALFX_SERVICE_NAME', type: :string, data: '' },
]
action :delete
end
```
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Changelog
chef-v0.12.0
-
splunk_ballast_size_mibis deprecated and removed. For Splunk Otel Collector version0.97.0or greater,GOMEMLIMITenv var is introduced. The default is set to 90% of theSPLUNK_TOTAL_MEM_MIB. For more information regarding the usage, please follow the instructions (here).
chef-v0.11.0
On Windows the
SPLUNK_*environment variables were moved from the machine scope to the collector service scope.
It is possible that some instrumentations are relying on the machine-wide environment variables set by the installation. (#3930)-
Initial support for Splunk OpenTelemetry for Node.js Auto
Instrumentation on Linux:- The Node.js SDK is installed and activated by default if the
with_auto_instrumentationoption is set totrueandnpmis found on the node with thebash -c 'command -v npm'shell command. - Set the
with_auto_instrumentation_sdksoption to only%w(java)to skip Node.js auto instrumentation. - Use the
auto_instrumentation_npm_pathoption to specify a custom path fornpm. -
Note: This recipe does not manage the installation/configuration of Node.js,
npm, or Node.js applications.
- The Node.js SDK is installed and activated by default if the
chef-v0.9.0
-
Deprecations: The
auto_instrumentation_generate_service_nameandauto_instrumentation_disable_telemetryoptions are deprecated and only applicable if theauto_instrumentation_versionoption is <0.87.0. - Support Splunk OpenTelemetry Auto Instrumentation for Linux v0.87.0 and newer (Java only).
- Support activation and configuration of auto instrumentation for only
systemdservices. - Support setting the OTLP exporter endpoint for auto instrumentation (default:
http://127.0.0.1:4317). Only applicable if theauto_instrumentation_versionoption islatestor >=0.87.0.
chef-v0.8.0
- Update
splunk_listen_interfacedefault to only set target SPLUNK_LISTEN_INTERFACE environment variable if configured.
chef-v0.7.0
- Add support for the
splunk_listen_interfaceoption to configure the network interface the collector receivers will listen on (default:0.0.0.0) - Add support for SignalFx .NET Auto Instrumentation on Windows (disabled by default)
chef-v0.6.0
-
Breaking Changes: Fluentd installation disabled by default.
- Specify the
with_fluentd: trueoption to enable installation
- Specify the
chef-v0.5.0
- Add support for additional options for Splunk OpenTelemetry Auto Instrumentation for Java (Linux only)
chef-v0.4.0
- Add
collector_additional_env_varsoption to allow passing additional environment variables to the collector service
chef-v0.3.0
- Update default
td-agentversion to 4.3.2 to support log collection with fluentd on Ubuntu 22.04 - Initial support for Splunk OpenTelemetry Auto Instrumentation for Java (Linux only)
chef-v0.2.0
- Initial release
Collaborator Number Metric
0.12.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
0.12.0 passed this metric
No Binaries Metric
0.12.0 passed this metric
Testing File Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.12.0 failed this metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
0.12.0 passed this metric
No Binaries Metric
0.12.0 passed this metric
Testing File Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.12.0 passed this metric
0.12.0 passed this metric
Testing File Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.12.0 failed this metric
0.12.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number