hauleth
As tracing and metrics gathering seems to still be problem for some of the newcomers I have started few projects to improve that by utilising OpenCensus. During my last 2 days of work I have added few 3 new libraries to the OpenCensus BEAM organisation:
- DataDog - support for DogStatsD metrics and for DataDog’s APM traces.
plugintegration (not yet released on Hex) - tracing and measurements. For now there is support for pipeline as a whole, maybe in future I will add “per plug” support.telemetryintegration (not yet released on Hex) - measurements.
Future libraries:
- Phoenix integration - maybe, maybe not. I am not sure how much it will be needed when Phoenix integrate
telemetry. Maybe tracing, but that would be covered byopencensus_pluglibrary - Ecto integration - while measurements are covered by
opencensus_telemetry, support for traces would still be desirable, however no idea how to support it right now - Wrapper library for
erlang:trace/3- this would be really interesting project, that would allow us to trace enormous amount of data. However there are few problems I see right now, and finding solution for them can be a little bit costly, so for now it is left deep in the backlog.
Let me know what other libraries and integrations you would like to see.
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
The obligatory hello world thread!
Who are you and where are you from? :stuck_out_tongue:
New
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project.
My initial shotgu...
New
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
While I am working on the Language Agnostic Code Audit SaaS, which uses MetaAST (spoiler: I am expecting it to be in a good shape for ann...
New
Chat & Discussions>Discussions
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 10 of 17 Posts
ferd
Using
tracedata is likely a bad idea. There can only be one tracer at any point in time (no concurrency), so if you integrate it to the metrics, nobody can use it to debug at the same time.hauleth
Yeah, I have checked that and it is a shame. So I would need to find another way to handle that, unfortunately I cannot take a look into WombatOAM
By the way, new exporter (not yet published) is available:
GregMefford
I’m happy to see that OpenCensus is gaining more traction in the BEAM ecosystem! I think it was about 6-9 months ago that I last checked and it didn’t seem like there was enough there yet to go all in, but now it seems that there are a number of people working on it.
I am maintaining the Spandex project along with @zachdaniel, with the goal of being an OpenTracing-compatible API that supports multiple vendor back-ends, very similar to the goals of OpenCensus. Currently, we only support DataDog APM as a back-end, but I think it should be relatively simple to support others if someone wanted to (and I’d love to know where they got stuck if it didn’t work out). We’re also looking forward to using Telemetry to collect span data in the future as more libraries support it. In the meantime, you may be interested to look at how Spandex integrates with Plug/Phoenix and Ecto. We have an example project that demonstrates how to integrate Spandex into an existing app, if you’re curious (see the links in the
READMEfor a code diff).Also, as you probably know, several vendors have their own first-party support for tracing that is proprietary to only their back-ends, but mostly open-source (e.g. AppSignal, New Relic, Scout).
I’d be interested to look more into how the OpenCensus BEAM core compares to Spandex, and see whether there’s anything that can be shared somehow so everybody wins.
zachdaniel
I agree :). I spent a really long time on Spandex, but I don’t want to be working against a more standardized implementation of tracing in Elixir. I’d hope that either spandex could be a standard interface for tracing an Elixir application, or the good parts of it could be salvaged/copied into a new standard. My point being that we should only hold tight into spandex if it’s going to be good for the community. If the community needs a more standard implementation, I’d be happy to support it.
hauleth
I see no problems with making Spandex thin wrapper over OpenCensus library as API and concepts are quite similar. To be honest I even thought about creating OpenCensus wrapper for Elixir, that would end like something like Spandex, but in the end I didn’t see much value in that (at least yet, because I have proposed moving some utilities to macros). I also believe that we should reduce fragmentation in the matter of tracing and metrics gathering, but not only in Elixir, but in BEAM as a platform. It would be best if we would have single toolset to export metrics form both Erlang and Elixir.
Main reasons why I have joined OpenCensus project rather than Spandex are:
My only main problem with OpenCensus library right now is that it completely lacks documentation, which I will try to tackle soon. A lot of data is outdated, and it would be really wort to improve that, as it could help building community around such standard.
About integrating with Plug/Phoenix and Ecto I would need to create example projects in
opencensus/plugandopencensus/telemetry. Only place where I still need to find how to hook into Ecto is tracing, but I have seen that you are using:tracelevel of Ecto logger for that, it can be worth checking this out that for adding new integration.tristan
Another useful project would be some benchmarks to both check overhead and eventually compare different ways of setting traces and collecting metrics. For example, I have a work in progress for using a message to a pool of workers for collecting metrics instead of doing them inline. In many cases just doing them inline is likely preferred – when not updating lots of views per measure – but useful to have numbers.
GregMefford
I should also mention that there are other OpenTracing-related projects in the BEAM ecosystem that seem relatively robust as options: otter for Erlang project and ExRay, which is an Elixir wrapper around it.
I agree that the ideal situation would be a robust core that allows the difficult/complicated parts to be shared by all BEAM languages, and perhaps wrapper interfaces native to each language so that it feels more idiomatic (for example, with respect to the macros). I think Spandex could be adapted somewhat-easily to that because it doesn’t rely in any magic or macros at its core - only for convenience so that we can offer function decorators and automatically generate some code for you so that you don’t have to explicitly pass in all of the default options to each API call.
hauleth
I was fully aware of other solutions available out there. The points that (at least for me) were the most important are:
So everything I needed was in just one package, what I really appreciate. So, with all respect to you guys, I place my bet on OpenCensus.
tristan
Yea, I would love if we could all share an Erlang core. But now that there are so many implementations I doubt that is ever going to happen. And I’m partly to blame :). I started opencensus-erlang after trying otter when it was released.
I find opencensus to be important as a core because it defines so much (like propagation encoding and even a stacktrace proto format so services will actually be able to understand Erlang stacktraces! – small potatoes to Elixir world since services are starting to pick up on supporting Elixir).
It is also very open development of the specs and accepted Erlang as part of this process from early on.
hauleth
opencensus_plughas landed on Hex