Documentation ¶
Index ¶
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 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, error) // tags 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 }
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.
type ServiceListenerFactory ¶
type ServiceListenerFactory func() (ServiceListener, error)
ServiceListenerFactory builds a service listener