metrics

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiCallDuration = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "api_request_duration_seconds",
		Help:    "A histogram of HTTP request durations.",
		Buckets: []float64{0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.5, 1., 2.0, 2.5, 5., 10.},
	},
	[]string{"action", "path", "method", "status_code"},
)

ApiCallDuration histogram for API call duration

View Source
var ApiCallDurationQuantile = prometheus.NewSummaryVec(
	prometheus.SummaryOpts{
		Name:       "api_request_duration_quantiles_seconds",
		Help:       "A summary of HTTP request durations",
		Objectives: map[float64]float64{0.1: 0.1, 0.5: 0.05, 0.95: 0.01, 0.99: 0.001, 0.999: 0.0001},
	},
	[]string{"action", "path", "method", "status_code"},
)

ApiCallDurationQuantile summary for API call duration

View Source
var BuildInfo = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: promNS,
		Name:      "build_info",
		Help:      "A constant metric labeled with build information for " + promNS,
	},
	[]string{"version", "revision", "goversion", "goarch", "goos"},
)

BuildInfo -

View Source
var GopherActionLatencyHist = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Namespace: promNS,
		Name:      "response_times_seconds",
		Help:      "latency of actions/label",
		Buckets:   []float64{0.01, 0.05, 0.1, 0.5, 1, 2, 4, 6},
	},
	[]string{"action"},
)

GopherActionLatencyHist is a histogram tracking the response times of actions

View Source
var GopherActions = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: promNS,
		Name:      "actions_total",
		Help:      "Number of gopherciser actions and their result. DOES NOT USE LABEL!",
	},
	[]string{"result", "action"},
)

GopherActions action counter

View Source
var GopherActiveUsers = prometheus.NewGauge(prometheus.GaugeOpts{
	Namespace: promNS,
	Name:      "active_users",
	Help:      "Current amount of active users",
})

GopherActiveUsers currently active

View Source
var GopherErrors = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: promNS,
		Name:      "errors_per_action",
		Help:      "Number of gopherciser execution errors per action/label and app.",
	},
	[]string{"action"},
)

GopherErrors execution Errors

View Source
var GopherResponseTimes = prometheus.NewSummaryVec(
	prometheus.SummaryOpts{
		Namespace:  promNS,
		Name:       "response_times",
		Help:       "Summarized response times per action/label",
		Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
	},
	[]string{"action"},
)

GopherResponseTimes response times

View Source
var GopherUsersTotal = prometheus.NewCounter(prometheus.CounterOpts{
	Namespace: promNS,
	Name:      "users_total",
	Help:      "Number of gopherciser users simulated.",
})

GopherUsersTotal simulated users

View Source
var GopherWarnings = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: promNS,
		Name:      "warnings_total",
		Help:      "Number of gopherciser execution warnings per action/label.",
	},
	[]string{"action"},
)

GopherWarnings execution Warnings

Functions

func PullMetrics

func PullMetrics(ctx context.Context, metricsPort int, actions []string) error

PullMetrics handle the serving of prometheus metrics on the metrics endpoint

func PushMetrics

func PushMetrics(ctx context.Context, metricsPort int, metricsAddress, job string, groupingKeys, actions []string) error

PushMetrics handles the constant pushing of metrics to prometheus

Types

This section is empty.

Jump to

Keyboard shortcuts

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