This package provides tracing to Java 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.27.jar https://epsagon-java-opentracing-agent.s3.amazonaws.com/epsagon-opentracing-agent-1.0.27.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.27.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:
Framework | Supported Version | Auto-tracing Supported |
---|---|---|
AWS Lambda | All | No |
Spring Boot | All | Yes |
Kafka Clients | >=0.11.0.0 | Yes |
Tomcat | >=7.0.0 | Yes |
RabbitMQ | >=2.7.0 | Yes |
Integrations
Epsagon provides out-of-the-box instrumentation (tracing) for many popular frameworks and libraries.
Library | Supported 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.
Parameter | Environment Variable | Type | Default | Description |
---|---|---|---|---|
EPSAGON_TOKEN | String | - | Epsagon account token | |
EPSAGON_SERVICE_NAME | String | Epsagon Application | Application name that will be set for traces | |
EPSAGON_COLLECTOR_ENDPOINT | String | - | The address of the trace collector to send trace to | |
EPSAGON_IGNORED_ENDPOINTS | Array | - | List of endpoints to ignore from tracing (for example /healthcheck ) | |
- | EPSAGON_REPORTER_LOG_SPANS | Boolean | True | A 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
Updated about a month ago