collectors

package
v0.0.0-...-3dd6856 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CollectorPriorities = make(map[string]CollectorPriority)

CollectorPriorities holds collector priorities

View Source
var DefaultCatalog = make(Catalog)

DefaultCatalog holds every compiled-in collector

Functions

This section is empty.

Types

type Catalog

type Catalog map[string]CollectorFactory

Catalog holds available collectors for detection and usage

type CollectionMode

type CollectionMode int

CollectionMode informs the Tagger of how to schedule a Collector

const (
	NoCollection        CollectionMode = iota // Not available
	PullCollection                            // Call regularly via the Pull method
	StreamCollection                          // Will continuously feed updates on the channel from Steam() to Stop()
	FetchOnlyCollection                       // Only call Fetch() on cache misses
)

Return values for Collector.Init to inform the Tagger of the scheduling needed

type Collector

type Collector interface {
	Detect(chan<- []*TagInfo) (CollectionMode, error)
}

Collector retrieve entity tags from a given source and feeds updates via the TagInfo channel

type CollectorFactory

type CollectorFactory func() Collector

CollectorFactory is functions that return a Collector

type CollectorPriority

type CollectorPriority int

CollectorPriority helps resolving dupe tags from collectors

const (
	NodeRuntime CollectorPriority = iota
	NodeOrchestrator
	ClusterOrchestrator
)

List of collector priorities

type Fetcher

type Fetcher interface {
	Fetch(string) ([]string, []string, []string, error)
}

Fetcher allows to fetch tags on-demand in case of cache miss

type Puller

type Puller interface {
	Fetcher
	Pull() error
}

Puller has to be triggered regularly

type Streamer

type Streamer interface {
	Fetcher
	Stream() error
	Stop() error
}

Streamer feeds back TagInfo when detecting changes

type TagCardinality

type TagCardinality int

TagCardinality indicates the cardinality-level of a tag. It can be low cardinality (in the host count order of magnitude) orchestrator cardinality (tags that change value for each pod, task, etc.) high cardinality (typically tags that change value for each web request, each container, etc.)

const (
	LowCardinality TagCardinality = iota
	OrchestratorCardinality
	HighCardinality
)

List of possible container cardinality

type TagInfo

type TagInfo struct {
	Source               string   // source collector's name
	Entity               string   // entity name ready for lookup
	HighCardTags         []string // high cardinality tags that can create a lot of different timeseries (typically one per container, user request, etc.)
	OrchestratorCardTags []string // orchestrator cardinality tags that have as many combination as pods/tasks
	LowCardTags          []string // low cardinality tags safe for every pipeline
	DeleteEntity         bool     // true if the entity is to be deleted from the store
}

TagInfo holds the tag information for a given entity and source. It's meant to be created from collectors and read by the store.

Jump to

Keyboard shortcuts

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