Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchRemoteConfig ¶
func FetchRemoteConfig(factumConfig *util.ConfigFactum) (*util.ConfigPrometheus, error)
FetchRemoteConfig pulls the Prometheus/snmp_exporter sync settings from the primary, authenticated with factumConfig.Token (checked against the primary's Settings.FactumApiToken - see web.Controller.checkServiceToken).
func NewPrometheusClient ¶
func NewPrometheusClient(c util.ConfigPrometheus) *prometheusClient
Types ¶
type FactumPrometheusClient ¶
type FactumPrometheusClient struct {
Config *util.ConfigFactum
PrometheusConfig *util.ConfigPrometheus
Prometheus *prometheusClient
}
func NewFactumPrometheusClient ¶
func NewFactumPrometheusClient(config *util.ConfigFactum) (*FactumPrometheusClient, error)
NewFactumPrometheusClient fetches the Prometheus/snmp_exporter sync settings from the primary over REST - config.Prometheus is never used, since factum2-prometheus typically runs on a different host than the primary and has no local prometheus config of its own (see util.ConfigPrometheus's doc comment).
func (*FactumPrometheusClient) Sync ¶
func (fpc *FactumPrometheusClient) Sync(reporter jobevent.Reporter) error
Sync fetches devices from the Factum API, filters out those that shouldn't be scraped, writes Prometheus file_sd JSON, and asks Prometheus to reload if anything changed (and a reload URL is configured).