-
Notifications
You must be signed in to change notification settings - Fork 34
Print the span info on span exit and entry #16
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rules! Thanks for opening this PR.
How do you feel introducing a similar implementation that you have in on_exit
to on_close
but also emitting the duration of the span? Since spans can be entered and existed multiple times having something to delineate that a span has just closed/exited for the last time can be really handy.
Do you mean just the current duration from the start, or the duration the span was open? In the latter case we have to store the opening somewhere, any tips? |
I'm sorry my message wasn't more clear, let me try to rephrase. I think that there are a few distinct requests that I didn't properly separate.
Sure! Here's the approach I was thinking of:
Again, the above approach can be done in a followup, but I'd like to hash out an approach first in an issue. I really love this PR as is and I'd be happy to merge it as-is, as I don't want to let perfect be the enemy of good 😄. |
We have a few subtle ways to signal that something is different. One would be to use some of the bold or double box drawing chars from https://en.wikipedia.org/wiki/Box-drawing_character This could look like
(without the space between the lines, that's just github) Also we can use bold lines instead of double lines. I'll open an issue for the timings |
That's a reasonable approach. For what it's worth, I think this PR is fine as-is. We can add some specific formatting for a span closing, if there's a need for it. I think that printing:
will allow us to distinguish between an exited span and a closed span, respectively. |
ok :D then let's merge it for now and figure out the details about other improvements in the issue. |
I may have went a bit overboard with this one. I wanted to somehow render the fact that we're just re-emitting the current span info