Skip to content

Simple Gin Starter project with some industry standard tools setup for production. Monitoring and alerting included

License

Notifications You must be signed in to change notification settings

thomasmendez/go-template-simple-server-monitoring

Repository files navigation

GoLang Gin Starter Project

Simple Gin Starter project with some industry standard tools setup for production. Monitoring and alerting included. Derived from go-template-simple-server (use this if you do not wish to use the monitoring tools in this repo)

Run Locally

Clone Repository or Use Template

Clone this repository git clone https://github.com/thomasmendez/go-template-simple-server.git or click 'Use this template' in the Github UI to use the current project as a template.

Install Go

Install the latest version of Go here

Verify Go is installed by checking the Go version with go version

Install Makefile

This project uses the Makefile in order to easily run sets of commands. The commands can also be run invidually using the commands listed for the makefile command

Install Dependencies

Run make tidy in order to run the Go commands needed to install releated dependencies properly

Setup Environment Variables

Create a .env file from the .env.example file and modify the environment variables as needed

Build

To build the project run make build

Build and Deply with Docker

Note: Make sure Docker is running on your machine

The microservice and monitoring applications can be build and deployed with make docker

Application can stop running by pressing ctrl+c on the terminal

Tests

Unit Tests

To run the unit test for the project, run make test

Libraries Used

Gin

Gin is a high performance web framework in Golang

Viper

Viper is a highly flexible configuration library

Zap

Zap fast, structured, leveled logging in Golang

Testify

Testify is an assertion library. Can also be used for mocking and building testing suites

Prometheus Client

Prometheus Go Client is the Go client library for Prometheus. It is used to provide application metrics

Tools Used

Swagger

Swagger is used as API documentation

Can be modified in the swagger/swagger.yaml file

Docker

Docker allows you to build and run this microservice

Prometheus

Prometheus provides metrics for the application

Alertmanager

Alertmanager handles alerts sent by client applications such as the Prometheus server

Grafana

Grafana allows you to query, visualize, and alert on and understand your metrics

Husky

Husky allows you to run scripts in the git lifecyle

This project is configured to run test before making a successful commit

Modify the pre-commit hook with commands you wish to run before committing

About

Simple Gin Starter project with some industry standard tools setup for production. Monitoring and alerting included

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published