exporter

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricPath             = utils.StrOrDef(os.Getenv("METRIC_PATH"), "/metrics")
	IncludeExporterMetrics = false
	MaxRequests            = 40
)
View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func GetInitiatedCollectors

func GetInitiatedCollectors() map[string]Collector

func IsNoDataError

func IsNoDataError(err error) bool

func NewApplicationCollector

func NewApplicationCollector(cli *argo.Client) func(_ *log.Logger) (Collector, error)

func NewCertCollectorFunc

func NewCertCollectorFunc() func(*log.Logger) (Collector, error)

func NewClusterCollector

func NewClusterCollector(agents *agents.ClientSet, db *database.Database) func(_ *log.Logger) (Collector, error)

func NewEnvironmentCollector

func NewEnvironmentCollector(db *database.Database) func(_ *log.Logger) (Collector, error)

func NewPluginCollectorFunc

func NewPluginCollectorFunc(cluster cluster.Interface) func(*log.Logger) (Collector, error)

Types

type ApplicationCollector

type ApplicationCollector struct {
	*argo.Client
	// contains filtered or unexported fields
}

func (*ApplicationCollector) Update

func (c *ApplicationCollector) Update(ch chan<- prometheus.Metric) error

type BaseCollector

type BaseCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

BaseCollector implements the prometheus.Collector interface.

func (BaseCollector) Collect

func (n BaseCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (BaseCollector) Describe

func (n BaseCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type CertCollector

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

func (*CertCollector) Update

func (c *CertCollector) Update(ch chan<- prometheus.Metric) error

type ClusterCollector

type ClusterCollector struct {
	*database.Database
	// contains filtered or unexported fields
}

func (*ClusterCollector) Update

func (c *ClusterCollector) Update(ch chan<- prometheus.Metric) error

type Collector

type Collector interface {
	// Get new metrics and expose them via prometheus registry.
	Update(ch chan<- prometheus.Metric) error
}

Collector is the interface a collector has to implement.

func NewCertCollector

func NewCertCollector(_ *log.Logger) (Collector, error)

func NewPluginCollector

func NewPluginCollector(_ *log.Logger, clus cluster.Interface) (Collector, error)

type Collectorfunc

type Collectorfunc func(logger *log.Logger) (Collector, error)

func NewRequestCollector

func NewRequestCollector() Collectorfunc

func NewUserCollector

func NewUserCollector(db *database.Database) Collectorfunc

type EnvironmentCollector

type EnvironmentCollector struct {
	*database.Database
	// contains filtered or unexported fields
}

func (*EnvironmentCollector) Update

func (c *EnvironmentCollector) Update(ch chan<- prometheus.Metric) error

type Handler

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

Handler wraps an unfiltered http.Handler but uses a filtered Handler, created on the fly, if filtering is requested. Create instances with newHandler.

func NewHandler

func NewHandler(namespace string, collectors map[string]Collectorfunc) *Handler

func (*Handler) Run

func (h *Handler) Run(ctx context.Context, opts *gempro.ExporterOptions) error

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type PluginCollector

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

func (*PluginCollector) Update

func (c *PluginCollector) Update(ch chan<- prometheus.Metric) error

type RequestCollector

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

func GetRequestCollector

func GetRequestCollector() *RequestCollector

func (*RequestCollector) HandlerFunc

func (rc *RequestCollector) HandlerFunc() gin.HandlerFunc

func (*RequestCollector) Update

func (rc *RequestCollector) Update(ch chan<- prometheus.Metric) error

Update implements Collector

type UserCollector

type UserCollector struct {
	*database.Database
	// contains filtered or unexported fields
}

func (*UserCollector) Update

func (c *UserCollector) Update(ch chan<- prometheus.Metric) error

Jump to

Keyboard shortcuts

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