-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
tracing: make span
a union type
#54737
Commits on Oct 23, 2020
-
tracing: make
span
a union typeClarify that a `span` is anywhere between zero to three subspans: - net/trace, - external opentracing Tracer, and - crdb-internal trace span, where zero subspans corresponds to what is today noopSpan (not implemented yet, but TODO added). Lots of threads to pull, but this is a good checkpoint since everything compiles and the diff is mechanical and small enough to actually review. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 8598646 - Browse repository at this point
Copy the full SHA 8598646View commit details -
Remove the noopSpan and noopSpanContext types. Instead, we use a `*span` (and `*spanContext`) with a zero trace ID (and in fact, all zero except for the tracer). This allows a sleuth of further cleanups which are deferred to follow-up commits. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 3e7d258 - Browse repository at this point
Copy the full SHA 3e7d258View commit details -
tracing: move tracer from crdbSpan to span
That's where it belongs. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 75dc94a - Browse repository at this point
Copy the full SHA 75dc94aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9ae26d - Browse repository at this point
Copy the full SHA b9ae26dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e676d03 - Browse repository at this point
Copy the full SHA e676d03View commit details -
Lots of top-level logic reaches into the `crdbSpan`, which is not ideal. We want top-level tracing methods to delegate to a method on each of the subspans of our main `span` type. This commit doesn't do anything about that, but it gets us one step closer by mechanically unembedding the crdbSpan field. The diff highlights a lot of code that needs to be moved into methods that sit on `*crdbSpan`. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 9c02d12 - Browse repository at this point
Copy the full SHA 9c02d12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f47e41 - Browse repository at this point
Copy the full SHA 5f47e41View commit details -
tracing: move parts of recording, baggage, tag functionality to crdbSpan
This starts towards a picture in which operations on a `*span` essentially turn into an opaque invocation of something on a `crdbSpan` plus possibly additional logic for the net/trace and external span. The hope is that by pulling further on this thread `crdbSpan` can move into its own package and thus have a clean interaction with the tracer and top-level methods. Release note: None
Configuration menu - View commit details
-
Copy full SHA for b251640 - Browse repository at this point
Copy the full SHA b251640View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf0a026 - Browse repository at this point
Copy the full SHA cf0a026View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f4c513 - Browse repository at this point
Copy the full SHA 4f4c513View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e5b594 - Browse repository at this point
Copy the full SHA 4e5b594View commit details -
tracing: improve comments on recording modes
I had to understand the semantics by reading the code, and now that I think I understand them, want to save the next person from having to do the same. Release note: None
Configuration menu - View commit details
-
Copy full SHA for d5c6cf7 - Browse repository at this point
Copy the full SHA d5c6cf7View commit details -
tracing: create *span in only one method
We were previously maintaining very similar code in three places: 1. `(*Tracer).StartSpan` 2. `StartRootSpan` 3. `StartChildSpan` This commit creates a method `(*Tracer).startSpanGeneric` and makes the above a thin wrapper around it. This allows us to simplify just one version of the code. Merging the three also showed minor differences: tags didn't seem to propagate the same in all cases, and a bug (that I just introduced) about what constitutes a `noopSpanContext` was highlighted and fixed. I still have plenty of questions about this code and far from good confidence that I didn't introduce any bugs. I did pay some attention to performance regressions, but no benchmarks are introduced at this point. My interest is to simplify the package first, then make it cheap (again). We can live with a temporary performance regression, as long as it is limited to the case in which tracing is actually enabled. Release note: None
Configuration menu - View commit details
-
Copy full SHA for d433733 - Browse repository at this point
Copy the full SHA d433733View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1646dd - Browse repository at this point
Copy the full SHA d1646ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for f55f719 - Browse repository at this point
Copy the full SHA f55f719View commit details -
tracing: propagate shadow tracers to children only when identical
Release note: None
Configuration menu - View commit details
-
Copy full SHA for cf48395 - Browse repository at this point
Copy the full SHA cf48395View commit details -
Configuration menu - View commit details
-
Copy full SHA for 374e745 - Browse repository at this point
Copy the full SHA 374e745View commit details -
tracing: properly export Span and SpanContext
They will be used instead of `opentracing.Span{,Context}` in future commits. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 1921231 - Browse repository at this point
Copy the full SHA 1921231View commit details -
tracing: don't ignore recordability in StartChildSpan
Improve commentary about recordability while I'm there. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 9f5a99e - Browse repository at this point
Copy the full SHA 9f5a99eView commit details -
tracing: respect sso.Tags in StartSpan
This got lost during the refactors and caused some test failures. Release note: None
Configuration menu - View commit details
-
Copy full SHA for 2ace2ab - Browse repository at this point
Copy the full SHA 2ace2abView commit details