Module: Appsignal::Integrations::HttpIntegration::ContextInjection

Defined in:
lib/appsignal/integrations/http.rb

Overview

Trace context has to ride on each outgoing hop's headers, so it's injected at HTTP::Client#perform -- the single send chokepoint in both http5 and http6, called once per request and once per redirect hop -- where the live request headers are reachable. The event stays at the request boundary above, so a redirected request is still a single event; this only propagates context, and every hop carries it. No-op outside collector mode. req.headers is the live outgoing header set and a valid carrier (it responds to []=).

Instance Method Summary collapse

Instance Method Details

#perform(req, options) ⇒ Object



72
73
74
75
# File 'lib/appsignal/integrations/http.rb', line 72

def perform(req, options)
  Appsignal::OpenTelemetry.inject_context(req.headers)
  super
end