util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceIDVar              = "traceID"
	AcceptHeaderKey         = "Accept"
	ProtobufTypeHeaderValue = "application/protobuf"
	JSONTypeHeaderValue     = "application/json"
)
View Source
const (
	// FakeTenantID is the tenant ID to be used when operating with authorization disabled
	FakeTenantID = "single-tenant"
)

Variables

View Source
var ErrTraceNotFound = errors.New("trace not found")

ErrTraceNotFound can be used when we don't find a trace

Functions

func IsConnCanceled

func IsConnCanceled(err error) bool

IsConnCanceled returns true, if error is from a closed gRPC connection. copied from https://github.com/etcd-io/etcd/blob/7f47de84146bdc9225d2080ec8678ca8189a2d2b/clientv3/client.go#L646

func ParseTraceID added in v0.6.0

func ParseTraceID(r *http.Request) ([]byte, error)

func PrefixConfig

func PrefixConfig(prefix string, option string) string

func QueryTrace

func QueryTrace(baseURL, id, orgID string) (*tempopb.Trace, error)

func TokenFor

func TokenFor(userID string, b []byte) uint32

TokenFor generates a token used for finding ingesters from ring

func TokenForTraceID

func TokenForTraceID(b []byte) uint32

TokenForTraceID generates a hashed value for a trace id

Types

type MultiError

type MultiError []error

The MultiError type implements the error interface, and contains the Errors used to construct it.

func (*MultiError) Add

func (es *MultiError) Add(err error)

Add adds the error to the error list if it is not nil.

func (MultiError) Err

func (es MultiError) Err() error

Err returns the error list as an error or nil if it is empty.

func (MultiError) Error

func (es MultiError) Error() string

Returns a concatenated string of the contained errors

type RateLimitedLogger

type RateLimitedLogger struct {
	// contains filtered or unexported fields
}

func NewRateLimitedLogger

func NewRateLimitedLogger(logsPerSecond int, logger log.Logger) *RateLimitedLogger

func (*RateLimitedLogger) Log

func (l *RateLimitedLogger) Log(keyvals ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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