Here is the main logic for jaeger agent and jaeger collector. (Based on jaeger 1.13.1)