This is a demo project for Signoz Java agent, which shows how to use Signoz Java agent in a Java application.
Download Opentelemetry Java agent:
# get opentelemetry Java agent
mkdir agent
wget -O ./agent/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
# Set service name
export OTEL_RESOURCE_ATTRIBUTES=service.name=sgapp
# Set Signoz server address
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
Add -javaagent
option to your Java application.
mvn clean package
# Set service name
export OTEL_RESOURCE_ATTRIBUTES="service.name=sgapp,service.namespace=default,development.environment=demo"
# Set Signoz server address
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
java \
-javaagent:./agent/opentelemetry-javaagent.jar \
-jar target/sgapp-0.0.1-SNAPSHOT.jar