From 2ffb62bab86f970070bcd97cc9c9de67369afb2d Mon Sep 17 00:00:00 2001 From: lhajouji Date: Sat, 21 Dec 2024 00:34:09 +0100 Subject: [PATCH] fixing outdated instruction to get Go packages Signed-off-by: lhajouji --- content/docs/guides/go-application.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/content/docs/guides/go-application.md b/content/docs/guides/go-application.md index 1f44c96d4..ed3db16db 100644 --- a/content/docs/guides/go-application.md +++ b/content/docs/guides/go-application.md @@ -10,7 +10,21 @@ NOTE: For comprehensive API documentation, see the [GoDoc](https://godoc.org/git ## Installation -You can install the `prometheus`, `promauto`, and `promhttp` libraries necessary for the guide using [`go get`](https://golang.org/doc/articles/go_command.html): +To integrate Prometheus with your Go application, you'll need the `prometheus`, `promauto`, and `promhttp` libraries. Starting with Go 1.17, Go Modules are required for managing dependencies. + +#### Using Go Modules + +If your project does not already use Go Modules, initialize a new module in your project directory: + +```bash +go mod init +``` +Replace with a name that represents your project. +NOTE: For more details see the [`go mod init`](https://go.dev/doc/tutorial/create-module) documentation. + +#### Installing Prometheus Libraries + +Once your project is using Go Modules, install the Prometheus client libraries using [`go get`](https://golang.org/doc/articles/go_command.html): ```bash go get github.com/prometheus/client_golang/prometheus