Documentation ¶
Index ¶
- func CallDuration() prometheus.Collector
- func ConcurrentCalls() prometheus.Collector
- func CounterValue(col prometheus.Collector) (v float64, err error)
- func GinMetricsMiddleWare() gin.HandlerFunc
- func Initialize(port string, namespace string)
- func IsInitialized() bool
- func MetricApiLabels() []string
- func MetricNames() []string
- func Namespace() string
- func Port() string
- func Publish()
- func RegisterCustomMetrics(cMetrics ...prometheus.Collector)
- func TotalCalls() prometheus.Collector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallDuration ¶
func CallDuration() prometheus.Collector
CallDuration returns the duration of calls to the API.
func ConcurrentCalls ¶
func ConcurrentCalls() prometheus.Collector
ConcurrentCalls returns the number of concurrent calls to the API.
func CounterValue ¶
func CounterValue(col prometheus.Collector) (v float64, err error)
CounterValue returns the value of the metric associated with the Collector This is to facilitate unit testing of the package.
func GinMetricsMiddleWare ¶
func GinMetricsMiddleWare() gin.HandlerFunc
GinMetricsMiddleWare is a middleware function that captures quantitative metrics for the request.
func Initialize ¶
Initialize initializes metrics system so it can TestRegisterFuncs metrics. This must be called before any metrics are registered.
func IsInitialized ¶
func IsInitialized() bool
func MetricApiLabels ¶
func MetricApiLabels() []string
func MetricNames ¶
func MetricNames() []string
MetricNames returns the names of the metrics associated with the Collector.
func Namespace ¶
func Namespace() string
Namespace returns the Namespace for the metrics of the API.
func RegisterCustomMetrics ¶
func RegisterCustomMetrics(cMetrics ...prometheus.Collector)
RegisterCustomMetrics allows one to add a custom metric to the registry. This will panic if Initialize has not been called first. This is useful for adding metrics that are not API related. You can add Gauge, Counter, and Histogram metrics that you have defined.
func TotalCalls ¶
func TotalCalls() prometheus.Collector
TotalCalls returns the total number of calls to the API.
Types ¶
This section is empty.