Comments (3)
Hi @dan-lind,
Thanks for raising this issue. I experienced this while developing the agent as well and spent quite a long time investigating it without too many results. I achieved incremental results by reducing our usage of Jackson Object Mappers and lowering the timeout of some of the metadata endpoint requests our plugins make during initialization. But none of these seemed to address the root cause of the very long startup time. My latest findings were that the slowdown definitely involves the initial agent configuration (in XRaySDKConfiguation
) and might have something to do with loading the AWS SDK.
I'll leave this open as a bug while I continue to investigate it.
from aws-xray-java-agent.
I did some more digging on my side. It looks to me like the xray agent itself doesn't add that much time, maybe around 3-5 seconds or so in. Rather it seems to be the disco agent that adds most of the overhead. For example each SdkClient takes a second or so, with the first one taking 3-5 seconds.
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
SsmClient: 3580 ms
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
DDB Enhanced client: 807 ms
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
SesClient: 904 ms
[software.amazon.disco.agent.awsv2.AWSClientBuilderInterceptor] DiSCo(AWSv2) method interception of public final java.lang.Object software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build()
CloudWatch client: 342 ms
Same init without the agent
SsmClient: 276 ms
DDB Enhanced client: 38 ms
SesClient: 41 ms
CloudWatch client: 15 ms
Also noticed that in my case, Disco lists the same DataAccessor 5 times as an "installable" for the web plugin. Not sure if it adds to the overhead or not.
[software.amazon.disco.agent.DiscoAgent] DiSCo(Agent) Plugin name: disco-java-agent-web-plugin.jar
Bootstrap: no
Installables: software.amazon.disco.agent.web.servlet.HttpServletServiceInterceptor,
software.amazon.disco.agent.web.apache.httpclient.ApacheHttpClientInterceptor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor,
software.amazon.disco.agent.interception.templates.DataAccessor
These numbers only account for around 10 of the ~25 seconds of slowdown to the startup that I see when running locally, so there is probably more overhead coming from the disco agent. So I guess that this slowdown is patially/mostly an issue for another repo.
from aws-xray-java-agent.
Hmm yeah this makes sense, since ByteBuddy does have to do some magic to change the bytecode of all those AWS SDK clients when their classes are loaded for auto-instrumentation to occur. The Disco team is working on removing the DataAccessor pattern altogether since it's somewhat of a legacy way of doing introspection anyway. They're also working on more general performance improvements. Feel free to raise this issue over with them as well: https://github.com/awslabs/disco
from aws-xray-java-agent.
Related Issues (20)
- Jackson dependency & Shadow HOT 3
- Using xray-agent 3.3.3 in AML2 on tomcat server HOT 2
- Using X-Ray Agent in Spring Boot & Zuul Proxy API Gateway HOT 1
- Java Agent doesn't respect log level when using Spring Boot
- Java agent interferes with Spring Boot executable jar classpath resolution HOT 1
- X-Ray Errors HOT 2
- Downstream AWS service calls annotated as remote HOT 10
- Not emitting segment named 'demo' as it parents in-progress subsegments HOT 1
- Trace ID injection doesn't work with Spring Boot HOT 6
- Add Spring Boot Smoke Test
- Agent doesn't take X-Forwarded-For header into account HOT 5
- Update Java SDK and add aws-java-sdk-sts library inside jar HOT 10
- Cannot HandlerContextKey Class ENDPOINT_OVERRIDDEN HOT 4
- I hope disco works with javaagent attach method HOT 3
- Wildfly agent issue HOT 5
- FR: Support for Spring WebClient HOT 1
- Dynamic name using only disco library HOT 2
- XRAY Agent Application Logging HOT 2
- Smoke tests for distribution channel monitoring
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-xray-java-agent.