TraceMole is architected to be extremely lightweight, injecting minimal runtime latency into database query paths.
TELEMETRY AGENT FLOW CHART
1. [App Service] Runs db query (e.g. MongoDB find)
└── Wrapped by TraceMole driver interface
2. [Wrapper] Checks query execution time
├── If < 100ms: Returns query results immediately (0ms overhead)
└── If > 100ms: Spawns async explain job thread
3. [Explain Thread] Runs .explain() in background
└── Posts explain metrics payload to TraceMole OTLP ingestion receiver
This checks-and-balances workflow prevents query analysis overhead from bloating transaction loops. Standard queries bypass explains completely, ensuring optimal production performance profiles.