owais / splunk-otel-java

Splunk Distribution of OpenTelemetry Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Get Started   •   Get Involved   •   Migrate from SignalFx Java Agent

Stable OpenTelemetry Instrumentation for Java Version Splunk GDI specification GitHub release (latest SemVer) Maven Central Build Status

Examples   •   About the distribution   •   Security   •   Supported Libraries   •   Troubleshooting


The documentation below refers to the in development version of this package. Docs for the latest version (v1.3.1) can be found here.


Splunk Distribution of OpenTelemetry Java

The Splunk Distribution of OpenTelemetry Instrumentation for Java provides a Java Virtual Machine (JVM) agent that automatically instruments your Java application to capture and report distributed traces to Splunk APM.

This distribution comes with the following defaults:

If you're currently using the SignalFx Java Agent and want to migrate to the Splunk Distribution of OpenTelemetry Java, see Migrate from the SignalFx Java Agent.

Requirements

The agent works with Java runtimes version 8 and higher. For the full list of requirements and supported libraries and versions, see Requirements for the Java agent in the official Splunk documentation.

Get started

Follow these steps to automatically instrument your application using the Java (or JVM) agent.

  1. Check that you meet the requirements.

  2. Make sure that the collector you set up to receive trace data is installed and configured.

  3. Download the JAR file for the latest version of the agent.

    • On Linux, run:

      curl -L https://github.com/signalfx/splunk-otel-java/releases/latest/download/splunk-otel-javaagent-all.jar \
      -o splunk-otel-javaagent.jar
    • On Windows (PowerShell), run:

      Invoke-WebRequest -Uri https://github.com/signalfx/splunk-otel-java/releases/latest/download/splunk-otel-javaagent-all.jar -OutFile splunk-otel-javaagent.jar
  4. Set the OTEL_SERVICE_NAME environment variable.

    • On Linux, run:

      export OTEL_SERVICE_NAME=<yourServiceName>
    • On Windows (PowerShell), run:

      $env:OTEL_SERVICE_NAME=<yourServiceName>
  5. Enable the Java agent.

    java -javaagent:./splunk-otel-javaagent.jar \
      -jar <myapp>.jar

    Insert the -javaagent flag before the -jar file, adding it as a JVM option, not as an application argument.

To generate a snippet that includes all the basic install commands for your environment and service, open the Observability Cloud wizard in Data Setup > APM Instrumentation > Java > Add Connection.

When you run your application with the Java agent, trace data goes to Observability Cloud through the Splunk OTel connector. If no data appears in Observability > APM, see Troubleshooting.

For full install instructions, including K8s and Lambda snippets, see Instrument Java services for Observability Cloud in the official Splunk documentation.

To see the Java Agent in action with sample applications, see our examples.

Advanced configuration

To fully configure the agent of the Splunk Distribution of OpenTelemetry Java, see Configure the Java agent in the official Splunk documentation.

Correlating traces with logs

The Splunk Distribution of OpenTelemetry Java provides a way to correlate traces with logs. For more information see Connect Java application trace data with logs in the official Splunk documentation.

Manually instrument a Java application

Documentation on how to manually instrument a Java application is available in the OpenTelemetry official documentation. To learn how to add custom metrics to your application please consult our docs .

To extend the instrumentation with the OpenTelemetry Instrumentation for Java, you have to use a compatible API version.

The Splunk Distribution of OpenTelemetry Java version 1.3.1 is compatible with:

  • OpenTelemetry API version 1.5.0
  • OpenTelemetry Instrumentation for Java version 1.5.2
  • Micrometer version 1.7.3

Snapshot builds

We publish bleeding edge snapshot builds with every merge to the main branch. Snapshots are primarily intended to test new functionality and are not recommended for production use.

Troubleshooting

For troubleshooting information and known issues, see Troubleshooting Java instrumentation in the official Splunk documentation.

License and versioning

The Splunk Distribution of OpenTelemetry Java is a distribution of the OpenTelemetry Instrumentation for Java project. It is released under the terms of the Apache Software License version 2.0. For more details, see the license file.

About

Splunk Distribution of OpenTelemetry Java

License:Apache License 2.0


Languages

Language:Java 91.8%Language:Kotlin 5.9%Language:Shell 1.2%Language:Python 0.5%Language:Dockerfile 0.4%Language:Groovy 0.2%