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

Function TestBackendBlockSearch

tempodb/encoding/vparquet5/block_search_test.go:24–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestBackendBlockSearch(t *testing.T) {
25 t.Parallel()
26 // Trace
27 // This is a fully-populated trace that we search for every condition
28 wantTr := &Trace{
29 TraceID: test.ValidTraceID(nil),
30 StartTimeUnixNano: uint64(1000 * time.Second),
31 EndTimeUnixNano: uint64(2000 * time.Second),
32 DurationNano: uint64((100 * time.Millisecond).Nanoseconds()),
33 RootServiceName: "RootService",
34 RootSpanName: "RootSpan",
35 ResourceSpans: []ResourceSpans{
36 {
37 Resource: Resource{
38 ServiceName: "myservice",
39 Attrs: []Attribute{
40 attr("bat", "baz"),
41 attr("cluster", "cluster"),
42 attr("namespace", "namespace"),
43 attr("pod", "pod"),
44 attr("container", "container"),
45 attr("k8s.cluster.name", "k8scluster"),
46 attr("k8s.namespace.name", "k8snamespace"),
47 attr("k8s.pod.name", "k8spod"),
48 attr("k8s.container.name", "k8scontainer"),
49 },
50 DedicatedAttributes: DedicatedAttributes{
51 String01: []string{"dedicated-resource-attr-value-1"},
52 String02: []string{"dedicated-resource-attr-value-2"},
53 String03: []string{"dedicated-resource-attr-value-3"},
54 String04: []string{"dedicated-resource-attr-value-4"},
55 String05: []string{"dedicated-resource-attr-value-5"},
56 Int01: []int64{123},
57 },
58 },
59 ScopeSpans: []ScopeSpans{
60 {
61 SpanCount: 1,
62 Spans: []Span{
63 {
64 Name: "hello",
65 SpanID: []byte{},
66 ParentSpanID: []byte{},
67 StatusCode: int(tracev1.Status_STATUS_CODE_ERROR),
68 Attrs: []Attribute{
69 attr("foo", "bar"),
70 attr("http.method", "get"),
71 attr("http.url", "url/hello/world"),
72 attr("http.status_code", 500),
73 },
74 DedicatedAttributes: DedicatedAttributes{
75 String01: []string{"dedicated-span-attr-value-1"},
76 String02: []string{"dedicated-span-attr-value-2"},
77 String03: []string{"dedicated-span-attr-value-3"},
78 String04: []string{"dedicated-span-attr-value-4"},
79 String05: []string{test.DedicatedBlobTestString()},
80 Int01: []int64{456},
81 },

Callers

nothing calls this directly

Calls 11

ValidTraceIDFunction · 0.92
DedicatedBlobTestStringFunction · 0.92
MakeTraceFunction · 0.92
TraceIDToHexStringFunction · 0.92
DefaultSearchOptionsFunction · 0.92
attrFunction · 0.70
traceToParquetFunction · 0.70
makeReqFunction · 0.70
SearchMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected