We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There are services which throw error when an empty X-B3-ParentSpanId header sent with the HTTP request.
X-B3-ParentSpanId
From the openzipkin specification:
The X-B3-ParentSpanId header must be present on a child span and absent on the root span.
conn = Faraday.new() do |faraday| faraday.use ZipkinTracer::FaradayHandler, 'service_name' faraday.request :url_encoded faraday.adapter Faraday.default_adapter end conn.get('http://logs-01.loggly.com/inputs/TOKEN/tag/http/')
Result is 400 Bad request.
400 Bad request
If we don't send tracing headers, the response is the expected 403 Invalid API key:
403 Invalid API key
conn = Faraday.new() do |faraday| faraday.request :url_encoded faraday.adapter Faraday.default_adapter end conn.get('http://logs-01.loggly.com/inputs/TOKEN/tag/http/')
The only workaround i found so far is to monkey patch FaradayHandler with unless trace_id.send(method).to_s.empty? as below:
unless trace_id.send(method).to_s.empty?
require 'zipkin-tracer/faraday/zipkin-tracer' module ZipkinTracer class FaradayHandler < ::Faraday::Middleware def call(env) trace_id = TraceGenerator.new.next_trace_id TraceContainer.with_trace_id(trace_id) do b3_headers.each do |method, header| env[:request_headers][header] = trace_id.send(method).to_s unless trace_id.send(method).to_s.empty? end if Trace.tracer && trace_id.sampled? trace!(env, trace_id) else @app.call(env) end end end end end
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
There are services which throw error when an empty
X-B3-ParentSpanId
header sent with the HTTP request.From the openzipkin specification:
How to reproduce
Result is
400 Bad request
.If we don't send tracing headers, the response is the expected
403 Invalid API key
:Workaround
The only workaround i found so far is to monkey patch FaradayHandler with
unless trace_id.send(method).to_s.empty?
as below:The text was updated successfully, but these errors were encountered: