Documentation
¶
Index ¶
- Constants
- Variables
- func ExtractTraceID(ctx context.Context) (string, bool)
- func HexStringToTraceID(id string) ([]byte, error)
- func IsConnCanceled(err error) bool
- func ParseTraceID(r *http.Request) ([]byte, error)
- func PrefixConfig(prefix string, option string) string
- func QueryTrace(baseURL, id, orgID string) (*tempopb.Trace, error)
- func TokenFor(userID string, b []byte) uint32
- func TokenForTraceID(b []byte) uint32
- type MultiError
- type RateLimitedLogger
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 ExtractTraceID ¶ added in v1.1.0
ExtractTraceID extracts the trace id, if any from the context.
func HexStringToTraceID ¶
func IsConnCanceled ¶
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 TokenForTraceID ¶
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{})
Source Files
¶
Click to show internal directories.
Click to hide internal directories.