Documentation ¶
Index ¶
- type AggregateStatus
- type Aggregator
- func (a *Aggregator) AggregateStatus(scope Scope, verbosity Verbosity) (*AggregateStatus, bool)
- func (a *Aggregator) Close()
- func (a *Aggregator) RecordStatus(source *componentstatus.InstanceID, event *componentstatus.Event)
- func (a *Aggregator) Subscribe(scope Scope, verbosity Verbosity) (<-chan *AggregateStatus, UnsubscribeFunc)
- type ErrorPriority
- type Event
- type Scope
- type UnsubscribeFunc
- type Verbosity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateStatus ¶
type AggregateStatus struct { Event ComponentStatusMap map[string]*AggregateStatus }
AggregateStatus contains a map of child AggregateStatuses and an embedded Event. It can be used to represent a single, top-level status when the ComponentStatusMap is empty, or a nested structure when map is non-empty.
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator records individual status events for components and aggregates statuses for the pipelines they belong to and the collector overall.
func NewAggregator ¶
func NewAggregator(errPriority ErrorPriority) *Aggregator
NewAggregator returns a *status.Aggregator.
func (*Aggregator) AggregateStatus ¶
func (a *Aggregator) AggregateStatus(scope Scope, verbosity Verbosity) (*AggregateStatus, bool)
AggregateStatus returns an *AggregateStatus for the given scope. The scope can be the collector overall (ScopeAll), extensions (ScopeExtensions), or a pipeline by name. Detail specifies whether or not subtrees should be returned with the *AggregateStatus. The boolean return value indicates whether or not the scope was found.
func (*Aggregator) Close ¶
func (a *Aggregator) Close()
Close terminates all existing subscriptions.
func (*Aggregator) RecordStatus ¶
func (a *Aggregator) RecordStatus(source *componentstatus.InstanceID, event *componentstatus.Event)
RecordStatus stores and aggregates a StatusEvent for the given component instance.
func (*Aggregator) Subscribe ¶
func (a *Aggregator) Subscribe(scope Scope, verbosity Verbosity) (<-chan *AggregateStatus, UnsubscribeFunc)
Subscribe allows you to subscribe to a stream of events for the given scope. The scope can be the collector overall (ScopeAll), extensions (ScopeExtensions), or a pipeline name. It is possible to subscribe to a pipeline that has not yet reported. An initial nil will be sent on the channel and events will start streaming if and when it starts reporting. A `Verbose` verbosity specifies that subtrees should be returned with the *AggregateStatus. To unsubscribe, call the returned UnsubscribeFunc.
type ErrorPriority ¶
type ErrorPriority int
const ( PriorityPermanent ErrorPriority = iota PriorityRecoverable )
type Event ¶
type Event interface { Status() componentstatus.Status Err() error Timestamp() time.Time }
Note: this interface had to be introduced because we need to be able to rewrite the timestamps of some events during aggregation. The implementation in core doesn't currently allow this, but this interface provides a workaround.
type Scope ¶
type Scope string
Scope refers to a part of an AggregateStatus. The zero-value, aka ScopeAll, refers to the entire AggregateStatus. ScopeExtensions refers to the extensions subtree, and any other value refers to a pipeline subtree.
type UnsubscribeFunc ¶
type UnsubscribeFunc func()
UnsubscribeFunc is a function used to unsubscribe from a stream.