Prometheus Go Client Library

Prometheus Go Client Library

Overview Installation Dashboards Grafana Cloud Integration

Introduction

The following quickstart provides setup instructions and a preconfigured dashboard for the Prometheus Go client library. After running through the steps in this quickstart, you will have:

  • Set up and configured the Go client library to collect Go Prometheus metrics like total reserved memory, stack memory use, and heap memory. The Go client library will expose these as Prometheus-style metrics.

  • Configured Prometheus to scrape Go client library metrics and optionally ship them to Grafana Cloud.

  • Imported Grafana dashboards to visualize your metrics data.

Metrics usage

This exporter publishes roughly 45 Prometheus time series by default. To see a list of metrics shipped by default with this exporter, please download a sample metrics scrape here.

Note that depending on its configuration, Prometheus Go client library may collect and publish far more metrics than this default set. To learn more about configuring Prometheus Go client library and toggling its collectors, please see the Prometheus Go client library GitHub repository.

Beyond toggling Prometheus Go client library’s settings, you can reduce metrics usage by dropping time series you don’t need to store in Prometheus or Grafana Cloud. To learn how to do this, please see Reducing Prometheus metrics usage with relabeling from the Grafana Cloud docs.

Grafana Cloud’s Golang Integration

If you’re using Grafana Cloud, you can skip all of the steps in this guide by installing the Prometheus Go Integration, which is designed to help you get up and running in a few commands and clicks. Sign up for free.

To learn how to set up Prometheus Go client library with the Prometheus Go Integration, please see Go Integration from the Grafana Cloud docs.