apm-agent-go: github.com/elastic/apm-agent-go/module/apmbeego Index | Examples | Files

package apmbeego

import "github.com/elastic/apm-agent-go/module/apmbeego"

Package apmbeego provides tracing and error-reporting middleware for Beego applications.



Package Files

doc.go filter.go

func AddFilters Uses

func AddFilters(handlers *beego.ControllerRegister)

AddFilters adds required filters to handlers.

This is called automatically for the default app (beego.BeeApp), so if you beego.Router, beego.RunWithMiddleware, etc., then you do not need to call AddFilters.

func Middleware Uses

func Middleware(o ...Option) func(http.Handler) http.Handler

Middleware returns a beego.MiddleWare that traces requests and reports panics to Elastic APM.


beego.Router("/", &testController{})
beego.Router("/thing/:id:int", &testController{}, "get:Get")
beego.RunWithMiddleWares("localhost:8080", apmbeego.Middleware())

func WrapRecoverFunc Uses

func WrapRecoverFunc(config *beego.Config)

WrapRecoverFunc updates config's RecoverFunc so that panics will be reported to Elastic APM for traced requests. For non-traced requests, the original RecoverFunc will be called.

WrapRecoverFunc is called automatically for the global config, beego.BConfig.

type Option Uses

type Option func(*options)

Option sets options for tracing.

func WithTracer Uses

func WithTracer(t *apm.Tracer) Option

WithTracer returns an Option which sets t as the tracer to use for tracing server requests.

Package apmbeego imports 6 packages (graph). Updated 2020-05-24. Refresh now. Tools for package owners.