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

Method KeepGroup

tempodb/encoding/vparquet4/block_traceql.go:3745–3802  ·  view source on GitHub ↗
(res *parquetquery.IteratorResult)

Source from the content-addressed store, hash-verified

3743}
3744
3745func (c *linkCollector) KeepGroup(res *parquetquery.IteratorResult) bool {
3746 var l *link
3747
3748 // look for existing link first
3749 for _, e := range res.OtherEntries {
3750 if v, ok := e.Value.(*link); ok {
3751 l = v
3752 break
3753 }
3754 }
3755
3756 // if not found create a new one
3757 if l == nil {
3758 l = getLink()
3759 }
3760
3761 // extract from attribute collector
3762 for _, e := range res.OtherEntries {
3763 if v, ok := e.Value.(traceql.Static); ok {
3764 l.attrs = append(l.attrs, attrVal{
3765 a: newLinkAttr(e.Key),
3766 s: v,
3767 })
3768 }
3769 }
3770
3771 for _, e := range res.Entries {
3772 switch e.Key {
3773 case columnPathLinkTraceID:
3774 l.attrs = append(l.attrs, attrVal{
3775 a: traceql.NewIntrinsic(traceql.IntrinsicLinkTraceID),
3776 s: traceql.NewStaticString(util.TraceIDToHexString(e.Value.Bytes())),
3777 })
3778 case columnPathLinkSpanID:
3779 l.attrs = append(l.attrs, attrVal{
3780 a: traceql.NewIntrinsic(traceql.IntrinsicLinkSpanID),
3781 s: traceql.NewStaticString(util.SpanIDToHexString(e.Value.Bytes())),
3782 })
3783 default:
3784 // This is a null value, indicating the attribute doesn't exist
3785 if e.Value.IsNull() {
3786 l.attrs = append(l.attrs, attrVal{newLinkAttr(e.Key), traceql.NewStaticString("nil")})
3787 }
3788 }
3789 }
3790
3791 if c.minAttributes > 0 {
3792 if len(l.attrs) < c.minAttributes {
3793 putLink(l)
3794 return false
3795 }
3796 }
3797
3798 res.Reset()
3799 res.AppendOtherValue(otherEntryLinkKey, l)
3800
3801 return true
3802}

Callers

nothing calls this directly

Calls 10

NewIntrinsicFunction · 0.92
NewStaticStringFunction · 0.92
TraceIDToHexStringFunction · 0.92
SpanIDToHexStringFunction · 0.92
BytesMethod · 0.80
AppendOtherValueMethod · 0.80
getLinkFunction · 0.70
newLinkAttrFunction · 0.70
putLinkFunction · 0.70
ResetMethod · 0.65

Tested by

no test coverage detected