Caution
Preview: Splunk Zero Config Auto Instrumentation
Preview features described in this document are provided by Splunk to you βas isβ without any warranties, maintenance and support, or service-level commitments. Splunk makes this preview feature available in its sole discretion and may discontinue it at any time. Use of preview features is subject to the Splunk General Terms .
Zero Configuration Auto Instrumentation for Linux Java applications π
Zero Configuration Auto Instrumentation for Java activates automatic instrumentation for Java applications running on Linux. After installing the package, you must start or restart any Java applications that you want to instrument.
Prerequisites π
Automatic instrumentation is only available for applications using supported Java libraries. See Supported libraries and frameworks. If your application isnβt supported, manually instrument your service to generate trace data. See Manually instrument Java applications for Splunk Observability Cloud .
Your Splunk Observability Cloud realm and access token.
To get an access token, see Retrieve and manage user API access tokens using Splunk Observability Cloud.
To find the realm name of your account, open the navigation menu in Splunk Observability Cloud. Select Organizations section.
, and then select your username. The realm name appears in the
Install the package π
You can install the splunk-otel-auto-instrumentation
package in the following ways:
To install the package, run the Collector installer script with the --with-instrumentation
option. The installer script will install the Collector and the Java agent from the Splunk Distribution of OpenTelemetry Java. The Java agent is then loaded automatically when a Java application starts on the local machine.
Run the installer script with the --with-instrumentation
option, as shown in the following example. Replace <SPLUNK_REALM>
and <SPLUNK_ACCESS_TOKEN>
with your Splunk Observability Cloud realm and token, respectively.
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --realm <SPLUNK_REALM> -- <SPLUNK_ACCESS_TOKEN>
Note
If you have a Log Observer entitlement or wish to collect logs for the target host, make sure Fluentd is installed and enabled in your Collector instance.
To automatically define the optional deployment.environment
resource attribute at installation time, run the installer script with the --deployment-environment <env>
option. Replace <env>
with the desired attribute value, for example, prod
, as shown in the following example:
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --deployment-environment prod \
--realm <SPLUNK_REALM> -- <SPLUNK_ACCESS_TOKEN>
You can activate AlwaysOn Profiling for CPU and memory, as well as metrics, using additional options, as in the following example:
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --deployment-environment prod \
--realm <SPLUNK_REALM> -- <SPLUNK_ACCESS_TOKEN> \
--enable-profiler --enable-profiler-memory --enable-metrics
Next, ensure the service is running and restart your application. See Ensure the service is running and Start your applications.
Note
You must first install the Splunk OpenTelemetry Collector using the Debian or RPM packages.
After installing the Collector, follow these steps to install the package using the Debian or RPM repositories with root
privileges:
You can either download the
splunk-otel-auto-instrumentation
package directly from the GitHub Releases page or add the Splunk repository to the package repositories on your Linux host. See Debian or RPM package repositories for instructions on how to configure your package repository.Run the following commands to install the package. Replace
<path to splunk-otel-auto-instrumentation deb/rpm>
with the local path to the downloaded package.sudo dpkg -i <path to splunk-otel-auto-instrumentation deb>
sudo rpm -ivh <path to splunk-otel-auto-instrumentation rpm>
Edit the
/etc/otel/collector/splunk-otel-collector.conf
file to set theSPLUNK_ACCESS_TOKEN
andSPLUNK_REALM
variables to the values you got earlier. If the file does not exist, use the provided sample at/etc/otel/collector/splunk-otel-collector.conf.example
as a starting point.SPLUNK_ACCESS_TOKEN=<access_token> SPLUNK_REALM=<realm>
Start the collector service:
sudo systemctl start splunk-otel-collector
Ensure the service is running π
After a successful installation, run the following command to ensure the splunk-otel-collector
service is running:
sudo systemctl status splunk-otel-collector
If the service is not running, start or restart it with the following command:
sudo systemctl restart splunk-otel-collector
If the service fails to start, check that the SPLUNK_REALM
and SPLUNK_ACCESS_TOKEN
in /etc/otel/collector/splunk-otel-collector.conf
are correct. You can also view the service logs with this command:
sudo journalctl -u splunk-otel-collector
Start your applications π
For auto instrumentation to take effect, you must manually start or restart any Java applications on the host where you installed the package. This is true after installing the auto instrumentation package for the first time and whenever you make any changes to the configuration file.
After your applications are running, you can verify your data. See Verify that your data is coming into Splunk APM. You can also configure instrumentation settings. See (Optional) Configure the instrumentation.
(Optional) Configure the instrumentation π
The default settings for zero config autoinstrumentation are sufficient for most cases. You can set additional customizations by editing the configuration file.
The installation package contains the following artifacts:
The configuration file at
/usr/lib/splunk-instrumentation/instrumentation.conf
The Java Instrumentation Agent at
/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar
The shared instrumentation library at
/usr/lib/splunk-instrumentation/libsplunk.so`
The following is a sample of the default configuration file:
java_agent_jar=/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar
By default, the configuration file only specifies one parameter, java_agent_jar
, which points to the path of the installed Java Instrumentation Agent.
The following is a sample configuration that sets the service name and environment, activates CPU and memory profiling, and activates metric collection:
java_agent_jar=/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar
service_name=default.service
resource_attributes=deployment.environment=test
enable_profiler=true
enable_profiler_memory=true
enable_metrics=true
The Supported parameters section discusses additional parameters you can set in the configuration file.
Supported parameters π
The following table shows the supported parameters for the /usr/lib/splunk-instrumentation/instrumentation.conf
file.
Parameter |
Description |
Required |
---|---|---|
|
The full path to the JAR file provided by the installer. |
Yes |
|
An optional parameter that specifies a unique identifier for a particular host. If you set this parameter, all instrumented Java applications on the host have their service name set using the |
No |
|
Contains a comma-separated list of name-value pairs of the form |
No |
|
Set to |
No |
|
Set to |
No |
|
Set to |
No |
|
Set to |
No |
|
Set to |
No |
The /etc/ld.so.preload
file is automatically created or updated with the default path to the installed instrumentation library. If necessary, custom library paths can be manually added to this file.
Note
Whenever you change the configuration file, you must manually start or restart any Java applications on the host where you installed the package.
Advanced configuration π
More advanced configuration options like correlating traces and logs and activating custom sampling are available by configuring the Java agent.
Upgrade the package π
You can upgrade the package in two ways:
Upgrade using the package repository π
If you installed the package using the installer script, or if you configured the Debian or RPM package repositories manually, run the following commands according to your platform. Upgrading the package requires root
privileges.
Debian π
Run the following commands:
sudo apt-get update
sudo apt-get --only-upgrade splunk-otel-auto-instrumentation
You might see a prompt to keep or overwrite the configuration file at /usr/lib/splunk-instrumentation/instrumentation.conf
. If you choose to overwrite, the configuration file reverts to the default file provided by the upgraded package.
RPM π
For the RPM package management system, run the following commands:
yum π
sudo yum upgrade splunk-otel-auto-instrumentation
dnf π
sudo dnf upgrade splunk-otel-auto-instrumentation
zypper π
sudo zypper refresh
sudo zypper update splunk-otel-auto-instrumentation
After youβve upgraded the packages, manually start or restart the Java applications on the host for the changes to take effect.
Upgrade using Debian or RPM packages π
To manually upgrade the package:
Download the
splunk-auto-auto-instrumentation
Debian or RPM package for the target system from the GitHub Releases page .Run the following commands to install the package. Replace
<path to splunk-otel-auto-instrumentation deb/rpm>
with the local path to the downloaded package:sudo dpkg -i <path to splunk-otel-auto-instrumentation deb>
sudo rpm -Uvh <path to splunk-otel-auto-instrumentation rpm>
After upgrading the Debian package, you might see a prompt to keep or overwrite the configuration file at /usr/lib/splunk-instrumentation/instrumentation.conf
. If you choose to overwrite, the configuration file reverts to the default file provided by the upgraded package.
You can also upgrade using the same package repositories as the Collector. See Debian or RPM packages for more information.
Deactivate automatic instrumentation π
Use one of the following options to deactivate automatic instrumentation:
Uninstall the package by running the following command:
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \ sudo sh /tmp/splunk-otel-collector.sh --uninstall
See Uninstall on Linux for more information on the files deleted by the uninstall.
Set
DISABLE_SPLUNK_AUTOINSTRUMENTATION
to any nonempty value other thanfalse
,FALSE
, or0
.Set the
JAVA_TOOL_OPTIONS
environment variable to some value that you want the JVM to pick up.Delete or move the instrumentation.conf configuration file.
Next steps π
After activating automatic instrumentation, Verify that your data is coming into Splunk APM.
Troubleshooting π
If you activate auto instrumentation and you see an error message or you do not see any data in Observabiity Cloud APM, try the following steps:
Check the
splunk-otel-collector
service logs:
sudo journalctl -u splunk-otel-collector
You can also follow the steps to activate trace and troubleshoot the Java agent.
If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.
Available to Splunk Observability Cloud customers
Submit a case in the Splunk Support Portal .
Call Splunk Customer Support .
Available to prospective customers and free trial users
Ask a question and get answers through community support at Splunk Answers .
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.
To learn about even more support options, see Splunk Customer Success .