diff --git a/README.md b/README.md index 222a99a..f2c4223 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,34 @@ # go-gin-prometheus -=== +[![](https://godoc.org/github.com/zsais/go-gin-prometheus?status.svg)](https://godoc.org/github.com/zsais/go-gin-prometheus) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + Gin Web Framework Prometheus metrics exporter + +## Installation + +`$ go get github.com/zsais/go-gin-prometheus` + +## Usage + +```go +package main + +import ( + "github.com/gin-gonic/gin" + "github.com/zsais/go-gin-prometheus" +) + +func main() { + r := gin.New() + + p := ginprometheus.NewPrometheus("gin") + p.Use(r) + + r.GET("/", func(c *gin.Context) { + c.JSON(200, "Hello world!") + }) + + r.Run(":29090") +} +``` + +See the [example.go file](https://github.com/zsais/go-gin-prometheus/blob/master/example/example.go) \ No newline at end of file