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

Function NewTraceByID

modules/frontend/combiner/trace_by_id.go:42–50  ·  view source on GitHub ↗

NewTraceByID returns a trace id combiner. The trace by id combiner has a few different behaviors then the others - 404 is a valid response code. if all downstream jobs return 404 then it will return 404 with no body - translate tempopb.TraceByIDResponse to tempopb.Trace. all other combiners pass the

(maxBytes int, contentType api.MarshallingFormat, traceRedactor TraceRedactor)

Source from the content-addressed store, hash-verified

40// - runs the zipkin dedupe logic on the fully combined trace
41// - encode the returned trace as either json or proto depending on the request
42func NewTraceByID(maxBytes int, contentType api.MarshallingFormat, traceRedactor TraceRedactor) Combiner {
43 return &TraceByIDCombiner{
44 c: trace.NewCombiner(maxBytes, false),
45 code: http.StatusNotFound,
46 contentType: contentType,
47 MetricsCombiner: NewTraceByIDMetricsCombiner(),
48 traceRedactor: traceRedactor,
49 }
50}
51
52func NewTypedTraceByID(maxBytes int, contentType api.MarshallingFormat, traceRedactor TraceRedactor) *TraceByIDCombiner {
53 return NewTraceByID(maxBytes, contentType, traceRedactor).(*TraceByIDCombiner)

Callers 4

TestTraceByIDShouldQuitFunction · 0.85
NewTypedTraceByIDFunction · 0.85

Calls 2

NewCombinerFunction · 0.92

Tested by 3

TestTraceByIDShouldQuitFunction · 0.68