nrfiber

package module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

README

v3/integrations/nrfiber GoDoc

Package nrfiber instruments https://github.com/gofiber/fiber applications.

import "github.com/newrelic/go-agent/v3/integrations/nrfiber"

For more information, see godocs.

Documentation

Overview

Package nrfiber instruments https://github.com/gofiber/fiber applications.

Use this package to instrument inbound requests handled by a fiber.App. Call nrfiber.Middleware to get a fiber.Handler which can be added to your application as a middleware:

app := fiber.New()
// Add the nrfiber middleware before other middlewares or routes:
app.Use(nrfiber.Middleware(newrelicApp))

Example: https://github.com/newrelic/go-agent/tree/master/v3/integrations/nrfiber/example/main.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(c *fiber.Ctx) *newrelic.Transaction

FromContext extracts a New Relic transaction from a Fiber context.

func Middleware

func Middleware(app *newrelic.Application) fiber.Handler

Middleware creates a Fiber middleware handler that instruments requests with New Relic. It starts a New Relic transaction for each request, sets web request and response details, and handles error tracking. If no New Relic application is configured, it passes the request through.

router := fiber.New()
// Add the nrfiber middleware before other middlewares or routes:
router.Use(nrfiber.Middleware(app))

func Transaction

func Transaction(ctx context.Context) *newrelic.Transaction

Transaction returns the Transaction from the context if it exists.

func WrapHandler

func WrapHandler(app *newrelic.Application, pattern string, handler fiber.Handler) fiber.Handler

WrapHandler wraps an existing Fiber handler with New Relic instrumentation

fiberApp := fiber.New()

wrappedHandler := WrapHandler(app.Application, "/wrapped", func(c *fiber.Ctx) error {
	 return c.SendString("Wrapped Handler")
})

fiberApp.Get("/wrapped", wrappedHandler)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL