Skip to content

danielmeloramos/sre-artigo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang, Prometheus, Grafana Example

This is a simple example project demonstrating how to use Golang, Prometheus, and Grafana together. The Golang application exposes metrics, Prometheus scrapes these metrics, and Grafana visualizes the data.

Prerequisites

  • Docker
  • Docker Compose

Getting Started

  1. Clone the repository:

    git clone https://github.com/danielmeloramos/sre-artigo.git
    cd sre-artigo
  2. Build the Golang application:

    make build
  3. Run the entire setup:

    make run
  4. This command starts the Golang application, Prometheus, and Grafana containers.

  • Access Grafana at http://localhost:3000 (default credentials: admin/admin).
  • Add Prometheus as a data source in Grafana with the URL http://prometheus:9090.
  • Create a dashboard in Grafana and visualize the myapp_requests_total metric sum(increase(myapp_requests_total[1m])) .
  1. Stopping the Setup. To stop and remove all containers, use the following command:

    make clean
  2. Notes

    • The Golang application runs on port 8080;
    • Prometheus is accessible at http://localhost:9090;
    • Grafana is accessible at http://localhost:3000 (default credentials: admin/admin).
  3. Post Blog

https://danielmeloramos.com.br/site-reliability-engineering/

Feel free to customize the Golang application and the Prometheus/Grafana configurations based on your needs.

Replace https://github.com/your-username/your-repository.git with the actual URL of your Git repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published