An open API service indexing awesome lists of open source software.

https://github.com/fourhundredfour/gin_prometheus_pusher

A Gin Middleware that pushes to a Prometheus Instance instead of scraping it. Ideal for Serverless Applications
https://github.com/fourhundredfour/gin_prometheus_pusher

gin gin-framework gin-gonic gin-middleware go golang golang-library prometheus prometheus-client

Last synced: about 1 month ago
JSON representation

A Gin Middleware that pushes to a Prometheus Instance instead of scraping it. Ideal for Serverless Applications

Awesome Lists containing this project

README

          

# gin_prometheus_pusher
A Gin Middleware that pushes to a Prometheus Instance instead of scraping it.
Ideal for Serverless Applications

## Index
* [Installation](#installation)
* [Example](#example)

## Installation
```
go get github.com/fourhundredfour/gin_prometheus_pusher
```

## Example
```golang
package main

import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/fourhundredfour/gin_prometheus_pusher"
)

func main() {
engine := gin.Default()
engine.Use(gin_prometheus_pusher.Prometheus(&gin_prometheus_pusher.PrometheusConfiguration{
Address: "http://example.org/metrics",
Job: "my_job",
}))

engine.GET("/", func(ctx *gin.Context) {
context.JSON(http.StatusOK, nil)
})
http.ListenAndServe(":8080", engine)
}
```