prometheus

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Overview

Package prometheus provides a set of utilities for assisting with Prometheus data

Package prometheus provides a set of utilities for assisting with Prometheus data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnabled

func IsEnabled() bool

IsEnabled returns true if prometheus is enabled

Types

type Option added in v1.14.4

type Option func(s *Server)

Option is an option pattern for prometheus server

func WithCertificateMonitoring added in v1.14.4

func WithCertificateMonitoring(monitorCert bool) Option

WithCertificateMonitoring enables monitoring for certificate renewals

func WithCustomCA added in v1.14.4

func WithCustomCA(caFile string) Option

WithCustomCA sets the CA file to use for mTLS

func WithCustomCert added in v1.14.4

func WithCustomCert(certFile, keyFile string) Option

WithCustomCert sets the certificate and key to use for TLS

func WithHeaderTimeout added in v1.14.4

func WithHeaderTimeout(headerTimeout time.Duration) Option

WithHeaderTimeout sets the header timeout for the prometheus server

func WithMaxBindThreshold added in v1.15.0

func WithMaxBindThreshold(maxBindThreshold time.Duration) Option

WithMaxBindThreshold sets the maximum threshold for binding retries

type Server added in v1.14.4

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

Server is a server type for exposing Prometheus metrics

func NewServer added in v1.14.4

func NewServer(listenOn string, options ...Option) *Server

NewServer creates a new prometheus server instance

func (*Server) ListenAndServe added in v1.14.4

func (s *Server) ListenAndServe(ctx context.Context, cancel context.CancelFunc)

ListenAndServe gathers the certificate and initiates the Server to begin handling incoming requests

Jump to

Keyboard shortcuts

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