Skip to content

Monitoring endpoint

Required by gitaly!1448 (merged)

Provides a common endpoint for monitoring related activity:

  1. Prometheus/OpenMetrics endpoint
  2. A PProf endpoint
  3. A standardised way to configure the gitlab_build_info metric

Usage


import (
	"gitlab.com/gitlab-org/labkit/monitoring"
)

func ExampleServe() {
	monitoring.Serve(
		// Listen on port 7822 on all interfaces
		monitoring.WithListenerAddress(":7822"),
		// Add the standard version and build time labels
		monitoring.WithBuildInformation("0.1.1", "2019-09-01T00:22:00Z"),
		// Add any additional application-specific labels to the `gitlab_build_info` metric
		monitoring.WithBuildExtraLabels(map[string]string{
			"git_version": "2.0.0",
		}),
	)
}
Edited by Andrew Newdigate

Merge request reports

Loading