| 11 | var tracer = otel.Tracer("pkg/traceql") |
| 12 | |
| 13 | func MakeCollectTagValueFunc(collect func(tempopb.TagValue) bool) func(v Static) bool { |
| 14 | return func(v Static) bool { |
| 15 | tv := tempopb.TagValue{} |
| 16 | |
| 17 | switch v.Type { |
| 18 | case TypeString: |
| 19 | tv.Type = "string" |
| 20 | tv.Value = v.EncodeToString(false) // avoid formatting |
| 21 | |
| 22 | case TypeBoolean: |
| 23 | tv.Type = "bool" |
| 24 | tv.Value = v.String() |
| 25 | |
| 26 | case TypeInt: |
| 27 | tv.Type = "int" |
| 28 | tv.Value = v.String() |
| 29 | |
| 30 | case TypeFloat: |
| 31 | tv.Type = "float" |
| 32 | tv.Value = v.String() |
| 33 | |
| 34 | case TypeDuration: |
| 35 | tv.Type = duration |
| 36 | tv.Value = v.String() |
| 37 | |
| 38 | case TypeStatus: |
| 39 | tv.Type = "keyword" |
| 40 | tv.Value = v.String() |
| 41 | } |
| 42 | |
| 43 | return collect(tv) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // bucketSet is a simple set of buckets that can be used to track the number of exemplars |
| 48 | type bucketSet interface { |