pushgateway

package
v0.0.0-...-fcfcbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 6 Imported by: 2

README

Prometheus Pushgateway

Sometimes we need to monitor components which cannot be scraped. Examples: CLI processes and task drivers.

Prometheus recommends using the Prometheus Pushgateway for pushing time series from short-lived service-level batch jobs.

The Prometheus Pushgateway exists to allow ephemeral and batch jobs to expose their metrics to Prometheus. Since these kinds of jobs may not exist long enough to be scraped, they can instead push their metrics to a Pushgateway. The Pushgateway then exposes these metrics to Prometheus.

k8s service

Skia runs a pushgateway service in k8s. The service runs with an auth-proxy container to provide authentication to the pushgateway container ports. The pushgateway container also specifies a persistence.file to persist metrics across container restarts.

The service is hosted at pushgateway.skia.org

pushgateway.go

Contains convenience methods for interacting with Skia's pushgateway service.

Documentation

Index

Constants

View Source
const (
	DefaultPushgatewayURL = "https://pushgateway.skia.org"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pushgateway

type Pushgateway struct {
	// contains filtered or unexported fields
}

Pushgateway is an object used for interacting with the prom pushgateway.

func New

func New(client *http.Client, jobName, url string) *Pushgateway

New returns an instantiated Pushgateway. If url is not specified then DefaultPushgatewayURL is used.

func (*Pushgateway) Push

func (p *Pushgateway) Push(ctx context.Context, metricName, metricValue string) error

Push pushes the specified metric name and value to the pushgateway.

Jump to

Keyboard shortcuts

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