contrib/google.golang.org/grpc: Fallback to dynamic service names if no global is found#2048
Merged
Merged
Conversation
…no global is found
BenchmarksBenchmark execution time: 2023-06-15 19:41:35 Comparing candidate commit 28a7922 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics. |
pkalmakis
reviewed
Jun 14, 2023
pkalmakis
reviewed
Jun 14, 2023
Co-authored-by: Peter Kalmakis <[email protected]>
ajgajg1134
marked this pull request as ready for review
June 15, 2023 16:21
katiehockman
left a comment
Contributor
There was a problem hiding this comment.
Can you clarify what makes gRPC special in this case? (i.e. can you explain in the PR description why gRPC is the only library that needs to have this special fallback)
Co-authored-by: Katie Hockman <[email protected]>
Co-authored-by: Katie Hockman <[email protected]>
katiehockman
approved these changes
Jun 15, 2023
ajgajg1134
added a commit
that referenced
this pull request
Jun 15, 2023
…no global is found (#2048) Co-authored-by: Peter Kalmakis <[email protected]> Co-authored-by: Katie Hockman <[email protected]>
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
To protect users who may be accidentally creating their GRPC server before calling
tracer.Start()this PR falls back to dynamically fetching the service name for every span (as before), but if a service name is found it is cached (for a slight performance benefit).GRPC is the only contrib here that is important as it previously did NOT cache the service name, unlike many of the other contribs where the caching was already occurring (meaning that those contribs would have had this same issue in the past, but because the behavior is changing here for grpc it can cause breakages for customers who did not know they needed to start the tracer first)
Motivation
We found several applications that are creating their GRPC server before calling
tracer.Start(). These applications would suddenly have a new service name due to the new caching of service name as part of thenamingschemachanges. While it is highly recommended to calltracer.Start()before initializing any traced libraries, to try and avoid impacting users of the library we should try to detect this situation and fallback to the old behavior while logging a warning so that users know they should update their code.Closes #2050
Describe how to test/QA your changes
Unit tested
Reviewer's Checklist