store

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown         ConnectionType = ""
	MessagingSystem                = "messaging_system"
	Database                       = "database"
)

Variables

View Source
var (
	ErrTooManyItems = errors.New("too many items")
)

Functions

This section is empty.

Types

type Callback

type Callback func(e *Edge)

type ConnectionType added in v1.5.0

type ConnectionType string

type Edge

type Edge struct {
	TraceID                            string
	ConnectionType                     ConnectionType
	ServerService, ClientService       string
	ServerLatencySec, ClientLatencySec float64

	// If either the client or the server spans have status code error,
	// the Edge will be considered as failed.
	Failed bool

	// Additional dimension to add to the metrics
	Dimensions map[string]string
	// contains filtered or unexported fields
}

Edge is an Edge between two nodes in the graph

type Store

type Store interface {
	// UpsertEdge inserts or updates an edge.
	UpsertEdge(key string, update Callback) (isNew bool, err error)
	// Expire evicts expired edges from the store.
	Expire()
}

Store is an interface for building service graphs.

func NewStore

func NewStore(ttl time.Duration, maxItems int, onComplete, onExpire Callback) Store

NewStore creates a Store to build service graphs. The store caches edges, each representing a request between two services. Once an edge is complete its metrics can be collected. Edges that have not found their pair are deleted after ttl time.

Jump to

Keyboard shortcuts

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