Categorygithub.com/misnaged/fasthttp-prometheus-middleware

# README

fasthttp prometheus-middleware

Fasthttp fasthttp middleware for Prometheus

Export metrics for request duration request_duration and request count request_count

Example

using fasthttp/router

package main

import (
"log"

fasthttpprom "github.com/carousell/fasthttp-prometheus-middleware"
"github.com/fasthttp/router"
"github.com/valyala/fasthttp"
)

func main() {

	r := router.New()
	p := fasthttpprom.NewPrometheus("")
	p.Use(r)

	r.GET("/health", func(ctx *fasthttp.RequestCtx) {
		ctx.SetStatusCode(200)
		ctx.SetBody([]byte(`{"status": "pass"}`))
		log.Println(string(ctx.Request.URI().Path()))
	})

	log.Println("main is listening on ", "8080")
	log.Fatal(fasthttp.ListenAndServe(":"+"8080", p.Handler))

}

# Functions

NewMiddleware is.
No description provided by the author

# Variables

No description provided by the author

# Structs

Prometheus contains the metrics gathered by the instance and its path.