Documentation
¶
Index ¶
- func MakeMetricsURL(address string, tlsConf *connection.TLSConfig) (string, error)
- func RegisterMonitoringServer(mux *http.ServeMux, p *Provider)
- func RequireConnectionMetrics(t *testing.T, label string, connMetrics *ConnectionMetrics, ...)
- func WaitForConnections(t *testing.T, p *Provider, name string, requiredCount int)
- type ConnectionMetrics
- type ExpectedConn
- type MetricsParameters
- type Provider
- func (p *Provider) NewCounter(opts prometheus.CounterOpts) prometheus.Counter
- func (p *Provider) NewCounterVec(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec
- func (p *Provider) NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge
- func (p *Provider) NewGaugeVec(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec
- func (p *Provider) NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram
- func (p *Provider) NewHistogramVec(opts prometheus.HistogramOpts, labels []string) *prometheus.HistogramVec
- func (p *Provider) Registry() *prometheus.Registry
- type ThroughputMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeMetricsURL ¶
func MakeMetricsURL(address string, tlsConf *connection.TLSConfig) (string, error)
MakeMetricsURL construct the Prometheus metrics URL. based on the secure level, we set the url scheme to http or https.
func RegisterMonitoringServer ¶ added in v1.0.0
RegisterMonitoringServer registers the monitoring endpoints with the provided HTTP mux. It sets up Prometheus metrics endpoint and pprof profiling handlers. It uses the similar signature as GRPC server registration to allow common language for all server<->service interfaces.
func RequireConnectionMetrics ¶
func RequireConnectionMetrics( t *testing.T, label string, connMetrics *ConnectionMetrics, expected ExpectedConn, )
RequireConnectionMetrics waits for a connection status and a specified number of failures.
Types ¶
type ConnectionMetrics ¶
type ConnectionMetrics struct {
Status *prometheus.GaugeVec
FailureTotal *prometheus.CounterVec
// contains filtered or unexported fields
}
ConnectionMetrics supports common connection metrics.
func NewConnectionMetrics ¶ added in v1.0.0
func NewConnectionMetrics(p *Provider, params MetricsParameters) *ConnectionMetrics
NewConnectionMetrics supports common connection metrics.
func (*ConnectionMetrics) Connected ¶
func (m *ConnectionMetrics) Connected(grpcTarget string)
Connected observed connected.
func (*ConnectionMetrics) Disconnected ¶
func (m *ConnectionMetrics) Disconnected(grpcTarget string)
Disconnected observe disconnected. The failure count is increased only if the status was connected.
type ExpectedConn ¶
ExpectedConn is used to describe the expected connection state.
type MetricsParameters ¶ added in v1.0.0
MetricsParameters describes metrics namespace and subsystem.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a prometheus metrics provider.
func NewProvider ¶
func NewProvider() *Provider
NewProvider creates a new prometheus metrics provider.
func (*Provider) NewCounter ¶
func (p *Provider) NewCounter(opts prometheus.CounterOpts) prometheus.Counter
NewCounter creates a new prometheus counter.
func (*Provider) NewCounterVec ¶
func (p *Provider) NewCounterVec(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec
NewCounterVec creates a new prometheus counter vector.
func (*Provider) NewGauge ¶
func (p *Provider) NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge
NewGauge creates a new prometheus gauge.
func (*Provider) NewGaugeVec ¶
func (p *Provider) NewGaugeVec(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec
NewGaugeVec creates a new prometheus gauge vector.
func (*Provider) NewHistogram ¶
func (p *Provider) NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram
NewHistogram creates a new prometheus histogram.
func (*Provider) NewHistogramVec ¶
func (p *Provider) NewHistogramVec(opts prometheus.HistogramOpts, labels []string) *prometheus.HistogramVec
NewHistogramVec creates a new prometheus histogram vector.
func (*Provider) Registry ¶
func (p *Provider) Registry() *prometheus.Registry
Registry returns the prometheus registry.
type ThroughputMetrics ¶ added in v1.0.0
type ThroughputMetrics struct {
Input prometheus.Counter
Output prometheus.Counter
}
ThroughputMetrics supports common throughput metrics.
func NewThroughputMetrics ¶ added in v1.0.0
func NewThroughputMetrics(p *Provider, params MetricsParameters) *ThroughputMetrics
NewThroughputMetrics creates a new prometheus throughput counter.