prommer

package
v0.0.5-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2016 License: GPL-3.0 Imports: 18 Imported by: 0

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

func (*EventMonitor) Start

func (m *EventMonitor) Start() error

Start monitoring

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 Instance

type Instance struct {
	HostIP   string
	HostPort string
}

Instance of a Service

type Monitor

type Monitor interface {
	Monitor(services []*Service)
}

Monitor interface

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

func (*Prommer) Start

func (p *Prommer) Start()

Start Prommer

func (*Prommer) Stop

func (p *Prommer) Stop()

type PrommerOptions

type PrommerOptions struct {
	TargetFilePath  string
	MonitoringLabel string
}

type Service

type Service struct {
	Name      string
	Instances []*Instance
}

Service to be monitored

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL