hst337

hst337

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!

Showing Posts 1 to 10

michallepicki

michallepicki

Tricky subject, but I wouldn’t say that the telemetry library itself has any notion of spans? It’s main purpose is dynamic dispatch, and maybe some specific library emits events that are aware of spans :thinking:

Are you looking for some way to reduce code boilerplate that can be found in libraries like these ones from opentelemetry-erlang-contrib?

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

If you look at libraries like OpenTelemetryOban you can see that the common pattern is to create :telemetry hooks 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

hst337 OP

I thought so too, but it turns out that telemetry.span generates unique span context in metadata for every span, so it is possible to convert a telemetry span to opentelemetry span.

hst337

hst337 OP

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.span already 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

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

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

hst337 OP

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 scratch

tristan

tristan

Rebar3 Core Team

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_api which itself has 0 dependencies :slight_smile:

bside

bside

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

hst337 OP

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

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

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

JesseHerrick
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews