Graborg

Graborg

How to solve OpenTelemetry and timeouts?

Hi!

I’ve been digging into OpenTelemetry in the context of Phoenix lately. One problem I’ve found is that if a client closes the connection early (e.g because they call us with a timeout lower than we can deliver a response) we never call .end on the child span where we’re at in the code at that moment (since the process handling the request is terminated). We thus only get the root span but not the child span.

More concretely, this happens, for example, in the opentelemetry_finch library. Thus if we make a http call as part of a request, and that http call ends up taking longer than the client that calls us can handle, opentelemetry_finch never reports us their span.

I’m not sure if this is the intended way since OpenTelemetry is still in an early phase, but it seems suboptimal because the most important traces for us is the ones taking so long that they time out.

The question is where this problem should be fixed. Should the creation of spans happen in their own proccesses so that they get to call end on the span?

Or is there another way to solve this? I usually don’t work on this level of abstraction but curious to learn more.

Thanks

First Post!

dimitarvp

dimitarvp

I’m very interested in the same but have not much time lately. If you make a small repo reproducing the problem I’d be willing to work with you to find a proper solution.

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
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

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36432 110
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 48475 226
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement