inst

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHTTPHandlers

func RegisterHTTPHandlers(http *http.ServeMux)

RegisterHTTPHandlers registers and exposes prometheus metrics at /metrics endpoint to supplied mux

Types

type InstrumentValve

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

InstrumentValve collect instrumentation data for reporting using prometheus

func NewInstrumentValve

func NewInstrumentValve(frontend string, backend string) *InstrumentValve

NewInstrumentValve initialize a new valve with given frontend and backend. frontend and backend are expected to be ID values (string) for these systems.

func (*InstrumentValve) AfterReceive

func (inst *InstrumentValve) AfterReceive(msg *common.WsMessage) (*common.WsMessage, error)

AfterReceive instrument messages after being received from backend

func (*InstrumentValve) BeforeTransmit

func (inst *InstrumentValve) BeforeTransmit(msg *common.WsMessage) (*common.WsMessage, error)

BeforeTransmit instrument messages before they are transmitted to backend

type PrometheusProvider

type PrometheusProvider struct{}

PrometheusProvider Prometheus valve provider for usage within balancer frontend

func (*PrometheusProvider) AddValves

func (pip *PrometheusProvider) AddValves(session *common.ProxySession,
	currentValves []common.MessageValve) []common.MessageValve

AddValves adds prometheus instrumentation valve at the begining of the supplied chain

func (*PrometheusProvider) SessionCreated

func (pip *PrometheusProvider) SessionCreated(session *common.ProxySession)

SessionCreated registers a new session in promethus total session counter and increments the current active session gauge.

func (*PrometheusProvider) SessionTerminated

func (pip *PrometheusProvider) SessionTerminated(session *common.ProxySession)

SessionTerminated decrements the current active session gauge.

Jump to

Keyboard shortcuts

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