hst337
How to convert telemetry to opentelemetry
I have a lot of libraries which emit telemetry events, and I’d like to covert them into OpenTelemetry spans. I’ve found the opentelemetry_telemetry library, but examples there do not work and it looks heavily outdated, without proper documentation, plus :telemetry doesn’t allow attaching to event by prefix, so I have to write some strange and hacky code to translate spans from one library to another.
It would be nice if anyone could share their experience here, thanks!
Trending in Questions
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated!
To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead.
Sta...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
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
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
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
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
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
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance











First 10 of 16 Posts
michallepicki
Tricky subject, but I wouldn’t say that the
telemetrylibrary itself has any notion ofspans? It’s main purpose is dynamic dispatch, and maybe some specific library emits events that are aware ofspansAre you looking for some way to reduce code boilerplate that can be found in libraries like these ones from opentelemetry-erlang-contrib?
benwilson512
If you look at libraries like
OpenTelemetryObanyou can see that the common pattern is to create:telemetryhooks that then initiate open telemetry spans. This allows you to stick with the more general purpose telemetry library while also enabling people who use open telemetry to get otel spans out.hst337
I thought so too, but it turns out that
telemetry.spangenerates unique span context in metadata for every span, so it is possible to convert a telemetry span to opentelemetry span.hst337
Yeah, I’ve seen it, and just took a look again, but it feels really annoying to write the same boilerplate for something which
telemetry.spanalready does out of the box. I want a solution where every span from telemetry is automatically exported in an opentelemetry format. And I don’t see any limitations for this solution, do you?benwilson512
The limitation is that if someone wants to get spans from your library and export them to say app signal they have to convert otel spans to app signal spans which is a lot heavier weight than regular telemetry spans to app signal spans.
End users of your library that aren’t doing otel will end up pulling in a bunch of dependencies as well.
hst337
You got me wrong. I am not suggesting writing telemetry in otel always. I am suggesting to have a relay which automatically converts all telemetry spans to otel spans, and as far as I can see, there are no limitations for this, but still, every
opentelemetry_*library writes this boilerplate from scratchtristan
The first point about AppSignal is a good one But there are not a “bunch of dependencies” that will be pulled in . A library should only depend on
opentelemetry_apiwhich itself has 0 dependenciesbside
I’m not sure what trouble you’re having here. The bridge library is up to date and used by probably half of our instrumentation libraries. Perhaps you could elaborate here or pop into opentelemetry on the Elixir Slack for help.
hst337
I want to automatically convert telemetry span events to opentelemetry spans. I know that the generic solution is possible, but I can’t implement it yet with the knowledge I have right now
bside
It is possible but it has additional requirements. There is no way to try to create spans from every possible event in the system without a mechanism to register the events.
Please note, this undocumented experimental functionality is being removed from this library so do not rely on it.
https://github.com/open-telemetry/opentelemetry-erlang-contrib/blob/main/utilities/opentelemetry_telemetry/src/otel_telemetry.erl#L28-L36