https://github.com/cbos/custom-opentelemetry-agent-extension
Playground for a custom OpenTelemetry Java agent extension
https://github.com/cbos/custom-opentelemetry-agent-extension
Last synced: 8 months ago
JSON representation
Playground for a custom OpenTelemetry Java agent extension
- Host: GitHub
- URL: https://github.com/cbos/custom-opentelemetry-agent-extension
- Owner: cbos
- License: apache-2.0
- Created: 2025-10-01T13:28:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T19:09:27.000Z (8 months ago)
- Last Synced: 2025-10-01T21:15:13.476Z (8 months ago)
- Language: Java
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# custom-opentelemetry-agent-extension
Playground for a custom OpenTelemetry Java agent extension
This project has 3 modules:
- custom-api
This contains just the API with some interfaces
- custom-impl
This contains the implementation of the API
- custom-opentelemetry-agent-extension
This contains the custom OpenTelemetry Java agent extension which uses only the API
Custom API and implementation are just plain java modules without OpenTelemetry.
# Local development
## Prepare - download OpenTelemetry Java agent
```shell
mkdir -p .otel
OTEL_VERSION=2.20.1
echo "Download opentelemetry java instrumentation jar version $OTEL_VERSION"
curl -sL -o .otel/opentelemetry-javaagent.jar "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_VERSION/opentelemetry-javaagent.jar"
```
## Build and run
```shell
mvn clean package
java -javaagent:.otel/opentelemetry-javaagent.jar \
-Dotel.javaagent.extensions=custom-opentelemetry-agent-extension/target/custom-opentelemetry-agent-extension-1.0-SNAPSHOT.jar \
-Dotel.javaagent.configuration-file=opentelemetry-javaagent.properties \
-Dotel.service.name=CustomOtelAgentExtensionDemo \
-jar custom-implementation/target/custom-implementation.jar
```