How we trace a KV database with less than 5% performance impact
en.pingcap.com
en.pingcap.com
For rust you can use eBPF to get these traces down to system calls. You can even profiler other people's software with it.
[0] I'm a co-founder at Pyroscope, where we're building an open source continuous profiling platform. https://pyroscope.io/
Aside from the sampling issue there is also the problem of non-blocking frameworks/languages. It’s easy to add tracing to JS functions that use async/await but it is definitely a mini research project to recover stacks from in-flight promise state machines. Most languages fall into this bucket unfortunately.
Now all that said, if you can make some automation that preemptively creates spans for you - kind of like a sampling profiler “creates” stack traces - that would be super cool. The worst part about tracing is sprinkling the tracing code in all the places you need it. You inevitably miss a few spots that show up as “missing” bars in the gannt view. Having something that fills in those blanks is invaluable.
On the JVM this is usually done by agents that automatically attach to your process, you don't have to instrument your code at all. I think Datadog open-sourced their implementation?
That said, I’m really hoping Project Loom will fix that issue by getting rid of most async callback-style I/O.
While this is kind of off topic (the tech is related), i really enjoy the idea behind their product - a database that is compatible with existing protocols (MySQL 5.7 connections in this case) but allows for horizontal scaling out of the box.
While a single instance of MySQL/MariaDB/PostgreSQL can go pretty far, being able to mostly delegate scaling to the actual software to get a distributed system going, without having to do lots of manual work is a great idea! Of course, there are also many pitfalls in regards to compatibility, but that's probably to be expected: https://docs.pingcap.com/tidb/stable/mysql-compatibility
That said, this won't work for all circumstances, but i think that exploring such approaches is definitely worthy of the time!
[1] https://www.circonus.com/2016/09/time-but-faster/
[2] https://www.youtube.com/watch?v=xqocAHGoBAg (from around 19:20)
I'm not a tracing contributor myself, just a consumer, for what it's worth.
Grabbing traces like this is great. The next step is efficient visualization of trace data.
Ooh, I'd be really interested to see what could be done in that vein! Do you have any ideas about how we could lay out trace information?
RAD Game Tools Telemetry - http://www.radgametools.com/telemetry.htm Superluminal - https://superluminal.eu/features/ Remotery - https://github.com/Celtoys/Remotery
Visual Studio's built-in profiler is an ok sampling profiler. It doesn't give you a nice multi-thread view which is a huge advantage to a span based profiler.
MTuner is quite nice for debugging memory usage. Which is another gaping hole in the Rust ecosystem. https://github.com/milostosic/mtuner
Lots of tools generate data in a format viewable by the Chrome trace viewer. I think Chrome's tracer viewer is not great. Maybe someday someone will create a viewer for the format that's good. I get cranky when large traces don't render at 60fps. Web-based viewers are almost all very very slow and it makes me sad.