ananthakumaran

ananthakumaran

Distributed tracing in elixir

With the proliferation of microservice architecture, distributed tracing has become more and more important in recent days. Because the landscape is quite new, there are multiple open standards like opentracing, opencensus and multiple opensource implementations like zipkin, jaeger, commerical implementations like datadog, newrelic, elasticsearch etc. There are also multiple client implementations available for elixir language like spandex, ex_ray and opencensus

The problem is, as a user, I am stuck with analysis paralysis. I have been postponing the adoption, because I am afraid of making the wrong bet. With the current setup, switching from one implementation to another would be a time consuming process (depends on how big the codebase is).

beam telemetry project aims to solve the same issue in the metrics landscape. If it gets implemented by the majority of the community, then switching from let’s say graphite to prometheus would be quite straight forward.

Is there any similar effort for distributed tracing?

Most Liked

tristan

tristan

Rebar3 Core Team

Note that OpenCensus is the only actual standard for what has to be defined to really have distributed tracing. OpenTracing leaves almost everything up to the implementation, which does not produce compatible libraries. OpenCensus provides complete specs and implementations for distributed tracing across multiple systems. This also involves some W3C standards, Trace Context and https://w3c.github.io/correlation-context/

OpenCensus and OpenTracing will ultimately be merged and the result live under CNCF. So choosing OpenCensus is a safe bet.

Also note that we who work on OpenCensus have been discussing with those who work on Spandex to combine efforts.

I hope the OpenCensus library can become the “telemetry library” of distributed tracing on beam :slight_smile: – we’ll also be integrating with telemetry for statistic reporting.

tristan

tristan

Rebar3 Core Team

The intent is to be mostly plug and play, but libraries are only instrumented when someone who needs it decides to do the work and release it.

So right now plug and tesla can have tracing enabled in a fairly simple way of adding middleware/plugs Opencensus.io integrations for Erlang, Elixir, and other BEAM languages · GitHub

Instrumenting hackney isn’t really possible without internal changes to hackney itself (it has no middleware support) and I’ve been talking to Benoit about it but we haven’t moved forward with any change yet.

GregMefford

GregMefford

I’ll echo what @tristan said, that we’re working on how the Spandex team can integrate and/or combine with the OpenCensus-BEAM project, because I think that’s the spec that makes the most long-term sense. I’d say that if you’re looking to add something to an app today, maybe try adding OpenCensus and file issues for any trouble you having (both documentation and technical issues), so we can figure out where the gaps are.

I still haven’t taken the time to figure out what that experience is like myself from an Elixir app, but if decide that you’d rather use Spandex, we have a fully-worked example that you can use to see what’s required to integrate Spandex with the commonly-used frameworks (Plug, Phoenix, Ecto, Datadog). Check out the links to the diffs in the README to see the exact changes you’d need to make in your app. Spandex only supports Datadog though, so that might be a deal-breaker for many environments. It wouldn’t be hard to add a new back-end, but no one has contributed one yet. We currently use Spandex at Bleacher Report, and it interoperates seamlessly with Datadog’s official clients for Ruby, NodeJS, .NET, etc.

Where Next?

Popular in Questions Top

New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44167 214
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement