prometheus

package
v0.0.0-...-8eefd04 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace         = "image_builder"
	ComposerSubsystem = "composer"
	WorkerSubsystem   = "worker"
)

Variables

View Source
var (
	ComposeRequests = promauto.NewCounter(prometheus.CounterOpts{
		Name:      "total_compose_requests",
		Namespace: Namespace,
		Subsystem: ComposerSubsystem,
		Help:      "total number of compose requests made to osbuild-composer",
	})
)
View Source
var (
	JobDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "job_duration_seconds",
		Namespace: Namespace,
		Subsystem: WorkerSubsystem,
		Help:      "Duration spent by workers on a job.",
		Buckets:   []float64{.1, .2, .5, 1, 2.5, 5, 10, 20, 30, 40, 60, 90, 120, 150, 180, 240, 300, 360, 420, 480, 540, 600, 720, 840, 960, 1080, 1200, 1320, 1440, 1560, 1680, 1800, 2100, 2400, 2700, 3000, 3600, 4800, 6000, 7200, 9000, 10800, 12600, 14400, 16200, 18000, 19800, 24000, 27000, 30000, 33000, 36000, 39600, 43200, 57600, 86400},
	}, []string{"type", "status", "tenant", "arch"})
)
View Source
var (
	JobWaitDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "job_wait_duration_seconds",
		Namespace: Namespace,
		Subsystem: WorkerSubsystem,
		Help:      "Duration a job spends on the queue.",
		Buckets:   []float64{.1, .2, .5, 1, 2.5, 5, 10, 20, 30, 40, 60, 90, 120, 150, 180, 240, 300, 360, 420, 480, 540, 600, 720, 840, 960, 1080, 1200, 1320, 1440, 1560, 1680, 1800, 2100, 2400, 2700, 3000, 3600, 4800, 6000, 7200, 9000, 10800, 12600, 14400, 16200, 18000, 19800, 24000, 27000, 30000, 33000, 36000, 39600, 43200, 57600, 86400},
	}, []string{"type", "tenant", "arch"})
)
View Source
var (
	PendingJobs = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "pending_jobs",
		Namespace: Namespace,
		Subsystem: WorkerSubsystem,
		Help:      "Currently pending jobs",
	}, []string{"type", "tenant"})
)
View Source
var (
	RunningJobs = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "running_jobs",
		Namespace: Namespace,
		Subsystem: WorkerSubsystem,
		Help:      "Currently running jobs",
	}, []string{"type", "tenant"})
)
View Source
var (
	TotalJobs = promauto.NewCounterVec(prometheus.CounterOpts{
		Name:      "total_jobs",
		Namespace: Namespace,
		Subsystem: WorkerSubsystem,
		Help:      "Total jobs",
	}, []string{"type", "status", "tenant", "arch"})
)
View Source
var (
	TotalRequests = promauto.NewCounter(prometheus.CounterOpts{
		Name:      "total_requests",
		Namespace: Namespace,
		Subsystem: ComposerSubsystem,
		Help:      "total number of http requests made to osbuild-composer",
	})
)

Functions

func CancelJobMetrics

func CancelJobMetrics(started time.Time, jobType, tenant string)

func DequeueJobMetrics

func DequeueJobMetrics(pending time.Time, started time.Time, jobType, tenant, arch string)

func EnqueueJobMetrics

func EnqueueJobMetrics(jobType, tenant string)

func FinishJobMetrics

func FinishJobMetrics(started time.Time, finished time.Time, canceled bool, jobType, tenant, arch string, status clienterrors.StatusCode)

func HTTPDurationHisto

func HTTPDurationHisto(subsystem string) *prometheus.HistogramVec

func HTTPDurationMiddleware

func HTTPDurationMiddleware(subsystem string) func(next echo.HandlerFunc) echo.HandlerFunc

func MetricsMiddleware

func MetricsMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func RequeueJobMetrics

func RequeueJobMetrics(jobType, tenant string)

func StatusMiddleware

func StatusMiddleware(subsystem string) func(next echo.HandlerFunc) echo.HandlerFunc

func StatusRequestsCounter

func StatusRequestsCounter(subsystem string) *prometheus.CounterVec

Types

This section is empty.

Jump to

Keyboard shortcuts

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