Documentation ¶
Index ¶
- func EnableMetrics() enginemetrics.Collector
- func NoRoute(c *gin.Context)
- func SetupGin(ginEngine *gin.Engine)
- type Metrics
- type PrometheusCollector
- func (c *PrometheusCollector) RegisterCounterVec(name string, labels ...string) *prometheus.CounterVec
- func (c *PrometheusCollector) RegisterGauge(name string) prometheus.Gauge
- func (c *PrometheusCollector) RegisterGaugeVec(name string, labels ...string) *prometheus.GaugeVec
- func (c *PrometheusCollector) RegisterHistogramVec(name string, labels ...string) *prometheus.HistogramVec
- type RequestMetrics
- type RequestTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableMetrics ¶
func EnableMetrics() enginemetrics.Collector
EnableMetrics will enable the metrics for the application
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is the metrics collector
func (*Metrics) HTTPHandler ¶
HTTPHandler will return the http.Handler for the metrics
type PrometheusCollector ¶
type PrometheusCollector struct {
// contains filtered or unexported fields
}
PrometheusCollector is a collector for Prometheus metrics. It should implement spvwalletmodels.Collector.
func (*PrometheusCollector) RegisterCounterVec ¶ added in v0.21.0
func (c *PrometheusCollector) RegisterCounterVec(name string, labels ...string) *prometheus.CounterVec
RegisterCounterVec creates a new CounterVec and registers it with the collector.
func (*PrometheusCollector) RegisterGauge ¶
func (c *PrometheusCollector) RegisterGauge(name string) prometheus.Gauge
RegisterGauge creates a new Gauge and registers it with the collector.
func (*PrometheusCollector) RegisterGaugeVec ¶
func (c *PrometheusCollector) RegisterGaugeVec(name string, labels ...string) *prometheus.GaugeVec
RegisterGaugeVec creates a new GaugeVec and registers it with the collector.
func (*PrometheusCollector) RegisterHistogramVec ¶
func (c *PrometheusCollector) RegisterHistogramVec(name string, labels ...string) *prometheus.HistogramVec
RegisterHistogramVec creates a new HistogramVec and registers it with the collector.
type RequestMetrics ¶ added in v0.21.0
type RequestMetrics struct {
// contains filtered or unexported fields
}
RequestMetrics is the metrics for the http requests
func (*RequestMetrics) Track ¶ added in v0.21.0
func (m *RequestMetrics) Track(method, path string) *RequestTracker
Track will return a RequestTracker to track the request
type RequestTracker ¶ added in v0.21.0
type RequestTracker struct {
// contains filtered or unexported fields
}
RequestTracker is used to track the duration and status of a request
func (*RequestTracker) End ¶ added in v0.21.0
func (r *RequestTracker) End(status int)
End will end the tracking of the request
func (*RequestTracker) EndWithNoRoute ¶ added in v0.21.0
func (r *RequestTracker) EndWithNoRoute()
EndWithNoRoute will end the tracking of the request with a 404 status
func (*RequestTracker) Start ¶ added in v0.21.0
func (r *RequestTracker) Start()
Start will start the tracking of the request