Skip to content

Commit

Permalink
Add the patch to hack/update-deps.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
Harwayne committed Sep 27, 2019
1 parent e21bc0a commit 706da38
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hack/set-span-id.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/vendor/go.opencensus.io/trace/trace.go b/vendor/go.opencensus.io/trace/trace.go
index 38ead7bf..9e6fe483 100644
--- a/vendor/go.opencensus.io/trace/trace.go
+++ b/vendor/go.opencensus.io/trace/trace.go
@@ -261,6 +261,11 @@ func startSpanInternal(name string, hasParent bool, parent SpanContext, remotePa
return span
}

+func (s *Span) SetSpanID(spanID SpanID) {
+ s.data.SpanID = spanID
+ s.spanContext.SpanID = spanID
+}
+
// End ends the span.
func (s *Span) End() {
if s == nil {
6 changes: 6 additions & 0 deletions hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ rm -rf $(find vendor/ -name 'BUILD.bazel')
update_licenses third_party/VENDOR-LICENSE \
$(find . -name "*.go" | grep -v vendor | xargs grep "package main" | cut -d: -f1 | xargs -n1 dirname | uniq)

# HACK HACK HACK
# The only way we found to create a consistent Trace tree without any missing Spans is to
# artificially set the SpanId. See pkg/tracing/traceparent.go for more details.
# Produced with:
# git diff origin/master HEAD -- vendor/go.opencensus.io/trace/trace.go > ./hack/set-span-id.patch
git apply ${REPO_ROOT_DIR}/hack/k8s-dynamic-fake-simple.patch

0 comments on commit 706da38

Please sign in to comment.