nrgochi

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GochiImportPath = "github.com/go-chi/chi/v5"
)
View Source
const (
	NrChiImportPath = "github.com/newrelic/go-agent/v3/integrations/nrgochi"
)

Variables

This section is empty.

Functions

func GetChiRouterName

func GetChiRouterName(stmt dst.Stmt) string

Return the variable name of the Chi router object. Ex:

router := chi.NewRouter()
^^^^^^

func InstrumentChiMiddleware

func InstrumentChiMiddleware(manager *parser.InstrumentationManager, stmt dst.Stmt, c *dstutil.Cursor, tracing *tracestate.State) bool

InstrumentChiMiddleware detects whether a Chi Router has been initialized and adds New Relic Go Agent Middleware via the router.Use() method to instrument the routes registered to the router.

func InstrumentChiRouterLiteral

func InstrumentChiRouterLiteral(manager *parser.InstrumentationManager, stmt dst.Stmt, c *dstutil.Cursor, tracing *tracestate.State) bool

InstrumentChiRouterLiteral detects if a Chi Router route uses a function literal and adds Txn/Segment tracing logic directly to the function literal block.

func NrChiMiddleware

func NrChiMiddleware(routerName string, agentVariableName dst.Expr) (*dst.ExprStmt, string)

Inject NR Middleware instrumentation logic to the Chi application via the `Use` directive. Ex:

router := chi.NewRouter()
router.Use(nrgochi.Middleware(app)) <--- Midddleware injection

Types

This section is empty.

Jump to

Keyboard shortcuts

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