From 2823ad1b5ea52128903dbf4d5238325684c54329 Mon Sep 17 00:00:00 2001 From: Paul Lhussiez Date: Wed, 30 Aug 2017 10:52:59 +0200 Subject: [PATCH 1/2] Quick first documentation --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 222a99a..9a3b247 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ # go-gin-prometheus -=== +[![](https://godoc.org/github.com/zsais/go-gin-prometheus?status.svg)](https://godoc.org/github.com/zsais/go-gin-prometheus) 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 From c2fc30136beeeca50b4e3e537c9decca3d7a8880 Mon Sep 17 00:00:00 2001 From: Paul Lhussiez Date: Wed, 30 Aug 2017 10:56:29 +0200 Subject: [PATCH 2/2] Add License badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a3b247..f2c4223 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # go-gin-prometheus -[![](https://godoc.org/github.com/zsais/go-gin-prometheus?status.svg)](https://godoc.org/github.com/zsais/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