metrics

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

README

go-metrics Build Status GoDoc

Go-metrics implements a bunch of helper functions for metrics in Go servers.

Installation

go get github.com/longsleep/go-metrics

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrometheusHTTPRequestCount = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "http_request_count",
		Help: "The number of HTTP requests.",
	},
	[]string{"method", "type", "endpoint"},
)

PrometheusHTTPRequestCount is a prometheus.CounterVec with name http_request_count and method, type and endpoint labels.

View Source
var PrometheusHTTPRequestLatency = prometheus.NewSummaryVec(
	prometheus.SummaryOpts{
		Name: "http_request_latency",
		Help: "The latency of HTTP requests.",
	},
	[]string{"method", "type", "endpoint"},
)

PrometheusHTTPRequestLatency is a new prometheus.SummaryVec with name http_request_latency and method, type and endpoint labels.

View Source
var PrometheusHTTPResponseCount = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "http_response_count",
		Help: "The number of HTTP responses.",
	},
	[]string{"method", "type", "endpoint", "code"},
)

PrometheusHTTPResponseCount is a prometheus.CounterVec wuth name http_response_count and method, type, endpoint and code labels.

View Source
var PrometheusWebsocketMessageCount = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "websocket_message_count",
		Help: "The number of Websocket messages.",
	},
	[]string{"type", "direction"},
)

PrometheusWebsocketMessageCount is a prometheus.CounterVec with name websocket_message_count and type and direction labels.

View Source
var PrometheusWebsocketMessageSize = prometheus.NewSummaryVec(
	prometheus.SummaryOpts{
		Name: "websocket_message_size",
		Help: "The size of websocket messages.",
	},
	[]string{"type", "direction"},
)

PrometheusWebsocketMessageSize is a prometheus.SummaryVec with name websocket_message_size and type and direction labels.

Functions

func MustRegister

func MustRegister(collectors ...prometheus.Collector)

MustRegister registers the provided prometheus.Collectors and the pre-defined prometheus.Collectors with the prometheus.DefaultRegisterer and panics of any error occurs.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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