Class: Labkit::Tracing::JaegerFactory
- Inherits:
-
Object
- Object
- Labkit::Tracing::JaegerFactory
- Defined in:
- lib/labkit/tracing/jaeger_factory.rb
Overview
JaegerFactory will configure Jaeger distributed tracing
Constant Summary collapse
- DEFAULT_PROBABILISTIC_RATE =
When the probabilistic sampler is used, by default 0.1% of requests will be traced
0.001
- DEFAULT_UDP_PORT =
The default port for the Jaeger agent UDP listener
6831
- FLUSH_INTERVAL =
Reduce this from default of 10 seconds as the Ruby jaeger client doesn’t have overflow control, leading to very large messages which fail to send over UDP (max packet = 64k) Flush more often, with smaller packets
5
Class Method Summary collapse
Class Method Details
.create_tracer(service_name, options) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/labkit/tracing/jaeger_factory.rb', line 24 def self.create_tracer(service_name, ) # The service_name parameter from GITLAB_TRACING takes precedence over the application one service_name = [:service_name] if [:service_name] # parse reporter headers as necessary headers = build_headers() kwargs = { service_name: service_name, sampler: get_sampler([:sampler], [:sampler_param]), reporter: get_reporter(service_name, [:http_endpoint], [:udp_endpoint], headers), }.compact extra_params = .except(:sampler, :sampler_param, :http_endpoint, :udp_endpoint, :strict_parsing, :debug) if extra_params.present? = "jaeger tracer: invalid option: #{extra_params.keys.join(", ")}" raise if [:strict_parsing] warn end Jaeger::Client.build(**kwargs) end |