monitoring

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Interface definitions

Index

Constants

View Source
const (
	// IDPathRegex regexp used to swap the {id*} parameters in the path with simply id
	// supports alphabetic characters and underscores, no dashes
	IDPathRegex string = "{[a-zA-Z_]*}"
)

Variables

This section is empty.

Functions

func NewBlueprint

func NewBlueprint() webiface.BlueprintInterface

NewBlueprint returns a new initialized Blueprint object.

Types

type Blueprint

type Blueprint struct{}

func (*Blueprint) Routes

func (bp *Blueprint) Routes(router *mux.Router)

Routes exposes the /api/v1/metrics endpoint for prometheus to scrape

type Middleware

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

Middleware is the monitoring middleware object implementing Prometheus monitoring

func (Middleware) APICount

func (mdw Middleware) APICount() mux.MiddlewareFunc

APICount increments a http_api_count metric on Prometheus

func (Middleware) APITime

func (mdw Middleware) APITime() mux.MiddlewareFunc

APITime sets a http_api_time metric on Prometheus

type MiddlewareInterface

type MiddlewareInterface interface {
	APICount() mux.MiddlewareFunc
	APITime() mux.MiddlewareFunc
}

MiddlewareInterface

func NewMiddleware

func NewMiddleware(monitor MonitorInterface, service string) MiddlewareInterface

NewMiddleware returns a Middleware based on the type of monitor

type MonitorInterface

type MonitorInterface interface {
	GetService() string
	GetMetric(metric string) *prometheus.GaugeVec
	Incr(metric string, opts map[string]string)
}

MonitorInterface interface

Jump to

Keyboard shortcuts

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