Skip to main content
Version: Next

Fgprof

Release Discord Test

fgprof support for Fiber.

Compatible with Fiber v3.

Go version support

We only support the latest two versions of Go. Visit https://go.dev/doc/devel/release for more information.

Install

Using fgprof to profiling your Fiber app.

go get -u github.com/gofiber/fiber/v3
go get -u github.com/gofiber/contrib/v3/fgprof

Config

PropertyTypeDescriptionDefault
Nextfunc(c fiber.Ctx) boolA function to skip this middleware when returned true.nil
Prefixstring.Prefix defines a URL prefix added before "/debug/fgprof". Note that it should start with (but not end with) a slash. Example: "/federated-fiber"""

Example

package main

import (
"log"

"github.com/gofiber/contrib/v3/fgprof"
"github.com/gofiber/fiber/v3"
)

func main() {
app := fiber.New()
app.Use(fgprof.New())
app.Get("/", func(c fiber.Ctx) error {
return c.SendString("OK")
})
log.Fatal(app.Listen(":3000"))
}
go tool pprof -http=:8080 http://localhost:3000/debug/fgprof