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

Add ability to configure the agent via external JSON file #33

Closed willarmiros closed 4 years ago

willarmiros commented 4 years ago

Description of changes: Overhauled the XRaySDKConfiguration class to enable configuration of nearly all properties currently configurable programmatically using the default SDK. We use our existing dependency on Jackson to do the parsing, though we use the lower level JsonParser API instead of the ObjectMapper for performance.

The configuration parser will throw a runtime error during application startup if the provided JSON file is malformed or any of the configuration settings are invalid. The alternative is to log an error and fall back to default settings, but we don't do that since that might be more unexpected or difficult to debug for users than just failing fast with detailed error messages.

Also updated the readme to document the config in more detail and fixed a few other minor bugs.


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