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)
| 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 |
| 42 | func 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 | |
| 52 | func NewTypedTraceByID(maxBytes int, contentType api.MarshallingFormat, traceRedactor TraceRedactor) *TraceByIDCombiner { |
| 53 | return NewTraceByID(maxBytes, contentType, traceRedactor).(*TraceByIDCombiner) |