Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Make it so we can show spans that encapsulating handled exception as INFO level #142

Open
dmontagu opened this issue May 6, 2024 · 4 comments

Comments

@dmontagu
Copy link
Contributor

dmontagu commented May 6, 2024

Description

image In this case, the outermost task did a retry of a failure, and the retry succeeded.

I think what we can do to better handle things today is, rather than showing the worst descendant level of a span in all circumstances, we do the following:

  • If a span has a level explicitly set, we use that as the level to display in the UI
  • If the span has level null, we look at its children (recursively over other spans with level null) for the worst level, and show that

We probably also want to make sure there is an API for late-setting the level on a span so that, e.g. in the example above, we could leave the level unset until the request finally succeeds, then set the level to INFO right at the end when we know the inner call did succeed, as a way to get the bar to show up the desired color.

@alexmojaki if you agree with this, I am happy to handle the frontend side if you can help with the SDK. If you disagree with this approach, happy to discuss (I'm not 100% confident it doesn't have issues, but it made sense to me).

(Reported by @willbakst)

@dmontagu dmontagu changed the title Have ability to show spans encapsulating exceptions as INFO level Feature request: Make it so we can show spans that encapsulating handled exception as INFO level May 6, 2024
@alexmojaki
Copy link
Contributor

Spans no longer have null levels. The backend defaults them to info.

We probably also want to make sure there is an API for late-setting the level on a span

There's a LogfireSpan.set_level method already.

Personally I think the UI should have room to show both the current span level and some information about its descendant levels, e.g. an error bubble inside an info bubble or a small error bubble on the side.

@willbakst
Copy link
Contributor

I think showing descendant information would be great! In the image contained in the original request, it would be awesome if the highest level one was info but still showed information that there were internally handled errors (like a bubble or something as you've mentioned).

In the meantime, I'll check out the set_level method! Thanks!

@alexmojaki
Copy link
Contributor

In the meantime, I'll check out the set_level method! Thanks!

Since spans already default to info, it sounds like you shouldn't have a need for it.

@willbakst
Copy link
Contributor

So the issue is that if I don't manually set anything and an error happens internally to the parent span, the parent span shows up as an error even though the error was actually handled internally (i.e. the call was retried and succeeded).

I tried using set_level to force the parent to be 'info', but (1) I couldn't get this working, and (2) I don't think this is actually the right approach since I do want the parent to be 'error' if none of the inner calls succeed after hitting max retries.

Any idea what approach would be best here to get the desired behavior? I'm wondering if maybe there's a better solution on the UI side as you mentioned to somehow check if the error was handled before the span finished and then display that there was a handled error within the span?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants