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

Logging and Tracing in WildFly server #65

Closed
srinisubramanian opened this issue Oct 15, 2023 · 3 comments
Closed

Logging and Tracing in WildFly server #65

srinisubramanian opened this issue Oct 15, 2023 · 3 comments

Comments

@srinisubramanian
Copy link

srinisubramanian commented Oct 15, 2023

Followed the instructions and added -javaagent:/opt/app/opentelemetry-javaagent.jar

Added environment variables as export statemetns in standalone.sh which starts wilffly server (this is how I have used many other APM like Glowroot etc).

Even after 10 / 15 mintues traces and logs are not showing up on HyperDX cloud .. am I missing something?

# HyperDX integration
export OTEL_EXPORTER_OTLP_ENDPOINT="https://in-otel.hyperdx.io"
export OTEL_EXPORTER_OTLP_HEADERS="authorization=api-key"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_LOGS_EXPORTER="otlp"
export OTEL_SERVICE_NAME="DEV-Server"

I also tried adding as system properties by changing to otel.exporter.otlp.endpoint etc. That also does not help. Also strange is that I dont see any logs from the otel javaagent also.

The java command shows the -javaagent:/opt/app/opentelemetry-javaagent.jar as a part of it.

@srinisubramanian
Copy link
Author

Any hints on how to get this running

@srinisubramanian
Copy link
Author

srinisubramanian commented Nov 3, 2023

this works with environment variables. However the issue was that standalone.sh adds JAVA_OPTS="-javaagent:"${JBOSS_HOME}/jboss-modules.jar" if MODULE_OPTS is set to a javagent. Setting MODULE_OPTS is the recommended way. However when I remove jboss-modules.jar then the otlp export works and I can see all the logs. Strange but that seems to be the config that works.

@MikeShi42
Copy link
Contributor

@srinisubramanian apologies we missed this issue until I got the close notification for it! I haven't tested this myself, but if you specify JAVA_OPTS ="-javaagent:PATH/TO/opentelemetry-javaagent.jar", the standalone.sh should append the otel java agent correctly alongside jboss, though let me know if that's what you already tried and didn't work.

We should probably document this case, as I assume the default Java docs did not work out of the box for you.

fwiw in the future if there's cloud-related issues, https://www.hyperdx.io/support would be your best avenue to get a quick response :) (though in this case, I think it does apply to both sides)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants