util

package
v1.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FakeTenantID is the tenant ID to be used when operating with authorization disabled
	FakeTenantID = "single-tenant"
)

Variables

View Source
var ErrSearchKeyValueNotFound = errors.New("key/value not found")

ErrSearchKeyValueNotFound is used to indicate the requested key/value pair was not found.

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

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

Functions

func EqualHexStringTraceIDs added in v1.2.0

func EqualHexStringTraceIDs(a, b string) (bool, error)

EqualHexStringTraceIDs compares two trace ID strings and compares the resulting bytes after padding. Returns true unless there is a reason not to.

func ExtractTraceID added in v1.1.0

func ExtractTraceID(ctx context.Context) (string, bool)

ExtractTraceID extracts the trace id, if any from the context.

func HexStringToTraceID

func HexStringToTraceID(id string) ([]byte, error)

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 PrefixConfig

func PrefixConfig(prefix string, option string) string

func RandomAttrFromTrace added in v1.2.0

func RandomAttrFromTrace(t *tempopb.Trace) *v1common.KeyValue

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

func TraceIDToHexString added in v1.2.0

func TraceIDToHexString(byteID []byte) string

TraceIDToHexString converts a trace ID to its string representation and removes any leading zeros.

Types

type Client added in v1.2.0

type Client struct {
	BaseURL string
	OrgID   string
	// contains filtered or unexported fields
}

Client is client to the Tempo API.

func NewClient added in v1.2.0

func NewClient(baseURL, orgID string) *Client

func (*Client) QueryTrace added in v1.2.0

func (c *Client) QueryTrace(id string) (*tempopb.Trace, error)

func (*Client) Search added in v1.2.0

func (c *Client) Search(tags string) (*tempopb.SearchResponse, error)

Search Tempo. tags must be in logfmt format, that is "key1=value1 key2=value2"

func (*Client) SearchTagValues added in v1.2.0

func (c *Client) SearchTagValues(key string) (*tempopb.SearchTagValuesResponse, error)

func (*Client) SearchTags added in v1.2.0

func (c *Client) SearchTags() (*tempopb.SearchTagsResponse, error)

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{})

type TraceInfo added in v1.2.0

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

TraceInfo is used to construct synthetic traces and manage the expectations.

func NewTraceInfo added in v1.2.0

func NewTraceInfo(timestamp time.Time, tempoOrgID string) *TraceInfo

NewTraceInfo is used to produce a new TraceInfo.

func (*TraceInfo) ConstructTraceFromEpoch added in v1.2.0

func (t *TraceInfo) ConstructTraceFromEpoch() (*tempopb.Trace, error)

func (*TraceInfo) Done added in v1.2.0

func (t *TraceInfo) Done()

func (*TraceInfo) EmitAllBatches added in v1.2.0

func (t *TraceInfo) EmitAllBatches(c *jaeger_grpc.Reporter) error

EmitAllBatches sends all the batches that would normally be sent at some interval when using EmitBatches.

func (*TraceInfo) EmitBatches added in v1.2.0

func (t *TraceInfo) EmitBatches(c *jaeger_grpc.Reporter) error

func (*TraceInfo) HexID added in v1.2.0

func (t *TraceInfo) HexID() string

func (*TraceInfo) LongWritesRemaining added in v1.2.0

func (t *TraceInfo) LongWritesRemaining() int64

func (*TraceInfo) Ready added in v1.2.0

func (t *TraceInfo) Ready(now time.Time, writeBackoff, longWriteBackoff time.Duration) bool

func (*TraceInfo) Timestamp added in v1.2.0

func (t *TraceInfo) Timestamp() time.Time

func (*TraceInfo) TraceID added in v1.2.0

func (t *TraceInfo) TraceID() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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