Skip to content
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

SDK wasn't initialized with JRE #2036

Open
kumachop2 opened this issue Sep 10, 2024 · 4 comments
Open

SDK wasn't initialized with JRE #2036

kumachop2 opened this issue Sep 10, 2024 · 4 comments
Labels
more-info-needed Request for more information from issue author

Comments

@kumachop2
Copy link

Team, We have been using OpenJDK JDK version last two years in AKS. We have direction to switch it to JRE instead of JDK. Based on documentation JVMs are compatible with JDK or JRE, hence we switched to JRE but SDK is not getting initialized. I tried to enable otel javaagent debug mode but not much help in the pod logs. This could be due to missing some dependent libraries. Would you please assist here

Command: RUN chmod -R go+r /splunk-otel-javaagent.jar
Java Version: OPenJDK17
Splunk SDK: v1.32.0

Please let me know for additional information. Much appreciated timely response.

@breedx-splk
Copy link
Contributor

Hi @kumachop2. There are several vendors that provide different builds/distributions of OpenJDK 17. Can you please be very specific and show us exactly which version from which vendor you are using? Maybe you can provide a download link here.

Can you paste the error message you are seeing? What makes you believe that the SDK is not being initialized?

Furthermore, please provide the full commandline you are using when launching the JVM. Thanks.

@breedx-splk breedx-splk added the more-info-needed Request for more information from issue author label Sep 10, 2024
@kumachop2
Copy link
Author

@breedx-splk Thanks much for the prompt response. Please find below the requested details.

What makes you believe that the SDK is not being initialized? -- I'm not seeing any traces as well as there is no java agent references in Pod logs. I haven't made any changes to command line other than switching runtime.

OpenJDK17 JDK- UBI8 - https://catalog.redhat.com/software/containers/ubi8/openjdk-17/618bdbf34ae3739687568813

OpenJDK17 JRE - UBI8 - https://catalog.redhat.com/software/containers/ubi8/openjdk-17-runtime/618bdc5f843af1624c4e4ba8?architecture=arm64&image=66bcc05ba3857fbc34f4dd89

Command: from Docker file

Copy over our Java Agent JAR to our runtime container

COPY --chown=jboss --from=explodeJar /deployments/BOOT-INF/lib/splunk-otel-javaagent-*.jar /deployments/lib/

Environment variables provided within the UBI image

ENV JAVA_OPTIONS="-javaagent:/deployments/lib/splunk-otel-javaagent-1.32.0.jar -XX:+UseZGC -Xms1024m -Xmx1024m -XX:+PrintCommandLineFlags"

Please let me know for additional information

@breedx-splk
Copy link
Contributor

@kumachop2 thanks for the info. I was able to confirm that the agent works with the RedHat JRE mentioned above. I think your problem might be the use of JAVA_OPTIONS instead of JAVA_OPTS?

Here is a Dockerfile I hacked together that does indeed fire up with the agent:

Dockerfile
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20-3.1723644089

USER 0
RUN mkdir /app
ADD https://github.com/signalfx/splunk-otel-java/releases/download/v1.32.4/splunk-otel-javaagent.jar /app/splunk-otel-javaagent-1.32.0.jar
# Note: petclinic is just a sample runnable jar for testing
COPY spring-petclinic-rest-3.2.1.jar /app/
RUN chown jboss /app/*

USER jboss

# Note: JAVA_OPTS works but JAVA_OPTIONS does not
#ENV JAVA_OPTIONS="-javaagent:/app/splunk-otel-javaagent-1.32.0.jar -XX:+UseZGC -Xms1024m -Xmx1024m -XX:+PrintCommandLineFlags -Dotel.javaagent.debug=true"
ENV JAVA_OPTS="-javaagent:/app/splunk-otel-javaagent-1.32.0.jar -XX:+UseZGC -Xms1024m -Xmx1024m -XX:+PrintCommandLineFlags -Dotel.javaagent.debug=true"
ENV JAVA_APP_JAR=/app/spring-petclinic-rest-3.2.1.jar

Also note that I added the -Dotel.javaagent.debug=true param just to more easily confirm that the agent was being loaded (it was).

@kumachop2
Copy link
Author

@breedx-splk Thank you for your inputs. Will try and revert. I'm using OTEL_JAVAAGENT_DEBUG environment variable to true in deployment yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed Request for more information from issue author
Projects
None yet
Development

No branches or pull requests

2 participants