-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
Unifying Jaeger clients design #1269
Comments
What about error conditions in Transport and Sender? Should a multiple return value be standardized for marshaling up errors like in go's Flush() and Append()? This wouldn't be idiomatic in python or java, where exceptions should be clearly thrown, but the metrics factories require a fair amount of awareness in the RemoteReporter that can't be easily obtained otherwise (e.g. keeping a counter of appended spans). |
I think returning multiple values is fine in Python, I've seen it done. In Java, we could throw a custom exception, or use an observer, or ... open to suggestions |
What's the status here? I stumbled over it again the last couple days when refactoring some stuff. In C#, we already have senders, but the
I would like an approach, where the data would be encapsulated in a way that allows us to write a more generic The approach that I will look into next is having an |
@yurishkuro I played around with this idea and got something working over at https://github.com/jaegertracing/jaeger-client-csharp/tree/Falco20019/encoder-transport I ended up with The What do you think about this approach? I like it to the extend that it abstracts the logic for the size stuff and append-flush-cycles away. But I don't like that I was not able to find a more generic and fitting way. |
I think the concept of Encoder works ok when dealing with encoding-agnostic transports like UDP or HTTP, but I am not sure how easy it is to use |
Per #3362, we're sunsetting Jaeger clients. |
There are many discrepancies in the Jaeger clients today about how their internal components are implemented. It would be good to come up with an abstract reference design and gradually ensure all clients follow the pattern. Specifically, the most divergence is in the implementation of span reporting. I think the following is the type system that we want to use going forward:
Reporter
: an abstract interface for doing something with finished spans. Examples may include:RemoteReporter implements Reporter
: responsible for taking the finished spans off the hot path of the request, e.g. by putting them in a queue consumed by a background thread, or some other form of async processing.Sender
to actually send the spans out of process.sender.append()
on new span in the queuesender.flush()
whenreporter.close()
is called in order to fully drain the queueSender
: an abstract interface with two methods,append
andflush
. Implementations may acceptEncoder
andTransport
as dependencies.append()
may buffer new spans for sending out later in a batch, or may flush them immediately (e.g. if its internal buffer is full or reached the max packet size). Returns the number of spans flushed, if any.flush()
immediately sends all spans from the internal buffer, and returns the number of spans successfully send.Transport
is used by theSender
to send a batch of spans to the target destination, e.g. the agent or the collector. API of the Transport may be language-specific. It accepts the batch already encoded to a series of bytes, to allow for decoupling of the encoding format (Thrift, JSON, proto) from the communication channel (HTTP, UDP, Kafka).Encoder
converts a batch of spans into a sequence of bytes.Sample Sender interface:
The text was updated successfully, but these errors were encountered: