Bundling AWS X-Ray Agent with -javaagent causes JVM metrics to stop being reported
- Dominant language
- Java
- Stars
- 46
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Following the [official documentation](https://docs.aws.amazon.com/xray/latest/devguide/aws-x-ray-auto-instrumentation-agent-for-java.html#XRayAutoInstrumentationAgent-GettingStarted) we noticed the the JVM heap size and max threads count has stopped being recorded after adding the X-Ray agent via JVM arguments.
Below screenshot shows before and after removing the -javaagent parameter from the JAVA_OPTS:

I've included the AWS X-Ray agent using maven POM dependencies **after** removing the disco jar library from the JVM arguments and it did not interfere with reporting the JVM metrics (it can be seen in the screenshot in the relevant part of the graph starting at 11:35).
I tried to reproduce it locally by configuring the IDE to start the microservice the same way that the ECS task definition is loading the disco agent jar but couldn't see the same issue.
I've also managed to get the metric value by enabling spring actuator and retrieved it from the EC2 instance itself:

But when calling the same metric via the ALB I was getting that the metric was not found.
Please let me know if agent/disco logs are needed and I will try to generate them.
Contributor guide
Assessment
This issue has not been assessed yet.