metrics

package
v1.2.30 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: serviceName + "request_success_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	InternalError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: serviceName + "request_error_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	BadRequestError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: serviceName + "request_bad_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	ConflictRequestError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: serviceName + "request_conflict_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	NotFoundRequestError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: serviceName + "request_notfound_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	GRPCRequestCount = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: serviceName + "grpc_request_count",
			Help: "The total number of requests served by the GRPC Server",
		},
		[]string{"method", "status"},
	)

	GRPCResponseTime = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    serviceName + "grpc_response_time",
			Help:    "The response time distribution of the GRPC Server",
			Buckets: []float64{0.1, 0.25, 0.5, 1, 2.5, 5, 10},
		},
		[]string{"method", "status"},
	)

	GRPCPanicsCount = promauto.NewCounter(prometheus.CounterOpts{
		Name: serviceName + "panics_total",
		Help: "Total Panics recovered",
	})

	HTTPRequestCount = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: serviceName + "http_request_count",
			Help: "The total number of requests served by the Http Server",
		},
		[]string{"method", "path", "status"},
	)

	HTTPResponseTime = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    serviceName + "http_response_time",
			Help:    "The response time distribution of the Http Server",
			Buckets: []float64{0.1, 0.25, 0.5, 1, 2.5, 5, 10},
		},
		[]string{"method", "path", "status"},
	)
)

Functions

func HTTPMetricsPrometheusMiddleware added in v1.0.6

func HTTPMetricsPrometheusMiddleware(c *fiber.Ctx) error

func ValidationMiddleware added in v1.0.6

func ValidationMiddleware() grpc.UnaryServerInterceptor

Types

This section is empty.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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