Documentation ¶
Index ¶
- Variables
- func ComputeContainerServiceIDs(entity string, image string, labels map[string]string) []string
- func Register(name string, factory ServiceListenerFactory)
- type ContainerPort
- type EnvironmentListener
- type EnvironmentService
- func (s *EnvironmentService) GetADIdentifiers() ([]string, error)
- func (s *EnvironmentService) GetCheckNames() []string
- func (s *EnvironmentService) GetCreationTime() integration.CreationTime
- func (s *EnvironmentService) GetEntity() string
- func (s *EnvironmentService) GetExtraConfig(key []byte) ([]byte, error)
- func (s *EnvironmentService) GetHostname() (string, error)
- func (s *EnvironmentService) GetHosts() (map[string]string, error)
- func (s *EnvironmentService) GetPid() (int, error)
- func (s *EnvironmentService) GetPorts() ([]ContainerPort, error)
- func (s *EnvironmentService) GetTaggerEntity() string
- func (s *EnvironmentService) GetTags() ([]string, string, error)
- func (s *EnvironmentService) HasFilter(filter containers.FilterType) bool
- func (s *EnvironmentService) IsReady() bool
- type SNMPListener
- type SNMPService
- func (s *SNMPService) GetADIdentifiers() ([]string, error)
- func (s *SNMPService) GetCheckNames() []string
- func (s *SNMPService) GetCreationTime() integration.CreationTime
- func (s *SNMPService) GetEntity() string
- func (s *SNMPService) GetExtraConfig(key []byte) ([]byte, error)
- func (s *SNMPService) GetHostname() (string, error)
- func (s *SNMPService) GetHosts() (map[string]string, error)
- func (s *SNMPService) GetPid() (int, error)
- func (s *SNMPService) GetPorts() ([]ContainerPort, error)
- func (s *SNMPService) GetTaggerEntity() string
- func (s *SNMPService) GetTags() ([]string, string, error)
- func (s *SNMPService) HasFilter(filter containers.FilterType) bool
- func (s *SNMPService) IsReady() bool
- type Service
- type ServiceListener
- type ServiceListenerFactory
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupported = errors.New("AD: variable not supported by listener")
ErrNotSupported is thrown if listener doesn't support the asked variable
var ServiceListenerFactories = make(map[string]ServiceListenerFactory)
ServiceListenerFactories holds the registered factories
Functions ¶
func ComputeContainerServiceIDs ¶
ComputeContainerServiceIDs takes an entity name, an image (resolved to an actual name) and labels and computes the service IDs for this container service.
func Register ¶
func Register(name string, factory ServiceListenerFactory)
Register registers a service listener factory
Types ¶
type ContainerPort ¶
ContainerPort represents a network port in a Service.
type EnvironmentListener ¶ added in v0.9.0
type EnvironmentListener struct {
// contains filtered or unexported fields
}
EnvironmentListener implements a ServiceListener based on current environment
func (*EnvironmentListener) Listen ¶ added in v0.9.0
func (l *EnvironmentListener) Listen(newSvc chan<- Service, delSvc chan<- Service)
Listen starts the goroutine to detect checks based on environment
func (*EnvironmentListener) Stop ¶ added in v0.9.0
func (l *EnvironmentListener) Stop()
Stop has nothing to do in this case
type EnvironmentService ¶ added in v0.9.0
type EnvironmentService struct {
// contains filtered or unexported fields
}
EnvironmentService represents services generated from EnvironmentListener
func (*EnvironmentService) GetADIdentifiers ¶ added in v0.9.0
func (s *EnvironmentService) GetADIdentifiers() ([]string, error)
GetADIdentifiers return the single AD identifier for an environment service
func (*EnvironmentService) GetCheckNames ¶ added in v0.9.0
func (s *EnvironmentService) GetCheckNames() []string
GetCheckNames is not supported
func (*EnvironmentService) GetCreationTime ¶ added in v0.9.0
func (s *EnvironmentService) GetCreationTime() integration.CreationTime
GetCreationTime is always before for environment service
func (*EnvironmentService) GetEntity ¶ added in v0.9.0
func (s *EnvironmentService) GetEntity() string
GetEntity returns the unique entity name linked to that service
func (*EnvironmentService) GetExtraConfig ¶ added in v0.9.0
func (s *EnvironmentService) GetExtraConfig(key []byte) ([]byte, error)
GetExtraConfig is not supported
func (*EnvironmentService) GetHostname ¶ added in v0.9.0
func (s *EnvironmentService) GetHostname() (string, error)
GetHostname returns nil and an error because port is not supported in this listener
func (*EnvironmentService) GetHosts ¶ added in v0.9.0
func (s *EnvironmentService) GetHosts() (map[string]string, error)
GetHosts is not supported
func (*EnvironmentService) GetPid ¶ added in v0.9.0
func (s *EnvironmentService) GetPid() (int, error)
GetPid inspect the container and return its pid Not relevant in this listener
func (*EnvironmentService) GetPorts ¶ added in v0.9.0
func (s *EnvironmentService) GetPorts() ([]ContainerPort, error)
GetPorts returns nil and an error because port is not supported in this listener
func (*EnvironmentService) GetTaggerEntity ¶ added in v0.9.0
func (s *EnvironmentService) GetTaggerEntity() string
GetTaggerEntity returns the tagger entity
func (*EnvironmentService) GetTags ¶ added in v0.9.0
func (s *EnvironmentService) GetTags() ([]string, string, error)
GetTags retrieves a container's tags
func (*EnvironmentService) HasFilter ¶ added in v0.9.0
func (s *EnvironmentService) HasFilter(filter containers.FilterType) bool
HasFilter is not supported
func (*EnvironmentService) IsReady ¶ added in v0.9.0
func (s *EnvironmentService) IsReady() bool
IsReady is always true
type SNMPListener ¶
SNMPListener implements SNMP discovery
func (*SNMPListener) Listen ¶
func (l *SNMPListener) Listen(newSvc chan<- Service, delSvc chan<- Service)
Listen periodically refreshes devices
type SNMPService ¶
type SNMPService struct {
// contains filtered or unexported fields
}
SNMPService implements and store results from the Service interface for the SNMP listener
func (*SNMPService) GetADIdentifiers ¶
func (s *SNMPService) GetADIdentifiers() ([]string, error)
GetADIdentifiers returns a set of AD identifiers
func (*SNMPService) GetCheckNames ¶
func (s *SNMPService) GetCheckNames() []string
GetCheckNames returns nil
func (*SNMPService) GetCreationTime ¶
func (s *SNMPService) GetCreationTime() integration.CreationTime
GetCreationTime returns the creation time of the Service
func (*SNMPService) GetEntity ¶
func (s *SNMPService) GetEntity() string
GetEntity returns the unique entity ID linked to that service
func (*SNMPService) GetExtraConfig ¶
func (s *SNMPService) GetExtraConfig(key []byte) ([]byte, error)
GetExtraConfig returns data from configuration
func (*SNMPService) GetHostname ¶
func (s *SNMPService) GetHostname() (string, error)
GetHostname returns nothing - not supported
func (*SNMPService) GetHosts ¶
func (s *SNMPService) GetHosts() (map[string]string, error)
GetHosts returns the device IP
func (*SNMPService) GetPid ¶
func (s *SNMPService) GetPid() (int, error)
GetPid returns nil and an error because pids are currently not supported
func (*SNMPService) GetPorts ¶
func (s *SNMPService) GetPorts() ([]ContainerPort, error)
GetPorts returns the device port
func (*SNMPService) GetTaggerEntity ¶
func (s *SNMPService) GetTaggerEntity() string
GetTaggerEntity returns the unique entity ID linked to that service
func (*SNMPService) GetTags ¶
func (s *SNMPService) GetTags() ([]string, string, error)
GetTags returns the list of container tags - currently always empty
func (*SNMPService) HasFilter ¶
func (s *SNMPService) HasFilter(filter containers.FilterType) bool
HasFilter returns false on SNMP
type Service ¶
type Service interface { GetEntity() string // unique entity name GetTaggerEntity() string // tagger entity name GetADIdentifiers() ([]string, error) // identifiers on which templates will be matched GetHosts() (map[string]string, error) // network --> IP address GetPorts() ([]ContainerPort, error) // network ports GetTags() ([]string, string, error) // tags and tags hash GetPid() (int, error) // process identifier GetHostname() (string, error) // hostname.domainname for the entity GetCreationTime() integration.CreationTime // created before or after the agent start IsReady() bool // is the service ready GetCheckNames() []string // slice of check names defined in kubernetes annotations or docker labels HasFilter(containers.FilterType) bool // whether the service is excluded by metrics or logs exclusion config GetExtraConfig([]byte) ([]byte, error) // Extra configuration values }
Service represents an application we can run a check against. It should be matched with a check template by the ConfigResolver using the ADIdentifiers field.
type ServiceListener ¶
type ServiceListener interface { Listen(newSvc, delSvc chan<- Service) Stop() }
ServiceListener monitors running services and triggers check (un)scheduling
It holds a cache of running services, listens to new/killed services and updates its cache, and the AutoConfig with these events.
func NewEnvironmentListener ¶ added in v0.9.0
func NewEnvironmentListener() (ServiceListener, error)
NewEnvironmentListener creates an EnvironmentListener
func NewSNMPListener ¶
func NewSNMPListener() (ServiceListener, error)
NewSNMPListener creates a SNMPListener
type ServiceListenerFactory ¶
type ServiceListenerFactory func() (ServiceListener, error)
ServiceListenerFactory builds a service listener