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

Function MakeCollectTagValueFunc

pkg/traceql/util.go:13–45  ·  view source on GitHub ↗
(collect func(tempopb.TagValue) bool)

Source from the content-addressed store, hash-verified

11var tracer = otel.Tracer("pkg/traceql")
12
13func 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
48type bucketSet interface {

Callers 15

SearchTagValuesV2Method · 0.92
tagValuesRunnerFunction · 0.92
TestFetchTagValuesFunction · 0.92
BenchmarkFetchTagValuesFunction · 0.92
TestFetchTagValuesFunction · 0.92
BenchmarkFetchTagValuesFunction · 0.92
TestFetchTagValuesFunction · 0.92
BenchmarkFetchTagValuesFunction · 0.92

Calls 2

EncodeToStringMethod · 0.80
StringMethod · 0.45

Tested by 12

tagValuesRunnerFunction · 0.74
TestFetchTagValuesFunction · 0.74
BenchmarkFetchTagValuesFunction · 0.74
TestFetchTagValuesFunction · 0.74
BenchmarkFetchTagValuesFunction · 0.74
TestFetchTagValuesFunction · 0.74
BenchmarkFetchTagValuesFunction · 0.74
TestExecuteTagValuesFunction · 0.68