Documentation ¶
Overview ¶
Package apmbeego provides tracing and error-reporting middleware for Beego applications.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFilters ¶
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 ¶
Middleware returns a beego.MiddleWare that traces requests and reports panics to Elastic APM.
Example ¶
beego.Router("/", &testController{}) beego.Router("/thing/:id:int", &testController{}, "get:Get") beego.RunWithMiddleWares("localhost:8080", apmbeego.Middleware())
Output:
func WrapRecoverFunc ¶
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.
Types ¶
type Option ¶
type Option func(*options)
Option sets options for tracing.
func WithTracer ¶
func WithTracer(t *apm.Tracer) Option
WithTracer returns an Option which sets t as the tracer to use for tracing server requests.