This package provides tracing to Java & Scala applications for the collection of distributed tracing and performance metrics in Epsagon.

📘

Open source repository

This is an open-source project which can be found at our GitHub repository.

Installation

To install Epsagon on AWS Lambda function:

<dependency>
  <groupId>com.epsagon</groupId>
  <artifactId>epsagon</artifactId>
  <version>{Epsagon version}</version>
</dependency>

The version will be in the format n.n.n, latest maven-central version is specified at the top as a badge.

For any other environment, download the tracer using curl:

curl -o epsagon-opentracing-agent-1.0.49.jar https://epsagon-java-opentracing-agent.s3.amazonaws.com/epsagon-opentracing-agent-1.0.49.jar

Usage

Auto-tracing

The simplest way to get started is to run your Java command with the following environment variable:

export EPSAGON_TOKEN=epsagon-token
export EPSAGON_SERVICE_NAME=app-name-stage
java -javaagent:.path_to_epsagon_agent -jar your jar file

For example:

export EPSAGON_TOKEN=your-token
export EPSAGON_SERVICE_NAME=spring-prod
java -javaagent:./epsagon-opentracing-agent-1.0.49.jar -jar app.jar

You can see the list of auto-tracing supported frameworks

Ignore Endpoints

You can ignore certain incoming requests by specifying endpoints:

export EPSAGON_IGNORED_ENDPOINTS=healthcheck, health

Frameworks

The following frameworks are supported by Epsagon:

FrameworkSupported VersionAuto-tracing Supported
AWS LambdaAllNo
Spring BootAllYes
Kafka Clients>=0.11.0.0Yes
Tomcat>=7.0.0Yes
RabbitMQ>=2.7.0Yes

Integrations

Epsagon provides out-of-the-box instrumentation (tracing) for many popular frameworks and libraries.

LibrarySupported Version
kafka-clients>=0.11.0.0
aws-java-sdk>=1.11.0
software.amazon.awssdk/sdk-core>=2.2.0
Apache HttpClient>=4.0
Apache HttpAsyncClient>=4.0

Configuration

Advanced options can be configured as a parameter to the init() method or as environment variables.

ParameterEnvironment VariableTypeDefaultDescription
EPSAGON_TOKENString-Epsagon account token
EPSAGON_SERVICE_NAMEStringEpsagon ApplicationApplication name that will be set for traces
EPSAGON_COLLECTOR_ENDPOINTString-The address of the trace collector to send trace to
EPSAGON_IGNORED_ENDPOINTSArray-List of endpoints to ignore from tracing (for example /healthcheck)
-EPSAGON_REPORTER_LOG_SPANSBooleanTrueA flag to disable Epsagon trace sending (if set to False

To Enable debug prints for troubleshooting add "-Depsagon.slf4j.simpleLogger.defaultLogLevel=info" to the java command


Did this page help you?