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

Method Decode

pkg/ingest/encoding.go:201–217  ·  view source on GitHub ↗

Decode implements GeneratorCodec.

(data []byte)

Source from the content-addressed store, hash-verified

199
200// Decode implements GeneratorCodec.
201func (d *OTLPDecoder) Decode(data []byte) (iter.Seq2[*tempopb.PushSpansRequest, error], error) {
202 d.trace.ResourceSpans = d.trace.ResourceSpans[:0]
203 err := d.trace.Unmarshal(data)
204 if err != nil {
205 return nil, err
206 }
207
208 return func(yield func(*tempopb.PushSpansRequest, error) bool) {
209 yield(&tempopb.PushSpansRequest{
210 Batches: d.trace.ResourceSpans,
211 // ptrace.Traces does not contain a flag that translates to this field, if we
212 // ever want to skip spans in this record type we'll need to propagate this via
213 // record metadata.
214 SkipMetricsGeneration: false,
215 }, nil)
216 }, nil
217}

Callers 1

Calls 1

UnmarshalMethod · 0.65

Tested by 1