metrics

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package metrics contains all metrics that needs to be exposed to Prometheus and indirectly to Grafana. Currently, the following metrics are exposed:

api_endpoints_requests - number of requests made for each REST API endpoint

api_endpoints_response_time - response times for all REST API endpoints

api_endpoints_status_codes - number of responses for each status code

Index

Constants

This section is empty.

Variables

View Source
var (
	// APIRequests is a counter vector for requests to endpoints
	APIRequests *prometheus.CounterVec = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "api_endpoints_requests",
		Help: "The total number of requests per endpoint",
	}, []string{"endpoint"})

	// APIResponsesTime collects the information about api response time per endpoint
	APIResponsesTime *prometheus.HistogramVec = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "api_endpoints_response_time",
		Help:    "API endpoints response time",
		Buckets: prometheus.LinearBuckets(0, 20, 20),
	}, []string{"endpoint"})

	// APIResponseStatusCodes collects the information about api response status codes
	APIResponseStatusCodes *prometheus.CounterVec = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "api_endpoints_status_codes",
		Help: "API endpoints status codes",
	}, []string{"status_code"})
)

Functions

func AddAPIMetricsWithNamespace added in v1.4.0

func AddAPIMetricsWithNamespace(namespace string)

AddAPIMetricsWithNamespace overwrite the defined metrics with namespaced version of them

Types

This section is empty.

Jump to

Keyboard shortcuts

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