# README
go get github.com/middleware-labs/golang-apm-beego-beego
Distributed Tracing
import (
"github.com/beego/beego/v2/server/web"
mwbeego "github.com/middleware-labs/golang-apm-beego-beego"
track "github.com/middleware-labs/golang-apm/tracker"
)
func main(){
config, _ := track.Track(
track.WithConfigTag("service", "your service name"),
track.WithConfigTag("projectName", "your project name"),
)
mware := mwbeego.MiddleWare(config.ServiceName)
web.RunWithMiddleWares(":7777", mware)
}
# Functions
MiddleWare creates a MiddleWare that provides OpenTelemetry tracing and metrics to a Beego web app.
Render traces beego.Controller.Render.
RenderBytes traces beego.Controller.RenderBytes.
RenderString traces beego.Controller.RenderString.
Template returns the template name as a KeyValue pair.
WithFilter adds the given filter for use in the middleware.
WithMeterProvider specifies a meter provider to use for creating a meter.
WithPropagators sets the propagators used in the middleware.
WithSpanNameFormatter sets the formatter to be used to format span names.
WithTracerProvider specifies a tracer provider to use for creating a tracer.
# Structs
Handler implements the http.Handler interface and provides trace and metrics to beego web apps.
# Interfaces
Option applies a configuration to the given config.
# Type aliases
Filter returns true if the request should be traced.
SpanNameFormatter creates a custom span name from the operation and request object.