nrgin

package
v3.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package nrgin instruments https://github.com/gin-gonic/gin applications.

Use this package to instrument inbound requests handled by a gin.Engine. Call nrgin.Middleware to get a gin.HandlerFunc which can be added to your application as a middleware:

router := gin.Default()
// Add the nrgin middleware before other middlewares or routes:
router.Use(nrgin.Middleware(app))

Example: https://github.com/newrelic/go-agent/tree/master/_integrations/nrgin/v1/example/main.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(app newrelic.Application) gin.HandlerFunc

Middleware creates a Gin middleware that instruments requests.

router := gin.Default()
// Add the nrgin middleware before other middlewares or routes:
router.Use(nrgin.Middleware(app))

func Transaction

func Transaction(c Context) newrelic.Transaction

Transaction returns the transaction stored inside the context, or nil if not found.

Types

type Context

type Context interface {
	Value(key interface{}) interface{}
}

Context avoids making this package 1.7+ specific.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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