tracetracker

package
v0.0.0-...-fbc24b0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDimsToSyncSource = map[string]string{
	"container_id":       "container_id",
	"kubernetes_pod_uid": "kubernetes_pod_uid",
}

DefaultDimsToSyncSource are the default dimensions to sync correlated environment and services onto.

Functions

This section is empty.

Types

type ActiveServiceTracker

type ActiveServiceTracker struct {
	// contains filtered or unexported fields
}

ActiveServiceTracker keeps track of which services are seen in the trace spans passed through ProcessSpans. It supports expiry of service names if they are not seen for a certain amount of time.

func New

func New(
	log log.Logger,
	timeout time.Duration,
	correlationClient correlations.CorrelationClient,
	hostIDDims map[string]string,
	sendTraceHostCorrelationMetrics bool,
	newServiceCallback func(dp *datapoint.Datapoint),
	dimsToSyncSource map[string]string,
) *ActiveServiceTracker

New creates a new initialized service tracker

func (*ActiveServiceTracker) AddSpans

func (a *ActiveServiceTracker) AddSpans(ctx context.Context, spans []*trace.Span)

AddSpans wraps given SignalFx spans for use by AddSpansGeneric.

func (*ActiveServiceTracker) AddSpansGeneric

func (a *ActiveServiceTracker) AddSpansGeneric(ctx context.Context, spans SpanList)

AddSpansGeneric accepts a list of trace spans and uses them to update the current list of active services. This is thread-safe.

func (*ActiveServiceTracker) CorrelationDatapoints

func (a *ActiveServiceTracker) CorrelationDatapoints() []*datapoint.Datapoint

CorrelationDatapoints returns a list of host correlation datapoints based on the spans sent through ProcessSpans

func (*ActiveServiceTracker) InternalMetrics

func (a *ActiveServiceTracker) InternalMetrics() []*datapoint.Datapoint

InternalMetrics returns datapoint describing the status of the tracker

func (*ActiveServiceTracker) LoadHostIDDimCorrelations

func (a *ActiveServiceTracker) LoadHostIDDimCorrelations()

LoadHostIDDimCorrelations asynchronously retrieves all known correlations from the backend for all known hostIDDims. This allows the agent to timeout and manage correlation deletions on restart.

func (*ActiveServiceTracker) Purge

func (a *ActiveServiceTracker) Purge()

Purges caches on the ActiveServiceTracker

type CacheKey

type CacheKey struct {
	// contains filtered or unexported fields
}

type Span

type Span interface {
	Environment() (string, bool)
	ServiceName() (string, bool)
	Tag(string) (string, bool)
	NumTags() int
}

Span is a generic interface for accessing span metadata.

type SpanList

type SpanList interface {
	Len() int
	At(i int) Span
}

SpanList is a generic interface for accessing a list of spans.

type TimeoutCache

type TimeoutCache struct {
	sync.Mutex

	// Internal metrics
	ActiveCount int64
	PurgedCount int64
	// contains filtered or unexported fields
}

func NewTimeoutCache

func NewTimeoutCache(timeout time.Duration) *TimeoutCache

func (*TimeoutCache) Delete

func (t *TimeoutCache) Delete(key *CacheKey)

func (*TimeoutCache) GetActiveCount

func (t *TimeoutCache) GetActiveCount() int64

func (*TimeoutCache) GetPurgeable

func (t *TimeoutCache) GetPurgeable(now time.Time) []*CacheKey

func (*TimeoutCache) GetPurgedCount

func (t *TimeoutCache) GetPurgedCount() int64

func (*TimeoutCache) IsFull

func (t *TimeoutCache) IsFull() bool

returns whether the cache is full

func (*TimeoutCache) PurgeOld

func (t *TimeoutCache) PurgeOld(now time.Time, onPurge func(*CacheKey))

PurgeOld

func (*TimeoutCache) RunIfKeyDoesNotExist

func (t *TimeoutCache) RunIfKeyDoesNotExist(o *CacheKey, fn func())

RunIfKeyDoesNotExist locks and runs the supplied function if the key does not exist. Be careful not to perform cache operations inside of this function because they will deadlock

func (*TimeoutCache) SetMaxSize

func (t *TimeoutCache) SetMaxSize(max int64, now time.Time)

func (*TimeoutCache) UpdateIfExists

func (t *TimeoutCache) UpdateIfExists(o *CacheKey, now time.Time) bool

UpdateIfExists

func (*TimeoutCache) UpdateOrCreate

func (t *TimeoutCache) UpdateOrCreate(o *CacheKey, now time.Time) (isNew bool)

UpdateOrCreate

Jump to

Keyboard shortcuts

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