Documentation ¶
Overview ¶
Package server implements the Tracer server.
Index ¶
- func RegisterQueryTransport(name string, engine QueryTransportEngine)
- func RegisterStorage(name string, engine StorageEngine)
- func RegisterStorageTransport(name string, engine StorageTransportEngine)
- type Dependency
- type Purger
- type Query
- type QueryTag
- type QueryTransport
- type QueryTransportEngine
- type Queryer
- type Server
- type Storage
- type StorageEngine
- type StorageTransport
- type StorageTransportEngine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterQueryTransport ¶
func RegisterQueryTransport(name string, engine QueryTransportEngine)
RegisterQueryTransport registers a query transport.
func RegisterStorage ¶
func RegisterStorage(name string, engine StorageEngine)
RegisterStorage registers a storage engine.
func RegisterStorageTransport ¶
func RegisterStorageTransport(name string, engine StorageTransportEngine)
RegisterStorageTransport registers a storage transport.
Types ¶
type Dependency ¶
Dependency describes the dependency of one service on another.
type Query ¶
type Query struct { // Only return traces that started at or after this time. StartTime time.Time // Only return traces that finished before or at this time. FinishTime time.Time // Only return traces where a span has this operation name. OperationName string // Only return traces that lasted at least this long. MinDuration time.Duration // Only return traces that lasted at most this long. MaxDuration time.Duration // Only return traces where all spans combined have all of these // tags. AndTags []QueryTag // Only return traces where all spans combined have at least one // of these tags. OrTags []QueryTag // How many traces to return. Zero means no limit. Num int }
A Query describes the various conditionals of a query for a trace.
All conditions are ANDed together. Zero values are understood as the lack of a constraint.
type QueryTag ¶
type QueryTag struct { // The key of the tag. Key string // The value of the tag. Value string // Whether the value should be checked for. CheckValue bool }
QueryTag describes a single tag or log entry that should be queried for.
type QueryTransport ¶
type QueryTransport interface { // Start starts the transport. Start() error }
QueryTransport accepts requests via some protocol and answers them.
type QueryTransportEngine ¶
type QueryTransportEngine func(srv *Server, conf map[string]interface{}) (QueryTransport, error)
A QueryTransportEngine returns an instance of a query transport.
func GetQueryTransport ¶
func GetQueryTransport(name string) (QueryTransportEngine, bool)
GetQueryTransport returns a query transport by name.
type Queryer ¶
type Queryer interface { // TraceByID returns a trace with a specific ID. TraceByID(id uint64) (tracer.RawTrace, error) // SpanByID returns a span with a specific ID. SpanByID(id uint64) (tracer.RawSpan, error) // QueryTraces returns all traces that match a query. QueryTraces(q Query) ([]tracer.RawTrace, error) // Services returns a list of all services. Services() ([]string, error) // Operations returns a list of all operations. Operations(service string) ([]string, error) // Dependencies returns the dependencies between services. Dependencies() ([]Dependency, error) }
A Queryer is a backend that allows fetching traces and spans by ID or via a more advanced query.
type Server ¶
type Server struct { Storage Storage StorageTransport StorageTransport QueryTransports []QueryTransport }
Server is an instance of the Tracer application.
type StorageEngine ¶
A StorageEngine returns an instance of a storage.
func GetStorage ¶
func GetStorage(name string) (StorageEngine, bool)
GetStorage returns a storage engine by name.
type StorageTransport ¶
type StorageTransport interface { // Start starts the transport. Start() error }
A StorageTransport accepts spans via some protocol and sends them to a Storer.
type StorageTransportEngine ¶
type StorageTransportEngine func(srv *Server, conf map[string]interface{}) (StorageTransport, error)
A StorageTransportEngine returns an instance of a storage transport.
func GetStorageTransport ¶
func GetStorageTransport(name string) (StorageTransportEngine, bool)
GetStorageTransport returns a storage transport by name.