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

Function SearchTraceQLAndAssertTrace

integration/util/harness_api_reads.go:63–74  ·  view source on GitHub ↗
(t *testing.T, client *httpclient.Client, info *tempoUtil.TraceInfo)

Source from the content-addressed store, hash-verified

61}
62
63func SearchTraceQLAndAssertTrace(t *testing.T, client *httpclient.Client, info *tempoUtil.TraceInfo) {
64 expected, err := info.ConstructTraceFromEpoch()
65 require.NoError(t, err)
66
67 attr := tempoUtil.RandomAttrFromTrace(expected)
68 query := fmt.Sprintf(`{ .%s = "%s"}`, attr.GetKey(), attr.GetValue().GetStringValue())
69
70 resp, err := client.SearchTraceQL(query)
71 require.NoError(t, err)
72
73 require.True(t, traceIDInResults(t, info.HexID(), resp))
74}
75
76func SearchTraceQLAndAssertTraceWithRange(t *testing.T, client *httpclient.Client, info *tempoUtil.TraceInfo, start, end int64) {
77 expected, err := info.ConstructTraceFromEpoch()

Callers

nothing calls this directly

Calls 7

traceIDInResultsFunction · 0.85
GetKeyMethod · 0.80
GetStringValueMethod · 0.80
HexIDMethod · 0.80
SearchTraceQLMethod · 0.65
GetValueMethod · 0.45

Tested by

no test coverage detected