func (jbh *jaegerBatchesHandler) SubmitBatches(ctx thrift.Context, batches []*jaeger.Batch) ([]*jaeger.BatchSubmitResponse, error) { responses := make([]*jaeger.BatchSubmitResponse, 0, len(batches)) for _, batch := range batches { mSpans := make([]*model.Span, 0, len(batch.Spans)) for _, span := range batch.Spans { mSpan := jConv.ToDomainSpan(span, batch.Process) mSpans = append(mSpans, mSpan) } oks, err := jbh.modelProcessor.ProcessSpans(mSpans, JaegerFormatType) if err != nil { return nil, err } batchOk := true for _, ok := range oks { if !ok { batchOk = false break } } res := &jaeger.BatchSubmitResponse{ Ok: batchOk, } responses = append(responses, res) } return responses, nil }
|