server

package
v0.0.0-...-4d84f8c Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package server implements the Tracer server.

Index

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

type Dependency struct {
	Parent string
	Child  string
	Count  uint64
}

Dependency describes the dependency of one service on another.

type Purger

type Purger interface {
	Purge(before time.Time) error
}

A Purger can delete all traces starting before a certain date.

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.

func (*Server) Start

func (srv *Server) Start() error

type Storage

type Storage interface {
	tracer.Storer
	Queryer
}

Storage allows storing and querying spans.

type StorageEngine

type StorageEngine func(conf map[string]interface{}) (Storage, error)

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.

Jump to

Keyboard shortcuts

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