PushBytes ingests pre-marshaled traces directly into the local live-store.
(ctx context.Context, req *tempopb.PushBytesRequest)
| 809 | |
| 810 | // PushBytes ingests pre-marshaled traces directly into the local live-store. |
| 811 | func (s *LiveStore) PushBytes(ctx context.Context, req *tempopb.PushBytesRequest) (*tempopb.PushResponse, error) { |
| 812 | if err := s.CheckReady(ctx); err != nil { |
| 813 | return nil, err |
| 814 | } |
| 815 | if req == nil { |
| 816 | return nil, errors.New("nil push bytes request") |
| 817 | } |
| 818 | if len(req.Traces) != len(req.Ids) { |
| 819 | return nil, fmt.Errorf("mismatched traces and ids length: traces=%d ids=%d", len(req.Traces), len(req.Ids)) |
| 820 | } |
| 821 | if len(req.Traces) == 0 { |
| 822 | return &tempopb.PushResponse{}, nil |
| 823 | } |
| 824 | |
| 825 | tenantID, err := validation.ExtractValidTenantID(ctx) |
| 826 | if err != nil { |
| 827 | return nil, err |
| 828 | } |
| 829 | |
| 830 | inst, err := s.getOrCreateInstance(tenantID) |
| 831 | if err != nil { |
| 832 | return nil, err |
| 833 | } |
| 834 | |
| 835 | inst.pushBytes(ctx, time.Now(), req) |
| 836 | return &tempopb.PushResponse{}, nil |
| 837 | } |
| 838 | |
| 839 | // FindTraceByID implements tempopb.Querier |
| 840 | func (s *LiveStore) FindTraceByID(ctx context.Context, req *tempopb.TraceByIDRequest) (*tempopb.TraceByIDResponse, error) { |
nothing calls this directly
no test coverage detected