client_golang

(★ 6,019)

Prometheus instrumentation library for Go applications

File Explorer

  • .dockerignore
  • .gitignore
  • .golangci.yml
  • AGENTS.md
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • generate-go-collector.bash
  • go.mod
  • go.sum
  • LICENSE
  • MAINTAINERS.md
  • Makefile
  • Makefile.common
  • NOTICE
  • README.md
  • RELEASE.md
  • SECURITY.md
  • supported_go_versions.json
  • update-go-version.bash
  • VERSION

# Installation Guide

go
Prerequisites

Setup Steps

git clone https://github.com/prometheus/client_golang.git && cd client_golang

Clone the repository and navigate into the directory.

go mod download

Download required Go module dependencies.

make test

Run the complete test suite to verify functionality.

go run ./examples/simple/main.go

Run the basic example application.

Key Commands

go get github.com/prometheus/client_golang/prometheus

Add Prometheus Go client library as a dependency in a Go project.

make test

Run unit and integration tests using Makefile.

go test -v ./...

Run Go tests across all subpackages.

go run ./examples/random/main.go

Directly run the provided example applications.

The two most recent major releases of Go are supported; this is primarily a client library to be imported into other projects.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

# Project Badges

// repository documentation