prometheus

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoIgnoreConfig = errors.New("prometheus config has no factum-if-ignore marker")

ErrNoIgnoreConfig means none of the scrape configs next to the file_sd file contain the factum-if-ignore markers.

Functions

func CompileIgnoreInterfaces added in v1.6.0

func CompileIgnoreInterfaces(list string) (string, error)

CompileIgnoreInterfaces checks list and returns the single expression written into the scrape config. An empty list returns "".

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 InstallIgnoreInterfaces added in v1.6.0

func InstallIgnoreInterfaces(destFile, list string) (path string, changed bool, err error)

InstallIgnoreInterfaces compiles list and rewrites the first writable scrape config next to destFile that contains the markers. changed is false when the block was already up to date.

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(root *util.ConfigAgentRoot) (*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