spanfilter

package
v3.3.47 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// InvalidSpanID has either the wrong length, or does not contain hex digits
	InvalidSpanID = "invalidSpanID"
	// InvalidTraceID has either the wrong length, or does not contain hex digits
	InvalidTraceID = "invalidTraceID"
	// ZipkinV2BinaryAnnotations are not allowed
	ZipkinV2BinaryAnnotations = "zipkinV2BinaryAnnotations"
	// NilServiceName when no localendpoint.name is provided
	NilServiceName = "nilServiceName"
	// ZeroTraceID when the traceid bytes are all zero
	ZeroTraceID = "zeroTraceID"
	// ZeroStartTime when the star time of the span is 0
	ZeroStartTime = "zeroStartTime"
	// TooManySpansInTrace when we find an abusive number of spans for a given traceID
	TooManySpansInTrace = "tooManySpansInTrace"
	// NilOperationName when no localendpoint.name is provided
	NilOperationName = "nilOperationName"
	// RequiredTagMissing means the span was missing a required tag
	RequiredTagMissing = "requiredTagMissing"
)
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 interface{}) 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) AddValid added in v3.3.6

func (s *Map) AddValid(i int)

AddValid is a short cut and much faster

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