elastic / elastic/apm-agent-java
STARTUP TUNING: Further startup speedups
- Lingua principale
- Java
- Stelle
- 594
- Fork
- 338
- Merge medio
- 1g 13h
- PR unite (30g)
- 25
Descrizione
## Is your feature request related to a problem?
Synchronous startup would ideally be faster for some types of apps (eg serverless functions)
## Describe the solution you'd like
Speedup or spin into other threads anything on the synchronous startup path
## Describe alternatives you've considered
See https://github.com/elastic/apm-agent-java/issues/2349
## Additional context
The following shows a basic synchronous startup (at time of agent version 1.29.0, for an agent with no instrumentations applied) with time broken down into major sections and some some suggested possible improvements
Agent step | % time taken | Suggested improvement
-- | -- | --
from JVM initialization to ElasticApmAgent class initialization | 12.27% | Can't improve
from class initialization to initialize() | 1.23% | Can't improve
get config sources | 1.23% | statically generate?
LoggingConfiguration.init | 6.75% | Issue #2457
getLogger() - ie the rest of the logging framework initialization | 20.25% | Issue #2457
setup default config registry | 3.68% | statically generate?
new ApmServerClient | 2.45% | Spin off to another thread?
new MetaData | 0.92% | statically generate?
new ReporterFactory | 2.15% | make lazy?
new ElasticApmTracer | 1.53% | make lazy?
DependencyInjectingServiceLoader.load(LifecycleListener) | 4.91% | statically generate?
DependencyInjectingServiceLoader.load(ElasticApmInstrumentation) | 14.11% | statically generate?
new ByteBuddy | 2.45% |
new AgentBuilder | 16.56% | Applying instrumentations, so only byte buddy can make this faster - but warmup can be speeded up?
applyAdvices | 0.00% | dependent on instrumentation configured
agentBuilder.installOn (includes matching, applying advice, warmup) | 7.36% | dependent on instrumentation configured
start tracer | 2.15% | dependent on instrumentation configured
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con il percorso di avvio sincrono dall’inizializzazione della classe ElasticApmAgent fino a initialize(), utilizzando la suddivisione dei tempi riportata nell’issue. Leggi le aree elencate, tra cui LoggingConfiguration.init, ApmServerClient, MetaData, ReporterFactory, ElasticApmTracer, DependencyInjectingServiceLoader, ByteBuddy e AgentBuilder, e rivedi le issue #2457 e #2349. Il lavoro è completato quando si dimostra una riduzione misurabile del tempo di avvio sincrono, ma non è specificato alcun obiettivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- performance
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100