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

Method Collect

tempodb/encoding/vparquet5/block_traceql_fetch.go:1273–1455  ·  view source on GitHub ↗
(res *parquetquery.IteratorResult, param any)

Source from the content-addressed store, hash-verified

1271}
1272
1273func (c *spanCollector2) Collect(res *parquetquery.IteratorResult, param any) {
1274 sp := &c.at
1275
1276 if len(res.OtherEntries) > 0 {
1277 e := res.OtherEntries[0]
1278 switch v := e.Value.(type) {
1279 case *span:
1280 // Copy data from first pass span to this one.
1281 sp.rowNum = v.rowNum
1282 sp.id = v.id
1283 sp.startTimeUnixNanos = v.startTimeUnixNanos
1284 sp.durationNanos = v.durationNanos
1285 sp.spanAttrs = append(sp.spanAttrs, v.spanAttrs...)
1286 sp.traceAttrs = append(sp.traceAttrs, v.traceAttrs...)
1287 sp.resourceAttrs = append(sp.resourceAttrs, v.resourceAttrs...)
1288 sp.eventAttrs = append(sp.eventAttrs, v.eventAttrs...)
1289 sp.linkAttrs = append(sp.linkAttrs, v.linkAttrs...)
1290 sp.nestedSetParent = v.nestedSetParent
1291 sp.nestedSetLeft = v.nestedSetLeft
1292 sp.nestedSetRight = v.nestedSetRight
1293 case traceql.Static:
1294 switch {
1295 case res.RowNumber[DefinitionLevelResourceSpansILSSpanAttrs] >= 0:
1296 sp.addSpanAttr(newSpanAttr(e.Key), v)
1297 case res.RowNumber[DefinitionLevelResourceSpans] >= 0:
1298 sp.resourceAttrs = append(sp.resourceAttrs, attrVal{traceql.NewScopedAttribute(traceql.AttributeScopeResource, false, e.Key), v})
1299 }
1300 case *event:
1301 sp.setEventAttrs(v.attrs)
1302 putEvent(v)
1303 case *link:
1304 sp.setLinkAttrs(v.attrs)
1305 putLink(v)
1306 case *attrVal:
1307 switch v.a.Scope {
1308 case traceql.AttributeScopeTrace:
1309 sp.traceAttrs = append(sp.traceAttrs, *v)
1310 case traceql.AttributeScopeResource:
1311 sp.resourceAttrs = append(sp.resourceAttrs, *v)
1312 case traceql.AttributeScopeSpan:
1313 sp.spanAttrs = append(sp.spanAttrs, *v)
1314 case traceql.AttributeScopeEvent:
1315 sp.eventAttrs = append(sp.eventAttrs, *v)
1316 case traceql.AttributeScopeLink:
1317 sp.linkAttrs = append(sp.linkAttrs, *v)
1318 case traceql.AttributeScopeInstrumentation:
1319 sp.instrumentationAttrs = append(sp.instrumentationAttrs, *v)
1320 default:
1321 panic("unhandled scopedAttribute: " + v.a.Scope.String())
1322 }
1323 default:
1324 panic("unhandled other entry value type: " + "key:" + e.Key)
1325 }
1326 }
1327
1328 var durationNanos uint64
1329
1330 // Merge all individual columns into the span

Callers

nothing calls this directly

Calls 15

NewScopedAttributeFunction · 0.92
NewStaticStringFunction · 0.92
TraceIDToHexStringFunction · 0.92
NewStaticDurationFunction · 0.92
SpanIDToHexStringFunction · 0.92
NewStaticIntFunction · 0.92
NewStaticStatusFunction · 0.92
NewStaticKindFunction · 0.92
NewStaticBoolFunction · 0.92
NewStaticFloatFunction · 0.92
BytesMethod · 0.80
DurationMethod · 0.80

Tested by

no test coverage detected