Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestDurationMetricName = "catalogd_http_request_duration_seconds"
)

Variables

View Source
var (
	RequestDurationMetric = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name: RequestDurationMetricName,
			Help: "Histogram of request duration in seconds",

			Buckets: []float64{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.6, 2, 2.4, 2.8, 3.2, 3.6, 4, 10},
		},
		[]string{"code"},
	)
)

Sets up the necessary metrics for calculating the Apdex Score If using Grafana for visualization connected to a Prometheus data source that is scraping these metrics, you can create a panel that uses the following queries + expressions for calculating the Apdex Score where T = 0.5: Query A: sum(catalogd_http_request_duration_seconds_bucket{code!~"5..",le="0.5"}) Query B: sum(catalogd_http_request_duration_seconds_bucket{code!~"5..",le="2"}) Query C: sum(catalogd_http_request_duration_seconds_count) Expression for Apdex Score: ($A + (($B - $A) / 2)) / $C

Functions

func AddMetricsToHandler

func AddMetricsToHandler(handler http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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