Documentation
¶
Overview ¶
Package metrics sets and initializes Prometheus metrics.
Index ¶
Constants ¶
View Source
const (
NF_TYPE_LABEL = "nf_type"
)
Variables ¶
This section is empty.
Functions ¶
func InboundMetrics ¶
func InboundMetrics() gin.HandlerFunc
InboundMetrics is a Gin middleware that counts and times each request.
func Init ¶
func Init(initMetrics InitMetrics) *prometheus.Registry
Init initializes all Prometheus metrics
Types ¶
type InitMetrics ¶
type InitMetrics struct {
// contains filtered or unexported fields
}
func NewInitMetrics ¶
func NewInitMetrics( _metrics Metrics, _nfName string, _metricsEnabled map[utils.MetricTypeEnabled]bool, _customCollectors map[utils.MetricTypeEnabled][]prometheus.Collector, ) InitMetrics
func (InitMetrics) GetCustomCollectors ¶
func (initMetrics InitMetrics) GetCustomCollectors() map[utils.MetricTypeEnabled][]prometheus.Collector
func (InitMetrics) GetMetricsEnabled ¶
func (initMetrics InitMetrics) GetMetricsEnabled() map[utils.MetricTypeEnabled]bool
func (InitMetrics) GetMetricsInfo ¶
func (initMetrics InitMetrics) GetMetricsInfo() Metrics
func (InitMetrics) GetNfName ¶
func (initMetrics InitMetrics) GetNfName() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(initMetrics InitMetrics, tlsKeyLogPath string, nfLogger *logrus.Entry) (*Server, error)
Initializes a new HTTP server instance and associate the prometheus handler to it
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
Configure the server to handle http requests
func (*Server) ListenAndServeTLS ¶
func (s *Server) ListenAndServeTLS()
Configure the server to handle https requests
Click to show internal directories.
Click to hide internal directories.