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

Use span without a parent for connection #688

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mladedav
Copy link

@mladedav mladedav commented Jun 8, 2023

We have found out in our project that sometimes when calling a gRPC service, a connection is created during that call and that connection is pooled for later use. However, when the connection was made a span was created which used the current span as a parent.

This leads to our traces that should be a few milliseconds long to include the whole lifetime of the connection which times out after 90 seconds or 3 minutes.

This change makes it so that the span is a root span.

I have asked in the tracing-users Discord about this and got this reply so I hope this is ok.

I've also thought about adding an optional span to be used as a parent into the Config struct but it does not seem useful enough to warrant a breaking change there, but if anyone thinks that it should be there, I will do that. I have just checked that it's used from within Handshake which creates its own trace_span so the propagation could touch a few more things.

@seanmonstar seanmonstar requested a review from hawkw June 8, 2023 21:28
@seanmonstar
Copy link
Member

@hawkw can you take a look and provide guidance?

@mladedav
Copy link
Author

@hawkw Any thoughts on this?

@hawkw
Copy link
Collaborator

hawkw commented Jun 24, 2023

Sorry, I was traveling for the last couple weeks. I'll take a look!

@mladedav
Copy link
Author

mladedav commented Feb 3, 2024

Hi, any thoughts on this?

@seanmonstar
Copy link
Member

Looking at this again, I'm thinking that just as someone might want there to be no parent, other people could very well want it to have one. Probably, most people would expect it to have the default in tracing.

So, then I suppose that a way to make it without a parent would be a level up: whatever thing creates or spawns the task could down with the parent set to none. That would then be up to the user. What do you think?

@mladedav
Copy link
Author

mladedav commented Feb 4, 2024

Yes, I think you're right. This should be where h2 streams are created or even higher up. I'll try to look into this once more and find a better place and close this.

Thank you for the time.

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

Successfully merging this pull request may close these issues.

None yet

3 participants