beego

command module
v0.0.0-...-316a413 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

README

Beego OpenTelemetry instrumentation example

PkgGoDev

Quickstart

Install otelbeego instrumentation:

go get go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego

Then install OpenTelemetry middleware:

// To enable tracing on template rendering, disable autorender and
// call otelbeego.Render manually.
beego.BConfig.WebConfig.AutoRender = false

mware := otelbeego.NewOTelBeegoMiddleWare("service-name")
beego.RunWithMiddleWares(":7777", mware)

Example

To run this example:

UPTRACE_DSN="https://<token>@api.uptrace.dev/<project_id>" go run main.go

Then open http://localhost:9999

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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