Documentation ¶
Index ¶
- Constants
- Variables
- func DiffConfig(defaultConfig, actualConfig map[interface{}]interface{}) (map[interface{}]interface{}, error)
- func EqualHexStringTraceIDs(a, b string) (bool, error)
- func ExtractTraceID(ctx context.Context) (string, bool)
- func GetFirstAddressOf(names []string) (string, error)
- func HexStringToTraceID(id string) ([]byte, error)
- func IsConnCanceled(err error) bool
- func IsRequestBodyTooLarge(err error) bool
- func NewDNSWatcher(address string, dnsLookupPeriod time.Duration, notifications DNSNotifications) (services.Service, error)
- func PadTraceIDTo16Bytes(traceID []byte) []byte
- func ParseProtoReader(ctx context.Context, reader io.Reader, expectedSize, maxSize int, ...) error
- func PrefixConfig(prefix string, option string) string
- func RandomAttrFromTrace(t *tempopb.Trace) *v1common.KeyValue
- func RenderHTTPResponse(w http.ResponseWriter, v interface{}, t *template.Template, r *http.Request)
- func SerializeProtoResponse(w http.ResponseWriter, resp proto.Message, compression CompressionType) error
- func StreamWriteYAMLResponse(w http.ResponseWriter, iter chan interface{}, logger log.Logger)
- func StringifyAnyValue(anyValue *v1common.AnyValue) string
- func TokenFor(userID string, b []byte) uint32
- func TokenForTraceID(b []byte) uint32
- func TraceIDToHexString(byteID []byte) string
- func WriteHTMLResponse(w http.ResponseWriter, message string)
- func WriteJSONResponse(w http.ResponseWriter, v interface{})
- func WriteTextResponse(w http.ResponseWriter, message string)
- func WriteYAMLResponse(w http.ResponseWriter, v interface{})
- func YAMLMarshalUnmarshal(in interface{}) (map[interface{}]interface{}, error)
- type ActiveUsers
- type ActiveUsersCleanupService
- type BasicAuth
- type Client
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) QueryTrace(id string) (*tempopb.Trace, error)
- func (c *Client) Search(tags string) (*tempopb.SearchResponse, error)
- func (c *Client) SearchTagValues(key string) (*tempopb.SearchTagValuesResponse, error)
- func (c *Client) SearchTags() (*tempopb.SearchTagsResponse, error)
- func (c *Client) SearchWithRange(tags string, start int64, end int64) (*tempopb.SearchResponse, error)
- func (c *Client) WithTransport(t http.RoundTripper)
- type CompressionType
- type DNSNotifications
- type DistinctStringCollector
- type MultiError
- type TraceInfo
- func (t *TraceInfo) ConstructTraceFromEpoch() (*tempopb.Trace, error)
- func (t *TraceInfo) Done()
- func (t *TraceInfo) EmitAllBatches(c *jaeger_grpc.Reporter) error
- func (t *TraceInfo) EmitBatches(c *jaeger_grpc.Reporter) error
- func (t *TraceInfo) HexID() string
- func (t *TraceInfo) LongWritesRemaining() int64
- func (t *TraceInfo) Ready(now time.Time, writeBackoff, longWriteBackoff time.Duration) bool
- func (t *TraceInfo) Timestamp() time.Time
- func (t *TraceInfo) TraceID() ([]byte, error)
Constants ¶
const (
// FakeTenantID is the tenant ID to be used when operating with authorization disabled
FakeTenantID = "single-tenant"
)
const (
QueryTraceEndpoint = "/api/traces"
)
Variables ¶
var ( // ErrTraceNotFound can be used when we don't find a trace ErrTraceNotFound = errors.New("trace not found") // ErrSearchKeyValueNotFound is used to indicate the requested key/value pair was not found. ErrSearchKeyValueNotFound = errors.New("key/value not found") ErrUnsupported = fmt.Errorf("unsupported") )
Functions ¶
func DiffConfig ¶ added in v1.4.0
func DiffConfig(defaultConfig, actualConfig map[interface{}]interface{}) (map[interface{}]interface{}, error)
DiffConfig utility function that returns the diff between two config map objects
func EqualHexStringTraceIDs ¶ added in v1.2.0
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
ExtractTraceID extracts the trace id, if any from the context.
func GetFirstAddressOf ¶ added in v1.4.0
GetFirstAddressOf returns the first IPv4 address of the supplied interface names, omitting any 169.254.x.x automatic private IPs if possible.
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 IsRequestBodyTooLarge ¶ added in v1.4.0
IsRequestBodyTooLarge returns true if the error is "http: request body too large".
func NewDNSWatcher ¶ added in v1.4.0
func NewDNSWatcher(address string, dnsLookupPeriod time.Duration, notifications DNSNotifications) (services.Service, error)
NewDNSWatcher creates a new DNS watcher and returns a service that is wrapping it.
func PadTraceIDTo16Bytes ¶ added in v1.5.0
func ParseProtoReader ¶ added in v1.4.0
func ParseProtoReader(ctx context.Context, reader io.Reader, expectedSize, maxSize int, req proto.Message, compression CompressionType) error
ParseProtoReader parses a compressed proto from an io.Reader.
func PrefixConfig ¶
func RandomAttrFromTrace ¶ added in v1.2.0
func RenderHTTPResponse ¶ added in v1.4.0
func RenderHTTPResponse(w http.ResponseWriter, v interface{}, t *template.Template, r *http.Request)
RenderHTTPResponse either responds with json or a rendered html page using the passed in template by checking the Accepts header
func SerializeProtoResponse ¶ added in v1.4.0
func SerializeProtoResponse(w http.ResponseWriter, resp proto.Message, compression CompressionType) error
SerializeProtoResponse serializes a protobuf response into an HTTP response.
func StreamWriteYAMLResponse ¶ added in v1.4.0
func StreamWriteYAMLResponse(w http.ResponseWriter, iter chan interface{}, logger log.Logger)
StreamWriteYAMLResponse stream writes data as http response
func StringifyAnyValue ¶ added in v1.4.0
func TokenForTraceID ¶
TokenForTraceID generates a hashed value for a trace id
func TraceIDToHexString ¶ added in v1.2.0
TraceIDToHexString converts a trace ID to its string representation and removes any leading zeros.
func WriteHTMLResponse ¶ added in v1.4.0
func WriteHTMLResponse(w http.ResponseWriter, message string)
Sends message as text/html response with 200 status code.
func WriteJSONResponse ¶ added in v1.4.0
func WriteJSONResponse(w http.ResponseWriter, v interface{})
WriteJSONResponse writes some JSON as a HTTP response.
func WriteTextResponse ¶ added in v1.4.0
func WriteTextResponse(w http.ResponseWriter, message string)
Sends message as text/plain response with 200 status code.
func WriteYAMLResponse ¶ added in v1.4.0
func WriteYAMLResponse(w http.ResponseWriter, v interface{})
WriteYAMLResponse writes some YAML as a HTTP response.
func YAMLMarshalUnmarshal ¶ added in v1.4.0
func YAMLMarshalUnmarshal(in interface{}) (map[interface{}]interface{}, error)
YAMLMarshalUnmarshal utility function that converts a YAML interface in a map doing marshal and unmarshal of the parameter
Types ¶
type ActiveUsers ¶ added in v1.4.0
type ActiveUsers struct {
// contains filtered or unexported fields
}
ActiveUsers keeps track of latest user's activity timestamp, and allows purging users that are no longer active.
func NewActiveUsers ¶ added in v1.4.0
func NewActiveUsers() *ActiveUsers
func (*ActiveUsers) PurgeInactiveUsers ¶ added in v1.4.0
func (m *ActiveUsers) PurgeInactiveUsers(deadline int64) []string
PurgeInactiveUsers removes users that were last active before given deadline, and returns removed users.
func (*ActiveUsers) UpdateUserTimestamp ¶ added in v1.4.0
func (m *ActiveUsers) UpdateUserTimestamp(userID string, ts int64)
type ActiveUsersCleanupService ¶ added in v1.4.0
type ActiveUsersCleanupService struct { services.Service // contains filtered or unexported fields }
ActiveUsersCleanupService tracks active users, and periodically purges inactive ones while running.
func NewActiveUsersCleanupService ¶ added in v1.4.0
func NewActiveUsersCleanupService(cleanupInterval, inactiveTimeout time.Duration, cleanupFn func(string)) *ActiveUsersCleanupService
func NewActiveUsersCleanupWithDefaultValues ¶ added in v1.4.0
func NewActiveUsersCleanupWithDefaultValues(cleanupFn func(string)) *ActiveUsersCleanupService
func (*ActiveUsersCleanupService) UpdateUserTimestamp ¶ added in v1.4.0
func (s *ActiveUsersCleanupService) UpdateUserTimestamp(user string, now time.Time)
type BasicAuth ¶ added in v1.4.0
type BasicAuth struct { Username string `yaml:"basic_auth_username"` Password string `yaml:"basic_auth_password"` }
BasicAuth configures basic authentication for HTTP clients.
type Client ¶ added in v1.2.0
Client is client to the Tempo API.
func NewClientWithCompression ¶ added in v1.3.0
func (*Client) QueryTrace ¶ added in v1.2.0
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)
func (*Client) SearchWithRange ¶ added in v1.3.0
func (c *Client) SearchWithRange(tags string, start int64, end int64) (*tempopb.SearchResponse, error)
SearchWithRange calls the /api/search endpoint. tags is expected to be in logfmt format and start/end are unix epoch timestamps in seconds.
func (*Client) WithTransport ¶ added in v1.3.0
func (c *Client) WithTransport(t http.RoundTripper)
type CompressionType ¶ added in v1.4.0
type CompressionType int
CompressionType for encoding and decoding requests and responses.
const ( NoCompression CompressionType = iota RawSnappy )
Values for CompressionType
type DNSNotifications ¶ added in v1.4.0
type DNSNotifications interface { // New address has been discovered by DNS watcher for supplied hostname. AddressAdded(address string) // Previously-discovered address is no longer resolved for the hostname. AddressRemoved(address string) }
Notifications about address resolution. All notifications are sent on the same goroutine.
type DistinctStringCollector ¶ added in v1.5.0
type DistinctStringCollector struct {
// contains filtered or unexported fields
}
func NewDistinctStringCollector ¶ added in v1.5.0
func NewDistinctStringCollector(maxDataSize int) *DistinctStringCollector
NewDistinctStringCollector with the given maximum data size. This is calculated as the total length of the recorded strings. For ease of use, maximum=0 is interpreted as unlimited.
func (*DistinctStringCollector) Collect ¶ added in v1.5.0
func (d *DistinctStringCollector) Collect(s string)
func (*DistinctStringCollector) Exceeded ¶ added in v1.5.0
func (d *DistinctStringCollector) Exceeded() bool
Exceeded indicates if some values were lost because the maximum size limit was met.
func (*DistinctStringCollector) Strings ¶ added in v1.5.0
func (d *DistinctStringCollector) Strings() []string
Strings returns the final list of distinct values collected and sorted.
func (*DistinctStringCollector) TotalDataSize ¶ added in v1.5.0
func (d *DistinctStringCollector) TotalDataSize() int
TotalDataSize is the total size of all distinct strings encountered.
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 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
NewTraceInfo is used to produce a new TraceInfo.
func (*TraceInfo) ConstructTraceFromEpoch ¶ added in v1.2.0
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