Documentation ¶
Index ¶
- func InitCheckManager()
- type CheckAPI
- type CheckHandler
- type CheckHandlerBase
- type CheckHealthAPI
- type CheckIdentifier
- type CheckLifecycleAPI
- type CheckManager
- func (cm *CheckManager) GetCheckHandler(checkID check.ID) CheckHandler
- func (cm *CheckManager) MakeCheckHandlerTransactional(checkID check.ID) CheckHandler
- func (cm *CheckManager) RegisterCheckHandler(check CheckIdentifier, config, initConfig integration.Data) CheckHandler
- func (cm *CheckManager) Stop()
- func (cm *CheckManager) UnsubscribeCheckHandler(checkID check.ID)
- type CheckStateAPI
- type CheckTelemetryAPI
- type CheckTopologyAPI
- type CheckTransactionalAPI
- type Config
- type DiscardTransaction
- type IDOnlyCheckIdentifier
- type NonTransactionalCheckHandler
- func (ch *NonTransactionalCheckHandler) DiscardTransaction(string)
- func (ch *NonTransactionalCheckHandler) GetState(key string) string
- func (ch *NonTransactionalCheckHandler) Name() string
- func (ch *NonTransactionalCheckHandler) SetState(key string, state string)
- func (ch *NonTransactionalCheckHandler) SetTransactionState(string, string)
- func (ch *NonTransactionalCheckHandler) StartTransaction() string
- func (ch *NonTransactionalCheckHandler) StopTransaction()
- func (ch *NonTransactionalCheckHandler) SubmitComplete()
- func (ch *NonTransactionalCheckHandler) SubmitComponent(instance topology.Instance, component topology.Component)
- func (ch *NonTransactionalCheckHandler) SubmitDelete(instance topology.Instance, topologyElementID string)
- func (ch *NonTransactionalCheckHandler) SubmitEvent(event metrics.Event)
- func (ch *NonTransactionalCheckHandler) SubmitHealthCheckData(stream health.Stream, data health.CheckData)
- func (ch *NonTransactionalCheckHandler) SubmitHealthStartSnapshot(stream health.Stream, intervalSeconds int, expirySeconds int)
- func (ch *NonTransactionalCheckHandler) SubmitHealthStopSnapshot(stream health.Stream)
- func (ch *NonTransactionalCheckHandler) SubmitRawMetricsData(data telemetry.RawMetrics)
- func (ch *NonTransactionalCheckHandler) SubmitRelation(instance topology.Instance, relation topology.Relation)
- func (ch *NonTransactionalCheckHandler) SubmitStartSnapshot(instance topology.Instance)
- func (ch *NonTransactionalCheckHandler) SubmitStopSnapshot(instance topology.Instance)
- type StartTransaction
- type StopTransaction
- type SubmitComplete
- type SubmitComponent
- type SubmitDelete
- type SubmitEvent
- type SubmitHealthCheckData
- type SubmitHealthStartSnapshot
- type SubmitHealthStopSnapshot
- type SubmitRawMetric
- type SubmitRelation
- type SubmitSetTransactionState
- type SubmitStartSnapshot
- type SubmitStopSnapshot
- type TransactionalCheckHandler
- func (ch *TransactionalCheckHandler) DiscardTransaction(reason string)
- func (ch *TransactionalCheckHandler) GetCurrentTransaction() string
- func (ch *TransactionalCheckHandler) GetState(key string) string
- func (ch *TransactionalCheckHandler) Name() string
- func (ch *TransactionalCheckHandler) SetState(key string, state string)
- func (ch *TransactionalCheckHandler) SetTransactionState(key string, state string)
- func (ch *TransactionalCheckHandler) Start()
- func (ch *TransactionalCheckHandler) StartTransaction() string
- func (ch *TransactionalCheckHandler) Stop()
- func (ch *TransactionalCheckHandler) StopTransaction()
- func (ch *TransactionalCheckHandler) SubmitComplete()
- func (ch *TransactionalCheckHandler) SubmitComponent(instance topology.Instance, component topology.Component)
- func (ch *TransactionalCheckHandler) SubmitDelete(instance topology.Instance, topologyElementID string)
- func (ch *TransactionalCheckHandler) SubmitEvent(event metrics.Event)
- func (ch *TransactionalCheckHandler) SubmitHealthCheckData(stream health.Stream, data health.CheckData)
- func (ch *TransactionalCheckHandler) SubmitHealthStartSnapshot(stream health.Stream, intervalSeconds int, expirySeconds int)
- func (ch *TransactionalCheckHandler) SubmitHealthStopSnapshot(stream health.Stream)
- func (ch *TransactionalCheckHandler) SubmitRawMetricsData(data telemetry.RawMetrics)
- func (ch *TransactionalCheckHandler) SubmitRelation(instance topology.Instance, relation topology.Relation)
- func (ch *TransactionalCheckHandler) SubmitStartSnapshot(instance topology.Instance)
- func (ch *TransactionalCheckHandler) SubmitStopSnapshot(instance topology.Instance)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckAPI ¶
type CheckAPI interface { CheckTransactionalAPI CheckStateAPI CheckTopologyAPI CheckHealthAPI CheckTelemetryAPI CheckLifecycleAPI }
CheckAPI contains all the operations that can be done by an Agent Check. This acts as a proxy to forward data where it needs to go.
type CheckHandler ¶
type CheckHandler interface { CheckIdentifier CheckAPI Name() string GetConfig() (config, initConfig integration.Data) }
CheckHandler represents a wrapper around an Agent Check that allows us track data produced by an agent check, as well as handle transactions for it.
func MakeNonTransactionalCheckHandler ¶
func MakeNonTransactionalCheckHandler(check CheckIdentifier, config, initConfig integration.Data) CheckHandler
MakeNonTransactionalCheckHandler returns an instance of CheckHandler which functions as a fallback.
func NewTransactionalCheckHandler ¶
func NewTransactionalCheckHandler(check CheckIdentifier, config, initConfig integration.Data) CheckHandler
NewTransactionalCheckHandler creates a new check handler for a given check, check loader and configuration
type CheckHandlerBase ¶
type CheckHandlerBase struct { CheckIdentifier // contains filtered or unexported fields }
CheckHandlerBase forms the base of the transactional and non-transactional check handler
func (*CheckHandlerBase) GetConfig ¶
func (ch *CheckHandlerBase) GetConfig() (integration.Data, integration.Data)
GetConfig returns the config and the init config of the check
type CheckHealthAPI ¶
type CheckHealthAPI interface { SubmitHealthCheckData(stream health.Stream, data health.CheckData) SubmitHealthStartSnapshot(stream health.Stream, intervalSeconds int, expirySeconds int) SubmitHealthStopSnapshot(stream health.Stream) }
CheckHealthAPI contains all the health state operations for a check
type CheckIdentifier ¶
type CheckIdentifier interface { String() string // provide a printable version of the check name ID() check.ID // provide a unique identifier for every check instance ConfigSource() string // return the configuration source of the check }
CheckIdentifier encapsulates all the functionality needed to describe and configure an agent check.
func NewCheckIdentifier ¶
func NewCheckIdentifier(checkID check.ID) CheckIdentifier
NewCheckIdentifier returns a IDOnlyCheckIdentifier that implements the CheckIdentifier interface for a given check ID.
type CheckLifecycleAPI ¶
type CheckLifecycleAPI interface {
SubmitComplete()
}
CheckLifecycleAPI contains all the lifecylce operations for a check
type CheckManager ¶
type CheckManager struct {
// contains filtered or unexported fields
}
CheckManager acts as the grouping of check handlers and deals with the "lifecycle" of check handlers.
func GetCheckManager ¶
func GetCheckManager() *CheckManager
GetCheckManager returns a handle on the global check checkmanager Instance
func (*CheckManager) GetCheckHandler ¶
func (cm *CheckManager) GetCheckHandler(checkID check.ID) CheckHandler
GetCheckHandler returns a check handler (if found) for a given check ID
func (*CheckManager) MakeCheckHandlerTransactional ¶
func (cm *CheckManager) MakeCheckHandlerTransactional(checkID check.ID) CheckHandler
MakeCheckHandlerTransactional converts a non-transactional check handler to a transactional check handler
func (*CheckManager) RegisterCheckHandler ¶
func (cm *CheckManager) RegisterCheckHandler(check CheckIdentifier, config, initConfig integration.Data) CheckHandler
RegisterCheckHandler registers a check handler for the given check using a transactionbatcher for this instance
func (*CheckManager) Stop ¶
func (cm *CheckManager) Stop()
Stop clears the check handlers and re-initializes the singleton init
func (*CheckManager) UnsubscribeCheckHandler ¶
func (cm *CheckManager) UnsubscribeCheckHandler(checkID check.ID)
UnsubscribeCheckHandler removes a check handler for the given check
type CheckStateAPI ¶
CheckStateAPI contains all the state operations for a check
type CheckTelemetryAPI ¶
type CheckTelemetryAPI interface { SubmitRawMetricsData(data telemetry.RawMetrics) SubmitEvent(event metrics.Event) }
CheckTelemetryAPI contains all the telemetry operations for a check
type CheckTopologyAPI ¶
type CheckTopologyAPI interface { SubmitComponent(instance topology.Instance, component topology.Component) SubmitRelation(instance topology.Instance, relation topology.Relation) SubmitStartSnapshot(instance topology.Instance) SubmitStopSnapshot(instance topology.Instance) SubmitDelete(instance topology.Instance, topologyElementID string) }
CheckTopologyAPI contains all the topology operations for a check
type CheckTransactionalAPI ¶
type CheckTransactionalAPI interface { StartTransaction() string StopTransaction() DiscardTransaction(reason string) SetTransactionState(key, state string) }
CheckTransactionalAPI contains all the transactionality operations for a check
type Config ¶
type Config struct {
CheckTransactionalityEnabled bool
}
Config contains all the configuration values for the check manager
func GetCheckManagerConfig ¶
func GetCheckManagerConfig() Config
GetCheckManagerConfig returns the configuration for the checkmanager
type DiscardTransaction ¶
type DiscardTransaction struct {
Reason string
}
DiscardTransaction is used to cancel the current transaction, and reload the check
type IDOnlyCheckIdentifier ¶
type IDOnlyCheckIdentifier struct {
// contains filtered or unexported fields
}
IDOnlyCheckIdentifier is used to create a CheckIdentifier when only the checkID is present
func (*IDOnlyCheckIdentifier) ConfigSource ¶
func (*IDOnlyCheckIdentifier) ConfigSource() string
ConfigSource returns an empty string for the IDOnlyCheckIdentifier
func (*IDOnlyCheckIdentifier) ID ¶
func (idCI *IDOnlyCheckIdentifier) ID() check.ID
ID returns the IDOnlyCheckIdentifier checkID
func (*IDOnlyCheckIdentifier) String ¶
func (idCI *IDOnlyCheckIdentifier) String() string
String returns the IDOnlyCheckIdentifier checkID as a string
type NonTransactionalCheckHandler ¶
type NonTransactionalCheckHandler struct {
CheckHandlerBase
}
NonTransactionalCheckHandler is a wrapper for check that have no register handler.
func (*NonTransactionalCheckHandler) DiscardTransaction ¶
func (ch *NonTransactionalCheckHandler) DiscardTransaction(string)
DiscardTransaction logs a warning for the non-transactional check handler. This should never be called.
func (*NonTransactionalCheckHandler) GetState ¶
func (ch *NonTransactionalCheckHandler) GetState(key string) string
GetState returns a CheckState for a given key
func (*NonTransactionalCheckHandler) Name ¶
func (ch *NonTransactionalCheckHandler) Name() string
Name returns NonTransactionalCheckHandler for the non-transactional check handler
func (*NonTransactionalCheckHandler) SetState ¶
func (ch *NonTransactionalCheckHandler) SetState(key string, state string)
SetState is used to commit state for a given state key and CheckState
func (*NonTransactionalCheckHandler) SetTransactionState ¶
func (ch *NonTransactionalCheckHandler) SetTransactionState(string, string)
SetTransactionState logs a warning for the non-transactional check handler. This should never be called.
func (*NonTransactionalCheckHandler) StartTransaction ¶
func (ch *NonTransactionalCheckHandler) StartTransaction() string
StartTransaction "upgrades" the non-transactional check handler to a transactional check handler, registers it in the check manager and calls StartTransaction on the newly created transactional check handler.
func (*NonTransactionalCheckHandler) StopTransaction ¶
func (ch *NonTransactionalCheckHandler) StopTransaction()
StopTransaction logs a warning for the non-transactional check handler. This should never be called.
func (*NonTransactionalCheckHandler) SubmitComplete ¶
func (ch *NonTransactionalCheckHandler) SubmitComplete()
SubmitComplete submits a complete to the Global Batcher.
func (*NonTransactionalCheckHandler) SubmitComponent ¶
func (ch *NonTransactionalCheckHandler) SubmitComponent(instance topology.Instance, component topology.Component)
SubmitComponent submits a component to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitDelete ¶
func (ch *NonTransactionalCheckHandler) SubmitDelete(instance topology.Instance, topologyElementID string)
SubmitDelete submits a topology element delete to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitEvent ¶
func (ch *NonTransactionalCheckHandler) SubmitEvent(event metrics.Event)
SubmitEvent submits an event to the forwarder.
func (*NonTransactionalCheckHandler) SubmitHealthCheckData ¶
func (ch *NonTransactionalCheckHandler) SubmitHealthCheckData(stream health.Stream, data health.CheckData)
SubmitHealthCheckData submits health check data to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitHealthStartSnapshot ¶
func (ch *NonTransactionalCheckHandler) SubmitHealthStartSnapshot(stream health.Stream, intervalSeconds int, expirySeconds int)
SubmitHealthStartSnapshot submits a health start snapshot to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitHealthStopSnapshot ¶
func (ch *NonTransactionalCheckHandler) SubmitHealthStopSnapshot(stream health.Stream)
SubmitHealthStopSnapshot submits a health stop snapshot to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitRawMetricsData ¶
func (ch *NonTransactionalCheckHandler) SubmitRawMetricsData(data telemetry.RawMetrics)
SubmitRawMetricsData submits a raw metric value to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitRelation ¶
func (ch *NonTransactionalCheckHandler) SubmitRelation(instance topology.Instance, relation topology.Relation)
SubmitRelation submits a relation to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitStartSnapshot ¶
func (ch *NonTransactionalCheckHandler) SubmitStartSnapshot(instance topology.Instance)
SubmitStartSnapshot submits a start snapshot to the Global Batcher to be batched.
func (*NonTransactionalCheckHandler) SubmitStopSnapshot ¶
func (ch *NonTransactionalCheckHandler) SubmitStopSnapshot(instance topology.Instance)
SubmitStopSnapshot submits a stop snapshot to the Global Batcher to be batched.
type StartTransaction ¶
StartTransaction is used to start a transaction to the input channel
type StopTransaction ¶
type StopTransaction struct{}
StopTransaction is used to stop the current transaction
type SubmitComplete ¶
type SubmitComplete struct{}
SubmitComplete is used to submit a check complete for the current transaction
type SubmitComponent ¶
SubmitComponent is used to submit a topology component for the current transaction
type SubmitDelete ¶
SubmitDelete is used to submit a topology delete for the current transaction
type SubmitEvent ¶
SubmitEvent is used to submit an event for the current transaction
type SubmitHealthCheckData ¶
SubmitHealthCheckData is used to submit a health check data for the current transaction
type SubmitHealthStartSnapshot ¶
SubmitHealthStartSnapshot is used to submit a health start snapshot for the current transaction
type SubmitHealthStopSnapshot ¶
SubmitHealthStopSnapshot is used to submit a health stop snapshot for the current transaction
type SubmitRawMetric ¶
type SubmitRawMetric struct {
Value telemetry.RawMetrics
}
SubmitRawMetric is used to submit a raw metric value for the current transaction
type SubmitRelation ¶
SubmitRelation is used to submit a topology relation for the current transaction
type SubmitSetTransactionState ¶
type SubmitSetTransactionState struct {
Key, State string
}
SubmitSetTransactionState is used to submit a set state transactional for the current transaction
type SubmitStartSnapshot ¶
SubmitStartSnapshot is used to submit a topology start snapshot for the current transaction
type SubmitStopSnapshot ¶
SubmitStopSnapshot is used to submit a topology stop snapshot for the current transaction
type TransactionalCheckHandler ¶
type TransactionalCheckHandler struct { CheckHandlerBase // contains filtered or unexported fields }
TransactionalCheckHandler provides an interface between the Agent Check and the transactional components.
func (*TransactionalCheckHandler) DiscardTransaction ¶
func (ch *TransactionalCheckHandler) DiscardTransaction(reason string)
DiscardTransaction triggers a transaction failure and reloads the check
func (*TransactionalCheckHandler) GetCurrentTransaction ¶
func (ch *TransactionalCheckHandler) GetCurrentTransaction() string
GetCurrentTransaction returns ch.currentTransaction with a mutex read lock
func (*TransactionalCheckHandler) GetState ¶
func (ch *TransactionalCheckHandler) GetState(key string) string
GetState returns a CheckState for a given key
func (*TransactionalCheckHandler) Name ¶
func (ch *TransactionalCheckHandler) Name() string
Name returns TransactionalCheckHandler for the transactional check handler
func (*TransactionalCheckHandler) SetState ¶
func (ch *TransactionalCheckHandler) SetState(key string, state string)
SetState is used to commit state for a given state key and CheckState
func (*TransactionalCheckHandler) SetTransactionState ¶
func (ch *TransactionalCheckHandler) SetTransactionState(key string, state string)
SetTransactionState is used to set state transactionaly. This state is only committed once a transaction has been completed successfully.
func (*TransactionalCheckHandler) Start ¶
func (ch *TransactionalCheckHandler) Start()
Start starts the check handler to "listen" and handle check transactions or shutdown
func (*TransactionalCheckHandler) StartTransaction ¶
func (ch *TransactionalCheckHandler) StartTransaction() string
StartTransaction submits a start transaction for the check handler. This blocks any future transactions until this one completes, fails or is timed out.
func (*TransactionalCheckHandler) Stop ¶
func (ch *TransactionalCheckHandler) Stop()
Stop stops the check handler txReceiverHandler
func (*TransactionalCheckHandler) StopTransaction ¶
func (ch *TransactionalCheckHandler) StopTransaction()
StopTransaction submits a complete to the Transactional Batcher, to send the final payload of the transaction and mark the current transaction as complete.
func (*TransactionalCheckHandler) SubmitComplete ¶
func (ch *TransactionalCheckHandler) SubmitComplete()
SubmitComplete submits a complete to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitComponent ¶
func (ch *TransactionalCheckHandler) SubmitComponent(instance topology.Instance, component topology.Component)
SubmitComponent submits a component to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitDelete ¶
func (ch *TransactionalCheckHandler) SubmitDelete(instance topology.Instance, topologyElementID string)
SubmitDelete submits a topology element delete to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitEvent ¶
func (ch *TransactionalCheckHandler) SubmitEvent(event metrics.Event)
SubmitEvent submits an event to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitHealthCheckData ¶
func (ch *TransactionalCheckHandler) SubmitHealthCheckData(stream health.Stream, data health.CheckData)
SubmitHealthCheckData submits health check data to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitHealthStartSnapshot ¶
func (ch *TransactionalCheckHandler) SubmitHealthStartSnapshot(stream health.Stream, intervalSeconds int, expirySeconds int)
SubmitHealthStartSnapshot submits a health start snapshot to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitHealthStopSnapshot ¶
func (ch *TransactionalCheckHandler) SubmitHealthStopSnapshot(stream health.Stream)
SubmitHealthStopSnapshot submits a health stop snapshot to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitRawMetricsData ¶
func (ch *TransactionalCheckHandler) SubmitRawMetricsData(data telemetry.RawMetrics)
SubmitRawMetricsData submits a raw metric value to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitRelation ¶
func (ch *TransactionalCheckHandler) SubmitRelation(instance topology.Instance, relation topology.Relation)
SubmitRelation submits a relation to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitStartSnapshot ¶
func (ch *TransactionalCheckHandler) SubmitStartSnapshot(instance topology.Instance)
SubmitStartSnapshot submits a start snapshot to the current transaction channel to be forwarded.
func (*TransactionalCheckHandler) SubmitStopSnapshot ¶
func (ch *TransactionalCheckHandler) SubmitStopSnapshot(instance topology.Instance)
SubmitStopSnapshot submits a stop snapshot to the current transaction channel to be forwarded.