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

Method EmitBatches

pkg/util/trace_info.go:121–136  ·  view source on GitHub ↗
(ctx context.Context, c JaegerClient)

Source from the content-addressed store, hash-verified

119}
120
121func (t *TraceInfo) EmitBatches(ctx context.Context, c JaegerClient) error {
122 for i := int64(0); i < t.generateRandomInt(1, maxBatchesPerWrite); i++ {
123 ctx := user.InjectOrgID(ctx, t.tempoOrgID)
124 ctx, err := user.InjectIntoGRPCRequest(ctx)
125 if err != nil {
126 return fmt.Errorf("error injecting org id: %w", err)
127 }
128
129 err = c.EmitBatch(ctx, t.makeThriftBatch(t.traceIDHigh, t.traceIDLow))
130 if err != nil {
131 return fmt.Errorf("error pushing batch to Tempo: %w", err)
132 }
133 }
134
135 return nil
136}
137
138// EmitAllBatches sends all the batches that would normally be sent at some
139// interval when using EmitBatches.

Callers 3

EmitAllBatchesMethod · 0.95
doWriteFunction · 0.95
queueFutureBatchesFunction · 0.80

Calls 3

generateRandomIntMethod · 0.95
makeThriftBatchMethod · 0.95
EmitBatchMethod · 0.65

Tested by

no test coverage detected