-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[tracking issue] Client libraries in different languages #366
Comments
Hi, trying to add a C# client porting from the Java client but still very early; I just started today. Any feedback would be helpful |
I note that neither Rust nor lua are on your list? Any plans to add them? (We are using openresty which leads to the Lua interest, and Rust - well Rust is cool :)) |
If someone implements then then we'd be glad to include in the official list. So far I haven't seen anyone asking/trying, so no plans. Also, we're working on a c++ client, I wonder if some of the languages can be done as wrappers on top of that. |
I'd very much encourage writing such a low level client in a more modern systems language like Rust : more cleanly bindable to C (no need to explicitly opt out of the rtti support or pull in the C++ support libraries), and very very safe. We have some components that are nginx+openresty, so we have interest in Lua (language) support + openresty bindings : I am thinking we'll just implement the whole store in Lua rather than have to surface span data from a C++ module back up through nginx's C core and then in to Lua. |
Anything yet for Javascript in browser ? |
Nobody is working on it right now (jaegertracing/jaeger-client-javascript#1 - help wanted) |
@rbtcollins I wonder what the performance will look like compared to just wrapping the C++ client in a luarocks package and using that. @yurishkuro I have also been wondering what it would take to wrap all the client languages around the C++ client. Here is the plan as of now: Java: JNI (no one likes it though, so IDK) The easiest, by far, is Lua (I have some experience here). The others might be harder. On the flip-side, I wonder how easy it is to do this very same thing with the Go client once it is compiled. Any thoughts and/or experience here would be greatly appreciated. |
Yes, we discussed the possibility, but until we actually try with some languages it's hard to see all pros & cons (and there are a lot of cons to wrapping). |
@isaachier I have zero interest in debugging interactions between C++ RTTI and exceptions, and any host language. We need anything that is going to be surfaced in such a way to be rock solid and have no corner cases that will make it a liability rather than an asset. rustlang or C would make good 'lowest common denominator' languages, if having a bridge mechanism to a single set of implementation backends is desirable - they can both be bound to with no runtime support, without having to disable language features (unlike e.g. C++ where the default requires runtime support). That said, I fully expect every non-trivial language to demand, and get, 100% native bindings. There's nothing in Opentracing/Jaeger/Thrift that would make native support hard/infeasible. On the list of languages you've got, I can specifically say:
|
@rbtcollins interesting point about Rust vs. C++. I am actually amazed to hear that you prefer Rust to C++ in the area of language bindings. I had always heard the compiler support for Rust is much more limited than C++, and neither compare to C, which has a compiler for almost every conceivable platform. But I do understand the concern. For that reason, I think gRPC was motivated to write its core library in C++ without any STL (making it pretty much C). Meanwhile, I think you are correct that the "best" thing would be to have a native library for each and every language. But I'm interested in hearing your opinion for the following difficulties:
|
I am also interested in another consideration - if we take our Python client and reimplement it as a wrapper on top of C++ client, how much functionality will be removed from the pure-Python part of the combo? We still have to implement the OpenTracing API, but probably concerns like different samplers, retrieving samplers from the agent, and the whole async span reporting could be moved to C part.
I tend to agree with that, not so much based on experience, but on the fact that out Python/Node clients already depend on modules like thriftrw which use C bindings and require compilation during install. But we only use Linux/MacOS, so don't know how well this would work on other platforms. |
About the bindings, there is a certain amount of bridge code for each language. I think it comes down to how much you want the code to look idiomatic (i.e. avoiding calling Python functions with mysterious handle objects, manual resource management, and the like). I'd advocate not using the language itself to implement span objects etc. because of the repetition and the memory overhead. This takes some clever coding but isn't too hard. The build shouldn't really be a concern. The only thing I worry about is the C vs. C++ debate. Worst case scenario, we could refactor some of the core C++ types to C structs. The only reason I haven't yet considered that seriously is that there is no OpenTracing C API, and if that API is released down the line, it would probably invalidate any Jaeger-specific code I write now. |
I don't see how you'd do that since the end user is still going to interact with object-oriented OpenTracing API. Unless you're saying that you can create C-bound objects that look like normal host language objects to the end user. |
Ya essentially all fields are in the C struct and you point all setters and getters to conversion functions so they get a pretty Python/Ruby/Lua value. If you want to be really efficient you can do this at multiple levels so there is truly no-copying/allocation beyond that initial struct. For example, consider using a custom tag list struct instead of copying tags into a new Python list. Then implement Python list operations for the tag list struct. The client doesn't realize it isn't a native list because it implements the sequence interface. |
@isaachier by compiler support for rust, I'm not sure what you're referring to. Rust was built to integrate with Firefox's core - thats a primary use case for it (and it has delivered many of the major perf improvements in recent firefox :)). What memory overhead are you worried about with native implementations? Remember that when you have bindings you end up with separate arenas for the external objects, which can spread memory footprint out somewhat. |
I mean embedded systems. I know there is interest in tracing for IoT devices. Rust may not target these devices as well as C++. Memory isn't the main consideration here. More of a bonus. |
It should be pretty good. It's main requirement for a platform is llvm. E.g
https://dylanmckay.io/blog/rust/avr/llvm/2017/02/09/safer-microcontrollers-almost-here.html
|
OK did some research and cannot find much evidence that C is inherently better for bindings than C++ with and C wrapper API (i.e. |
Hi @yurishkuro , would you like to accept the lvht/jaeger-php as the official PHP client of Jaeger? |
Have not tried this, but here is a Rust Jaeger client built on top of another Rust opentracing API: rustracing_jaeger |
BTW @rbtcollins Rust just announced they will be working on better embedded support this year. https://internals.rust-lang.org/t/announcing-the-embedded-devices-working-group/6839 |
is there any Lua client or any other way to use jaeger in Lua language? |
@ldeveloperl1985 that largely depends on whether or not OpenTracing decides to support Lua. Also, the issue of many different dialects makes the situation much more difficult. Which version of Lua do you use? Is it original Lua or LuaJIT? |
I've used kong 0.11v. which uses Lua 5.1 and LuaJIT 2.1.0 |
Kong is probably the primary use case. I am not familiar with that version, but does it support 64 bit integers? My problem is maintaining compatibility across several versions of Lua. |
You can easily maintain compatibility across several versions of LUA. Lua is a dynamically typed language. There are no type definitions in the language; each value carries its own type. |
That is much easier said than done. I know for a fact that 64 bit integers are only supported in >= 5.3. Also, I believe the C API has inconsistencies across minor versions and LuaJIT. |
@ldeveloperl1985 @isaachier let's move Lua discussion to #898 |
I suggest to add Elixir to the list :) |
@jalberto I'm really hoping to move away from more client maintenance. We can probably use C to glue together an Elixir/Erlang client. |
@isaachier so maybe every client (backend) should be a wrapper to C client to have features parity. If some clientes are native, adn others are just wrappers, there is a risk to split features set. |
There is already significant feature split among the clients. And if I thought anyone would want to use C other than myself, I'd agree with you about using the same C library for all clients. However, some languages make this approach easier than others. For example, I have heard Java's JIT makes calling a native function significantly slower than calling the equivalent Java code. |
well, using a wrapper/binding to a different lang will always create an impact, in particular in this kind of libs that need to be called very often. In other hand to use a C-binding-wrapper may cause some headache dependencies-side or deployment-side even with docker (imagemagick in ruby or perl is a good example). Also docker images using alpine or any version of non-glibc can be tricky at least. IMHO as there is not perfect solution I suggest to avoid hybrid solutions (that will increase troubles surface), I suggest to go one side or the other:
To have some langs with native clients and other with a wrapper can icnrease th eamount of work instead of reducing it, also it may:
|
I'll agree that the C based clients are going to be second class, mostly because they aren't languages we ever use. The notable exception here is C# where an external contributor volunteered to maintain it. Among the Jaeger developers at Uber, I don't believe C# is our top priority. Regarding packaging, people complain about it, but whether you like it or not many libraries rely on C bindings because it just isn't worth reinventing the wheel every time. As long as some care is taken in the approach to wrapping it, I think it's a viable solution. Finally, I'm not sure what you mean by "support opentracing clients." Interestingly, @rnburn of OpenTracing C++ just created a Lua tracer that is implemented from an underlying C++ tracer and exposed through bindings. Just know, if there are tiers of clients, Go is clearly the focus and everything else is secondary. |
Another major benefit of using wrappers around a C-lib is that those wrappers only need to be implemented once in the OpenTracing community. |
by supporting OT clients I mean, to "ditch" jaeger client in favour of OT client and join the effort there |
@jalberto Jaeger is an implementation of the OT specification. There is no concrete OT client that I know of in open source other than Jaeger. OT is just an interface, not an implementation. |
My mistake, I thought the clients here: http://opentracing.io/ has a different code base. In that case: https://github.com/derailed/ex_ray |
Feel free to use another client. If you know of others interested in supporting this client please let us know. |
Looks like there is a client for Rust now: https://github.com/sile/rustracing_jaeger |
Hey everyone |
Per #3362, we're sunsetting Jaeger clients. |
This issue tracks various implementations of tracing clients in different languages, either already available or under development.
As a guideline, the following is a rough outline for getting a new client out:
Steps 1-4 are needed to get a minimal viable client. Steps 5-9 could be added later.
The text was updated successfully, but these errors were encountered: