Documentation ¶
Index ¶
- Variables
- type ActiveServiceTracker
- func (a *ActiveServiceTracker) AddSpans(ctx context.Context, spans []*trace.Span)
- func (a *ActiveServiceTracker) AddSpansGeneric(ctx context.Context, spans SpanList)
- func (a *ActiveServiceTracker) CorrelationDatapoints() []*datapoint.Datapoint
- func (a *ActiveServiceTracker) InternalMetrics() []*datapoint.Datapoint
- func (a *ActiveServiceTracker) LoadHostIDDimCorrelations()
- func (a *ActiveServiceTracker) Purge()
- type CacheKey
- type Span
- type SpanList
- type TimeoutCache
- func (t *TimeoutCache) Delete(key *CacheKey)
- func (t *TimeoutCache) GetActiveCount() int64
- func (t *TimeoutCache) GetPurgeable(now time.Time) []*CacheKey
- func (t *TimeoutCache) GetPurgedCount() int64
- func (t *TimeoutCache) IsFull() bool
- func (t *TimeoutCache) PurgeOld(now time.Time, onPurge func(*CacheKey))
- func (t *TimeoutCache) RunIfKeyDoesNotExist(o *CacheKey, fn func())
- func (t *TimeoutCache) SetMaxSize(max int64, now time.Time)
- func (t *TimeoutCache) UpdateIfExists(o *CacheKey, now time.Time) bool
- func (t *TimeoutCache) UpdateOrCreate(o *CacheKey, now time.Time) (isNew bool)
Constants ¶
This section is empty.
Variables ¶
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 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 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