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

Function SearchTraceQLAndAssertTraceWithRange

integration/util/harness_api_reads.go:76–87  ·  view source on GitHub ↗
(t *testing.T, client *httpclient.Client, info *tempoUtil.TraceInfo, start, end int64)

Source from the content-addressed store, hash-verified

74}
75
76func SearchTraceQLAndAssertTraceWithRange(t *testing.T, client *httpclient.Client, info *tempoUtil.TraceInfo, start, end int64) {
77 expected, err := info.ConstructTraceFromEpoch()
78 require.NoError(t, err)
79
80 attr := tempoUtil.RandomAttrFromTrace(expected)
81 query := fmt.Sprintf(`{ .%s = "%s"}`, attr.GetKey(), attr.GetValue().GetStringValue())
82
83 resp, err := client.SearchTraceQLWithRange(query, start, end)
84 require.NoError(t, err)
85
86 require.True(t, traceIDInResults(t, info.HexID(), resp))
87}
88
89// SearchStreamAndAssertTrace will search and assert that the trace is present in the streamed results.
90// nolint: revive

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected