An extension for the OpenTelemetry Java agent designed to enrich HTTP client spans. It does this by automatically setting the peer.service
attribute based on the server.address
attribute.
This extension acts as an alternative to the built-in otel.instrumentation.common.peer-service-mapping
, which maps hostnames/IPs directly to a peer service name.
The build produces a single JAR: opentelemetry-java-auto-peer-service.jar
. Use it as an extension for the OpenTelemetry Java agent to customize how peer service names are assigned.
Download the latest JAR and launch your application with the following command:
wget https://github.com/yegor-usoltsev/opentelemetry-java-auto-peer-service/releases/latest/download/opentelemetry-java-auto-peer-service.jar
java -javaagent:opentelemetry-javaagent.jar \
-Dotel.javaagent.extensions=opentelemetry-java-auto-peer-service.jar \
-jar app.jar
This project uses Semantic Versioning
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.