Replies: 1 comment
-
|
Thanks for reaching out. It might be sufficient to add the https://github.com/paketo-buildpacks/opentelemetry buildpack to the list of buildpacks you're using. Sample here. That will add in the standard Open Telemetry agent & configure it to run. You're referencing something that's specific to Grafana though. I've not encountered that before. Can you expand on that? Is there some vendor specific thing you need here? As opposed to the standard Otel agent? Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to add the grafana agent during the build image of my Spring Boot 3.5 project.
Right now, I use a Dockerfile that is the following
`
FROM openjdk:21-slim as backend_multi_layer
COPY app.jar .
RUN java -Djarmode=layertools -jar app.jar extract
FROM openjdk:21-slim
COPY --from=backend_multi_layer dependencies/ ./
COPY --from=backend_multi_layer snapshot-dependencies/ ./
COPY --from=backend_multi_layer spring-boot-loader/ ./
COPY --from=backend_multi_layer application/ ./
ADD https://github.com/grafana/grafana-opentelemetry-java/releases/download/v2.14.0.1/grafana-opentelemetry-java.jar /opt/grafana-opentelemetry-agent.jar
EXPOSE 80
ENV JAVA_TOOL_OPTIONS "-javaagent:/opt/grafana-opentelemetry-agent.jar -Dotel.instrumentation.micrometer.enabled=true -Dotel.exporter.otlp.protocol=http/protobuf -Dotel.resource.attributes=deployment.environment=production,service.name=foo,service.namespace=foo,service.version=0.0.10,service.instance.id=$HOSTNAME"
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]
`
But, I know it's not an optimise image, and Spring Boot has done a great job with the cmd 'buildBootImage'.
Is there any way to add the grafana-opentelemetry-agent.jar and the JAVA_TOOL_OPTIONS otel options without developing is own builder?
Beta Was this translation helpful? Give feedback.
All reactions