MCPcopy
hub / github.com/grafana/tempo / scopeSpanHash

Function scopeSpanHash

tempodb/encoding/vparquet4/rebatch_trace.go:98–113  ·  view source on GitHub ↗
(ss *ScopeSpans)

Source from the content-addressed store, hash-verified

96}
97
98func scopeSpanHash(ss *ScopeSpans) uint64 {
99 hash := fnv1a.HashString64(ss.Scope.Name)
100
101 hash = fnv1a.AddString64(hash, ss.Scope.Version)
102
103 // sort keys for consistency
104 slices.SortFunc(ss.Scope.Attrs, func(i, j Attribute) int {
105 return strings.Compare(i.Key, j.Key)
106 })
107
108 for _, attr := range ss.Scope.Attrs {
109 hash = attributeHash(&attr, hash)
110 }
111
112 return hash
113}
114
115func resourceSpanHash(rs *ResourceSpans) uint64 {
116 hash := fnv1a.HashString64(rs.Resource.ServiceName)

Callers 1

rebatchTraceFunction · 0.70

Calls 2

attributeHashFunction · 0.70
CompareMethod · 0.45

Tested by

no test coverage detected