hubble

module
v0.0.0-...-d591cd7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2017 License: MIT

README

Hubble service discovery

GoDoc Build Status codecov

Hubble is the alternative service discovery for Prometheus. Consul is the only one supported backend.

Example usage:

config := consul.DefaultConfig()
config.Address = *consulURL
config.Datacenter = *consulDC

client, err := consul.New(config)
if err != nil {
    panic(err)
}

kv := consul.NewKV(client)
h := hubble.New(client, kv, *consulTag)

// Filter services by any criteria, e.g. by consul tag.
filterCB := func(list []*hubble.Service) []*hubble.Service {
    var servicesForMonitoring []*hubble.Service
    for _, svc := range list {
        if util.IncludesStr(svc.Tags, *consulTag) {
            servicesForMonitoring = append(servicesForMonitoring, svc)
        }
    }
    return servicesForMonitoring
}

list := h.Services(filterCB)

Consul KV keeps json object contains parameters could be used to automatically enable collecting metric for the service.

Path mask: monitoring/$service/$exporter_name

E.g it can be useful for Alertmanager rules or any other parameters.

Example:

{
    "notifiable": true,
    "extra_labels": {"env": "staging"},
    "exporter_options": {"password": "123456"}
}

Exportertools

Quickly creating custom thread-safe prometheus exporters with SD and cache.

Directories

Path Synopsis
backend
mock

Jump to

Keyboard shortcuts

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