locator

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: MIT Imports: 12 Imported by: 8

Documentation

Overview

Package locator implements discovery mechanism for etcd clusters

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabeledValue

type LabeledValue struct {
	Name   string
	Labels string
	Value  float64
}

LabeledValue represents a persed metric instance

func ScrapeMetric

func ScrapeMetric(addr string, name string) (*LabeledValue, error)

ScrapeMetric parses metrics in a simple fashion, returning the first instance of each metric for a given name; results may be unexpected for metrics with multiple instances

func (*LabeledValue) String

func (lv *LabeledValue) String() string

type Locator

type Locator interface {

	// Endpoints provides a list of candidate prometheus endpoints
	Endpoints() ([]*PrometheusEndpoint, error)
}

Locator is a pluggable interface for locating prometheus endpoints

func NewEndpointsFileLocator

func NewEndpointsFileLocator(endpointsFile string) Locator

NewEndpointsFileLocator returns a new Locator which reads a set of endpoints from a file path, one endpoint per line

type PrometheusEndpoint

type PrometheusEndpoint struct {
	QueryAPI              prometheus.QueryAPI
	Error                 error
	Uptime                time.Duration
	Selected              bool
	Address               string
	ComparisonMetricValue interface{}
}

PrometheusEndpoint encapsulates a QueryAPI instance and its associated address

func ToPrometheusClients

func ToPrometheusClients(endpointURLs []string) ([]*PrometheusEndpoint, error)

ToPrometheusClients generates prometheus Client objects from a provided list of URLs

func (*PrometheusEndpoint) String

func (pe *PrometheusEndpoint) String() string

func (*PrometheusEndpoint) Viable added in v0.2.2

func (pe *PrometheusEndpoint) Viable() bool

Viable returns true if the endpoint is able to respond to basic query API requests within a reasonable time

Directories

Path Synopsis
Package kuberneteslocator implements prometheus location for kubernetes deployments
Package kuberneteslocator implements prometheus location for kubernetes deployments
Package marathonlocator implements prometheus discovery for marathon deployments
Package marathonlocator implements prometheus discovery for marathon deployments

Jump to

Keyboard shortcuts

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