Skip to content

Commit 7b3b275

Browse files
committed
Additional comments on ID methods
1 parent 4c3e012 commit 7b3b275

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

controllers/events/object.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func (r *EventWatcher) createTraceFromTopLevelObject(ctx context.Context, obj ru
9595
return spanData, nil
9696
}
9797

98+
// create a spanID that will be consistent for a particular object
9899
func objectToSpanID(m v1.Object) trace.SpanID {
99100
f := fnv.New64a()
100101
_, _ = f.Write([]byte(m.GetUID()))
@@ -104,6 +105,7 @@ func objectToSpanID(m v1.Object) trace.SpanID {
104105
return h
105106
}
106107

108+
// we include the generation, so changes to the spec will start a new trace.
107109
func objectToTraceID(m v1.Object) trace.TraceID {
108110
f := fnv.New128a()
109111
_, _ = f.Write([]byte(m.GetUID()))

0 commit comments

Comments
 (0)