prometheus

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

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).

Jump to

Keyboard shortcuts

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