Documentation ¶
Overview ¶
Package prommer contains Prommer core implementation details.
Prommer is a target/service discovery system for Prometheus using Docker. It achieves this by listening to the Docker events stream, fetching containers using the Docker Engine API (https://github.com/docker/engine-api), and writing configuration files to Prometheus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindPortFromContainer ¶
func FindPortFromContainer(c dockertypes.Container, options *FindPortOptions) int
FindPortFromContainer attempts to find the correct port from the container
Types ¶
type EventMonitor ¶
type EventMonitor struct {
// contains filtered or unexported fields
}
EventMonitor monitors the Docker event stream
type FindPort ¶
type FindPort func(dockertypes.Container, *FindPortOptions) int
FindPort finds a port for a container
type FindPortOptions ¶
type FindPortOptions struct {
Label *string
}
FindPortOptions holds the optional parameters for FindPort
type PrometheusMonitor ¶
type PrometheusMonitor struct {
// contains filtered or unexported fields
}
PrometheusMonitor
func NewPrometheusMonitor ¶
func NewPrometheusMonitor(targetFilePath string) (*PrometheusMonitor, error)
NewPrometheusMonitor initializes a new PrometheusMonitor
func (*PrometheusMonitor) Monitor ¶
func (m *PrometheusMonitor) Monitor(services []*Service)
Monitor the given services. The target group configuration is updated and overrides the old configuration
type Prommer ¶
type Prommer struct { Options *PrommerOptions // contains filtered or unexported fields }
Prommer
func CreatePrommer ¶
func CreatePrommer(options *PrommerOptions) *Prommer
CreatePrommer creates a new instance of Prommer
type PrommerOptions ¶
type ServiceProvider ¶
type ServiceProvider struct {
// contains filtered or unexported fields
}
ServiceProvider provides the services to be monitored
func CreateServiceProvider ¶
func CreateServiceProvider(cli *client.Client, monitoringLabel string) (*ServiceProvider, error)
CreateServiceProvider creates a new instance of service provider Returns error if the client or monitoringLabel is nil
func (*ServiceProvider) GetServices ¶
func (sp *ServiceProvider) GetServices() ([]*Service, error)
GetServices returns the