rustracing_jaeger icon indicating copy to clipboard operation
rustracing_jaeger copied to clipboard

Ability to send spans directly to collector over HTTP

Open maackle opened this issue 5 years ago • 1 comments
trafficstars

First of all, I'm new to Jaeger so I don't know if I'm asking exactly the right question. But, it seems like rustracing_jaeger is a client which requires a jaeger-agent to be running on the same machine (or the jaeger-all-in-one docker image which also includes a jaeger-agent).

Is there any way to configure the client to bypass the Agent and send spans to a remote Collector directly over HTTP, i.e. using port 14268 in the default Collector config? If not, how hard would this be to add? I would consider adding it if you don't want to, and if it would be beneficial for others, because it would certainly be beneficial for me. Any advice on this?

maackle avatar Jan 21 '20 23:01 maackle

Thank you for your question and proporsal.

it seems like rustracing_jaeger is a client which requires a jaeger-agent to be running on the same machine

Yes, your understanding is correct. For now, this crate doesn't provide a way to send spans to the HTTP endpoint of a remote jaeger-collector. Unfortunately, I don't have enough time to implement it, but it's welcome to add the feature if you could.

how hard would this be to add?

I'm unfamiliar with Jaeger's HTTP API, so I cannot answer this question confidently. Just an FYI, I recently received a PR sile/jaeger_passage#3 of which motivation is the same with this issue (note that jaeger_passage is an Erlang jaeger client library, not Rust). As far as looking the part of the PR diff (see below), it seems not so difficult to implement this feature:

% https://github.com/sile/jaeger_passage/pull/3/files#diff-8cbacd3c0416a7088fa351521f45d743R168-R172
Name = maps:get('location.application', passage_span:get_tags(Span), DefaultName),
Message = jaeger_passage_thrift:make_batch(Name, Tags, [Span]),
Encoded = thrift_protocol:encode_struct(Message, binary),
Headers = [?CONTENT_TYPE],
HttpClient(URI, post, Headers, Encoded, Options),

Anyway, if you could create a draft PR, I would review it and help you if needed.

sile avatar Jan 22 '20 12:01 sile