metrics

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestCounter               = "http.server.request_count"
	RequestCountDescription      = "Request counter"
	TotalRequestCounter          = "http.server.total_request_count"
	TotalRequestDescription      = "Total return code counter"
	ReturnCodeCounter            = "http.server.return_code_counter"
	ReturnCodeCounterDescription = "Return code counter"
	Method                       = "method"
	URI                          = "uri"
	ReturnCode                   = "return_code"
)
View Source
const (
	ActiveSessionCounter            = "zitadel.active_session_counter"
	ActiveSessionCounterDescription = "Active session counter"
	SpoolerDivCounter               = "zitadel.spooler_div_milliseconds"
	SpoolerDivCounterDescription    = "Spooler div from last successful run to now in milliseconds"
	Database                        = "database"
	ViewName                        = "view_name"
)

Variables

This section is empty.

Functions

func AddCount

func AddCount(ctx context.Context, name string, value int64, labels map[string]attribute.Value) error

func GetExporter

func GetExporter() http.Handler

func GetMetricsProvider

func GetMetricsProvider() metric.MeterProvider

func NewMetricsHandler

func NewMetricsHandler(handler http.Handler, metricMethods []MetricType, ignoredEndpoints ...string) http.Handler

func RegisterCounter

func RegisterCounter(name, description string) error

func RegisterRequestCodeCounter

func RegisterRequestCodeCounter(recorder *StatusRecorder, r *http.Request)

func RegisterRequestCounter

func RegisterRequestCounter(r *http.Request)

func RegisterTotalRequestCounter

func RegisterTotalRequestCounter(r *http.Request)

func RegisterUpDownSumObserver

func RegisterUpDownSumObserver(name, description string, callbackFunc metric.Int64ObserverFunc) error

func RegisterValueObserver

func RegisterValueObserver(name, description string, callbackFunc metric.Int64ObserverFunc) error

Types

type Filter

type Filter func(*http.Request) bool

type Handler

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

func (*Handler) ServeHTTP

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

ServeHTTP serves HTTP requests (http.Handler)

type MetricType

type MetricType int32
const (
	MetricTypeTotalCount MetricType = iota
	MetricTypeStatusCode
	MetricTypeRequestCount
)

type Metrics

type Metrics interface {
	GetExporter() http.Handler
	GetMetricsProvider() metric.MeterProvider
	RegisterCounter(name, description string) error
	AddCount(ctx context.Context, name string, value int64, labels map[string]attribute.Value) error
	RegisterUpDownSumObserver(name, description string, callbackFunc metric.Int64ObserverFunc) error
	RegisterValueObserver(name, description string, callbackFunc metric.Int64ObserverFunc) error
}
var M Metrics

type StatusRecorder

type StatusRecorder struct {
	http.ResponseWriter
	Status int
}

func (*StatusRecorder) WriteHeader

func (r *StatusRecorder) WriteHeader(status int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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