Documentation
¶
Index ¶
- Constants
- Variables
- func TagCardinalityToString(c TagCardinality) string
- type Catalog
- type CollectionMode
- type Collector
- type CollectorFactory
- type CollectorPriority
- type Fetcher
- type GardenCollector
- type Puller
- type Streamer
- type TagCardinality
- type TagInfo
- type WorkloadMetaCollector
- func (c *WorkloadMetaCollector) Detect(ctx context.Context, out chan<- []*TagInfo) (CollectionMode, error)
- func (c *WorkloadMetaCollector) Fetch(ctx context.Context, entity string) ([]string, []string, []string, error)
- func (c *WorkloadMetaCollector) Stop() error
- func (c *WorkloadMetaCollector) Stream() error
Constants ¶
const ( // LowCardinalityString is the string representation of the low cardinality LowCardinalityString = "low" // OrchestratorCardinalityString is the string representation of the orchestrator cardinality OrchestratorCardinalityString = "orchestrator" // ShortOrchestratorCardinalityString is the short string representation of the orchestrator cardinality ShortOrchestratorCardinalityString = "orch" // HighCardinalityString is the string representation of the high cardinality HighCardinalityString = "high" // UnknownCardinalityString represents an unknown level of cardinality UnknownCardinalityString = "unknown" )
const (
// OrchestratorScopeEntityID defines the orchestrator scope entity ID
OrchestratorScopeEntityID = "internal://orchestrator-scope-entity-id"
)
Variables ¶
var CollectorPriorities = make(map[string]CollectorPriority)
CollectorPriorities holds collector priorities
var DefaultCatalog = make(Catalog)
DefaultCatalog holds every compiled-in collector
Functions ¶
func TagCardinalityToString ¶ added in v0.9.0
func TagCardinalityToString(c TagCardinality) string
TagCardinalityToString returns a string representation of a TagCardinality value.
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() )
Return values for Collector.Init to inform the Tagger of the scheduling needed
type Collector ¶
type Collector interface {
Detect(context.Context, 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 GardenCollector ¶
type GardenCollector struct {
// contains filtered or unexported fields
}
GardenCollector collects tags for CF application containers
func (*GardenCollector) Detect ¶
func (c *GardenCollector) Detect(ctx context.Context, out chan<- []*TagInfo) (CollectionMode, error)
Detect tries to connect to the Garden API and the cluster agent
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
func StringToTagCardinality ¶ added in v0.9.0
func StringToTagCardinality(c string) (TagCardinality, error)
StringToTagCardinality extracts a TagCardinality from a string. In case of failure to parse, returns an error and defaults to Low.
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
StandardTags []string // the discovered standard tags (env, version, service) for the entity
DeleteEntity bool // true if the entity is to be deleted from the store
CacheMiss bool // true if the TagInfo is generated by a tag miss
ExpiryDate time.Time // keep in cache until expiryDate
}
TagInfo holds the tag information for a given entity and source. It's meant to be created from collectors and read by the store.
type WorkloadMetaCollector ¶ added in v0.9.0
type WorkloadMetaCollector struct {
// contains filtered or unexported fields
}
WorkloadMetaCollector collects tags from the metadata in the workloadmeta store.
func (*WorkloadMetaCollector) Detect ¶ added in v0.9.0
func (c *WorkloadMetaCollector) Detect(ctx context.Context, out chan<- []*TagInfo) (CollectionMode, error)
Detect initializes the WorkloadMetaCollector.
func (*WorkloadMetaCollector) Fetch ¶ added in v0.9.0
func (c *WorkloadMetaCollector) Fetch(ctx context.Context, entity string) ([]string, []string, []string, error)
Fetch is a no-op in the WorkloadMetaCollector to prevent expensive and race-condition prone forcing of pulls from upstream collectors. Since workloadmeta.Store will eventually own notifying all downstream consumers, this codepath should never trigger anyway.
func (*WorkloadMetaCollector) Stop ¶ added in v0.9.0
func (c *WorkloadMetaCollector) Stop() error
Stop shuts down the WorkloadMetaCollector.
func (*WorkloadMetaCollector) Stream ¶ added in v0.9.0
func (c *WorkloadMetaCollector) Stream() error
Stream runs the continuous event watching loop and sends new tags to the tagger based on the events sent by the workloadmeta.