aws / aws-xray-java-agent

The official AWS X-Ray Auto Instrumentation Agent for Java.
Apache License 2.0
42 stars 18 forks source link

Bundle dependencies in Agent JAR rather than requiring customers add them #53

Closed willarmiros closed 4 years ago

willarmiros commented 4 years ago

Issue #, if available: fixes #7

Description of changes: Creates the X-Ray Agent JAR as an Uber JAR containing:

This allowed us to remove the awkward separate AWS SDK handler libraries that customers would also have to depend on to have AWS SDK requests traced. I removed AWS SDK V2 Handler dependency on the AWS SDK V2 itself, so we wouldn't have to bundle both versions of AWS SDK into the jar. Also simplified the publishing logic a little bit, added some more safety to AWS SDK handlers, and removed the old reflective way of getting the AWS SDK handlers.

Tested on a Spring boot sample app with varied dependency versions (including 4-year-old versions of AWS SDK and Jackson). Was able to accomplish both auto and manual instrumentation with a Recorder shared between the agent and application.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.