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

Function batchesToTraces

modules/distributor/distributor_test.go:49–61  ·  view source on GitHub ↗
(t *testing.T, batches []*v1.ResourceSpans)

Source from the content-addressed store, hash-verified

47var ctx = user.InjectOrgID(context.Background(), "test")
48
49func batchesToTraces(t *testing.T, batches []*v1.ResourceSpans) ptrace.Traces {
50 t.Helper()
51
52 trace := tempopb.Trace{ResourceSpans: batches}
53
54 m, err := trace.Marshal()
55 require.NoError(t, err)
56
57 traces, err := (&ptrace.ProtoUnmarshaler{}).UnmarshalTraces(m)
58 require.NoError(t, err)
59
60 return traces
61}
62
63func TestRequestsByTraceID(t *testing.T) {
64 traceIDA := []byte{0x0A, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}

Calls 1

MarshalMethod · 0.95

Tested by

no test coverage detected