Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/x-punch/gin-prometheus
Gin middleware used to export prometheus metrics
https://github.com/x-punch/gin-prometheus
gin gin-prometheus grafana prometheus
Last synced: about 1 month ago
JSON representation
Gin middleware used to export prometheus metrics
- Host: GitHub
- URL: https://github.com/x-punch/gin-prometheus
- Owner: x-punch
- License: apache-2.0
- Created: 2019-05-24T05:51:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T07:16:26.000Z (over 4 years ago)
- Last Synced: 2024-10-18T09:05:28.726Z (2 months ago)
- Topics: gin, gin-prometheus, grafana, prometheus
- Language: Go
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gin-prometheus
Gin middleware used to export prometheus metrics# Usage
```go
app := gin.New()
prometheus := prometheus.NewPrometheus("service")
prometheus.Use(app, "/metrics")
```# Auth Example
```go
package mainimport (
"github.com/gin-gonic/gin"
prometheus "github.com/x-punch/gin-prometheus"
)func main() {
app := gin.New()
app.Use(gin.Logger())
prom := prometheus.NewPrometheus("gin")
prom.UseWithAuth(app, gin.Accounts{"gin": "gonic"}, "/metrics")
if err := app.Run(":80"); err != nil {
panic(err)
}
}
```