Version: v2.5.1+incompatible Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 2




View Source
const (
	// OK valid spans
	OK = "ok"


This section is empty.


func GetSpanFilterMapFromContext

func GetSpanFilterMapFromContext(ctx context.Context) error

GetSpanFilterMapFromContext is a target for spanumsink.SinkFunc to be turned into a spanumsink.Sink

func IsInvalid

func IsInvalid(err error) bool

IsInvalid returns false if it's a Map with no invalid entries or nil, else true

func IsMap

func IsMap(err error) bool

IsMap returns whether an error is an instance of Map

func ReturnInvalidOrError

func ReturnInvalidOrError(body []byte) error

ReturnInvalidOrError returns nil for a valid SpanFilter, an invalid SpanFilter or an error containing the bytes

func WithSpanFilterContext

func WithSpanFilterContext(ctx context.Context, sf *Map) context.Context

WithSpanFilterContext gives you a request with the Map set


type Map

type Map struct {
	Valid   int                 `json:"valid"`
	Invalid map[string][]string `json:"invalid,omitempty"`

Map is the response we return from ingest wrt our span endpoint It contains the number of spans that were valid, and a map of string reason to spanIds for each invalid span

func FromBytes

func FromBytes(body []byte) *Map

FromBytes returns a Map or an error

func GetSpanFilterMapOrNew

func GetSpanFilterMapOrNew(ctx context.Context) (context.Context, *Map)

GetSpanFilterMapOrNew is a target for spanumsink.SinkFunc to be turned into a spanumsink.Sink

func (*Map) Add

func (s *Map) Add(errType string, id string)

Add a error trace id

func (*Map) CheckInvalid

func (s *Map) CheckInvalid() bool

CheckInvalid is a nil safe check if this SpanFilter contains invalid keys

func (*Map) Error

func (s *Map) Error() string

Error returns a json representation of the Map

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL