Skip to content

stse/opentelemetry-javaagent-buildpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghcr.io/making/buildpacks/opentelemetry-javaagent

The OpenTelemetry Java Agent Buildpack is a Cloud Native Buildpack that contributes the OpenTelemetry Java Agent.

Behavior

This buildpack will participate if all the following conditions are met

  • the build plan contains jvm-application
  • $BP_DISABLE_OTEL_JAVAAGENT is not set

The buildpack will do the following:

  • Contributes a Java agent to a layer and configures JAVA_TOOL_OPTIONS to use it

This buildpack does not configure Java system properties (-D flags) or as environment variables for the agent. See the configuration documentation for the full list of configuration items.

Example

git clone https://github.com/making/hello-servlet.git
pack build hello-servlet \
  --path hello-servlet \
  --buildpack paketo-buildpacks/java \
  --buildpack ghcr.io/making/buildpacks/opentelemetry-javaagent \
  --builder paketobuildpacks/builder:base
docker run \
  --rm \
  -p 9411:9411 \
  openzipkin/zipkin-slim

docker run \
  --rm \
  -p 8080:8080 \
  -e JAVA_TOOL_OPTIONS="-Dotel.resource.attributes=service.name=hello-service -Dotel.traces.exporter=zipkin -Dotel.exporter.zipkin.endpoint=http://host.docker.internal:9411/api/v2/spans" \
  hello-servlet
curl http://localhost:8080

Go to http://localhost:9411 image

License

This buildpack is released under version 2.0 of the Apache License.

About

Cloud Native Buildpack for OpenTelemetry Java Agent

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%