spanfilter

package
v2.5.2-0...-f3a5e34 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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

Types

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

Jump to

Keyboard shortcuts

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