Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
70993: util/tracing: optimize span tags and expand their collection r=andreimatei a=andreimatei This patch makes the collection of span tags generally allocation-free by storing the tags into memory pre-allocated in the span. In tandem with a previous commit which moved away from a generic (interface{}) interface for Span.SetTag(), this makes span collection very cheap. As such, this patch also re-enables the collection of tags for non-verbose (but also not no-op) spans. The collecting of tags on non-verbose spans was stopped in eba03c4 because of these allocations, as well as the allocations performed by the variadic WithTags option for StartSpan(). I'm not re-introducing WithTags. The motivation for this change is that I want to make broader use of the open spans registry, and I want (non-verbose) spans in the registry to have their tags available for inspection. I'm also planning of introducing new tags for static info defining a span (e.g. the SQL query for spans representing query execution). Note that tags in non-verbose spans continue to not be included in Recordings (and hence not serialized-deserialized over the network). This was the case, and the patch does not change it. I've run BenchmarkTracing and it shows no change. Release note: None Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
- Loading branch information
Showing
3 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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