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

Function TestBackendBlockSearch

tempodb/encoding/vparquet3/block_search_test.go:23–255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected