metrics

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 9 Imported by: 9

Documentation

Overview

Package metrics contains helpers for exposing operational metrics for the application.

Index

Constants

This section is empty.

Variables

View Source
var Flags = flag.Flags{
	&flag.Boolean{
		Name:        "metrics-disabled",
		Usage:       "Disables exporting prometheus metrics",
		EnvVar:      "METRICS_DISABLED",
		Destination: &disabled,
		Hidden:      true,
	},
	&flag.String{
		Name:        "metrics-push-url",
		Usage:       "URL of the prometheus push gateway, if set, metrics are pushed",
		EnvVar:      "METRICS_PUSH_URL",
		Destination: &pushURL,
		Hidden:      true,
	},
}

Flags contains all command-line flags that can be used to configure metrics.

Functions

func AddSQLStats

func AddSQLStats(db *sql.DB)

AddSQLStats exports prometheus metrics for the provided SQL database connection.

func Push

func Push() error

Push all registered collectors to the configured push gateway.

func Register

func Register(collectors ...prometheus.Collector)

Register a prometheus collector.

func Serve

func Serve(r *mux.Router)

Serve prometheus metrics via HTTP on the provided router.

Types

This section is empty.

Jump to

Keyboard shortcuts

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