New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support opentelemetry Javaagent extensions #1758
Comments
If you have a custom image with your code already, all you should need to do is change the java image in the instrumentation object rather than change the environment variables. (docs) example:
|
Thanks @jaronoff97 for your reply! In that case, looks like we will need to build the propagator into the OpenTelemetry Java Agent to produce a single jar file. |
Let's reopen this, as the java extension questions come up often. We should consider supporting it and document it. We can still require users to provide a custom image with java agent but additionally copy the extension as well and allow configuring it. |
FROM busybox
ADD open-telemetry/opentelemetry-javaagent.jar /javaagent.jar
# Copy extensions to specify a path.
ADD open-telemetry/ext-1.0.0.jar /ext-1.0.0.jar
RUN chmod -R go+r /javaagent.jar
RUN chmod -R go+r /ext-1.0.0.jar apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: my-instrumentation
spec:
java:
image: custom-image:1.0.0
extensions: /ext-1.0.0.jar
env:
# If extension.jar already exists in the container, you can only specify a specific path with this environment variable.
- name: OTEL_EXTENSIONS_DIR
value: /custom-dir We can copy JVM parameters will also be added to the At the same time, add an environment variable If Are there any other better solutions? |
I need this as well and was working on a draft very similiar to @crossoverJie solution. Can a PR be opened? |
I'm preparing a code implementation, and I'll submit a PR after it's done. |
@crossoverJie @cb645j does the extension jar has to be rebuilt for every javaagent release? |
I would prefer if the extension Jar would be separate from the auto-instrumentation image. I am thinking of something like this: apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: my-instrumentation
spec:
java:
extensions:
- image: pavolloffay/java-auto-instrumentation-extension1
dir: /opt/java-extensions The operator would create an init-container per extension and copy the content from |
This is a good suggestion, and it is easier to maintain after separation. Please assign to me. |
@pavolloffay Maybe we don't need an array here, and we can put extensions together when we build a custom image. |
i agrree |
@pavolloffay @crossoverJie
or
|
I think using arrays makes it easier to integrate third-party extensions.
I also agree with keeping it simple, but we still need to separate the directory of extensions from the directory of agent, otherwise we cannot distinguish which one is agent and which ones are extensions. So maybe we can make dir an optional field with default value of |
Hi everyone! We are looking into implement an custom propagator to propagate x-request-id for ISTIO as an opentelemetry extension.
As instructed in this page, we can implement that, built it as a jar and build a custom java instrumentation image that include that jar.
But the OpentelemetryOperator has to instruct the client to use it by adding -Dotel.javaagent.extensions
I have tried something like the following in the Instrumentation Object:
However, only env names starting with OTEL_ and SPLUNK_ are supported.
Does anyone has any idea on how to instruct the application to use a opentelemetry extension? Thank you!
The text was updated successfully, but these errors were encountered: