client_golang
Prometheus instrumentation library for Go applications
File Explorer
- approve-workflows.yml
- automerge-dependabot.yml
- codeql-analysis.yml
- golangci-lint.yml
- govulncheck.yml
- scorecard.yml
- test.yml
- update-go-versions.yml
- validate.yml
- CODEOWNERS
- dependabot.yml
- ISSUE_TEMPLATE.md
- settings.yml
- stale.yml
- api.go
- api_bench_test.go
- api_test.go
- example_test.go
- client.go
- client_test.go
- main.go
- main.go
- main.go
- main.go
- httpmiddleware.go
- main.go
- main.go
- main.go
- main.go
- main.go
- symbols.go
- symbols_test.go
- types.pb.go
- types_vtproto.pb.go
- buf.gen.yaml
- remote_api.go
- remote_api_test.go
- remote_headers.go
- remote_headers_test.go
- backoff.go
- backoff_test.go
- protohelpers.go
- exp.go
- go.mod
- go.sum
- README.md
- header.go
- header_test.go
- negotiate.go
- negotiate_test.go
- LICENSE
- README.md
- version.go
- version_test.go
- collectors.go
- dbstats_collector.go
- dbstats_collector_test.go
- expvar_collector.go
- gen_go_collector_set.go
- go_collector_go122_test.go
- go_collector_go123_test.go
- go_collector_go124_test.go
- go_collector_go125_test.go
- go_collector_go126_test.go
- go_collector_latest.go
- go_collector_latest_test.go
- process_collector.go
- bridge.go
- bridge_test.go
- almost_equal.go
- difflib.go
- difflib_test.go
- go_collector_options.go
- go_runtime_metrics.go
- go_runtime_metrics_test.go
- metric.go
- auto.go
- auto_test.go
- compression.go
- zstd.go
- zstd_test.go
- delegator.go
- delegator_test.go
- http.go
- http_test.go
- instrument_client.go
- instrument_client_test.go
- instrument_server.go
- instrument_server_test.go
- option.go
- option_test.go
- example_add_from_gatherer_test.go
- examples_test.go
- push.go
- push_test.go
- counter_validations.go
- duplicate_validations.go
- generic_name_validations.go
- help_validations.go
- histogram_validations.go
- units.go
- problem.go
- promlint.go
- promlint_test.go
- validation.go
- lint.go
- lint_test.go
- testutil.go
- testutil_test.go
- .gitignore
- benchmark_test.go
- build_info_collector.go
- collector.go
- collector_test.go
- collectorfunc.go
- collectorfunc_test.go
- counter.go
- counter_test.go
- desc.go
- desc_test.go
- doc.go
- example_clustermanager_test.go
- example_metricvec_test.go
- example_timer_complex_test.go
- example_timer_gauge_test.go
- example_timer_test.go
- examples_test.go
- expvar_collector.go
- expvar_collector_test.go
- fnv.go
- gauge.go
- gauge_test.go
- gen_go_collector_metrics_set.go
- get_pid.go
- get_pid_gopherjs.go
- go_collector.go
- go_collector_latest.go
- go_collector_latest_test.go
- go_collector_metrics_go122_test.go
- go_collector_metrics_go123_test.go
- go_collector_metrics_go124_test.go
- go_collector_metrics_go125_test.go
- go_collector_metrics_go126_test.go
- go_collector_test.go
- histogram.go
- histogram_test.go
- labels.go
- metric.go
- metric_test.go
- num_threads.go
- num_threads_gopherjs.go
- observer.go
- process_collector.go
- process_collector_darwin.go
- process_collector_darwin_test.go
- process_collector_linux_test.go
- process_collector_mem_cgo_darwin.c
- process_collector_mem_cgo_darwin.go
- process_collector_mem_nocgo_darwin.go
- process_collector_not_supported.go
- process_collector_procfsenabled.go
- process_collector_test.go
- process_collector_windows.go
- process_collector_windows_test.go
- README.md
- registry.go
- registry_test.go
- summary.go
- summary_test.go
- timer.go
- timer_test.go
- untyped.go
- utils_test.go
- value.go
- value_test.go
- vec.go
- vec_test.go
- vnext.go
- wrap.go
- wrap_test.go
- acceptance_test.go
- common.go
- playground_test.go
- main.go
- .gitignore
- ContribFest.pdf
- go.mod
- go.sum
- main.go
- Makefile
- README.md
- .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
goSetup 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
jsDelivrjsDelivr 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.
Link
Example
# Project Badges
// repository documentation
Was this content helpful?
(0 ratings)
