Documentation ¶
Index ¶
- func TrimPort(addr string) string
- type Matrix
- type Metrics
- func (m *Metrics) Collect(in chan<- prometheus.Metric)
- func (m *Metrics) Counter(name, help string, labels []string) *prometheus.CounterVec
- func (m *Metrics) DecCommands(remoteAddr, localAddr string, cmds []string)
- func (m *Metrics) DecConnection(remoteAddr, localAddr string)
- func (m *Metrics) DecRequest(remoteAddr, localAddr string)
- func (m *Metrics) Describe(in chan<- *prometheus.Desc)
- func (m *Metrics) Dialer(localAddr, remoteAddr string)
- func (m *Metrics) Enabled() bool
- func (m *Metrics) Gauge(name, help string, labels []string) *prometheus.GaugeVec
- func (m *Metrics) Histogram(name, help string, labels []string) *prometheus.HistogramVec
- func (m *Metrics) IncBytesRead(localAddr, remoteAddr string, size float64)
- func (m *Metrics) IncBytesReceived(remoteAddr, localAddr string, size float64)
- func (m *Metrics) IncBytesSend(remoteAddr, localAddr string, size float64)
- func (m *Metrics) IncBytesWrite(localAddr, remoteAddr string, size float64)
- func (m *Metrics) IncCommands(remoteAddr, localAddr string, cmds []string)
- func (m *Metrics) IncConnection(remoteAddr, localAddr string)
- func (m *Metrics) IncErrors(remoteAddr, localAddr string, cmds []string)
- func (m *Metrics) IncRequest(remoteAddr, localAddr string)
- func (m *Metrics) ObserveProxy(remoteAddr, localAddr string, issuedAt time.Time)
- func (m *Metrics) ObserveRedis(remoteAddr, localAddr string, issuedAt time.Time)
- func (m *Metrics) ObserveRequest(remoteAddr, localAddr string, issuedAt time.Time)
- type Monitor
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matrix ¶
type Matrix struct {
// contains filtered or unexported fields
}
A Matrix defines matrix for both gRPC server and gRPC client
func NewServerMatrix ¶
func NewServerMatrix(subsystem string, labels prometheus.Labels) *Matrix
NewServerMatrix creates a new matrix for gRPC server
func (*Matrix) Collect ¶
func (m *Matrix) Collect(in chan<- prometheus.Metric)
Collect implements prometheus Collector interface.
func (*Matrix) Describe ¶
func (m *Matrix) Describe(in chan<- *prometheus.Desc)
Describe implements prometheus Collector interface.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics implements prometheus Collector interface for server and handler.
func NewMetrics ¶
NewMetrics creates a new metrics of grpc interceptor for shared usage.
func (*Metrics) Collect ¶
func (m *Metrics) Collect(in chan<- prometheus.Metric)
Collect implements prometheus Collector interface.
func (*Metrics) Counter ¶
func (m *Metrics) Counter(name, help string, labels []string) *prometheus.CounterVec
Counter ...
func (*Metrics) DecCommands ¶
func (*Metrics) DecConnection ¶
func (*Metrics) DecRequest ¶
func (*Metrics) Describe ¶
func (m *Metrics) Describe(in chan<- *prometheus.Desc)
Describe implements prometheus Collector interface.
func (*Metrics) Gauge ¶
func (m *Metrics) Gauge(name, help string, labels []string) *prometheus.GaugeVec
Gauge ...
func (*Metrics) Histogram ¶
func (m *Metrics) Histogram(name, help string, labels []string) *prometheus.HistogramVec
Histogram ...
func (*Metrics) IncBytesRead ¶ added in v1.6.1
func (*Metrics) IncBytesReceived ¶ added in v1.6.1
func (*Metrics) IncBytesSend ¶ added in v1.6.1
func (*Metrics) IncBytesWrite ¶ added in v1.6.1
func (*Metrics) IncCommands ¶
func (*Metrics) IncConnection ¶
func (*Metrics) IncRequest ¶
func (*Metrics) ObserveProxy ¶ added in v1.6.2
func (*Metrics) ObserveRedis ¶ added in v1.6.2
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
A Monitor defines metrics for gRPC
func NewMonitor ¶
func NewMonitor(subsystem string, labels prometheus.Labels) *Monitor
NewMonitor creates Monitor for starting
func (*Monitor) Collect ¶
func (m *Monitor) Collect(in chan<- prometheus.Metric)
Collect implements prometheus Collector interface.
func (*Monitor) Describe ¶
func (m *Monitor) Describe(in chan<- *prometheus.Desc)
Describe implements prometheus Collector interface.
type Options ¶ added in v1.6.2
type Options struct { Subsystem string Labels prometheus.Labels EnableServerMetrics bool }
Options wraps settings of metrics.
func (Options) FillWithDefaults ¶ added in v1.6.2
func (opts Options) FillWithDefaults()
FillWithDefaults setups default values of options.