golang-apm

module
v1.0.95 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0

README

golang-apm

go get github.com/middleware-labs/golang-apm


import (
	track "github.com/middleware-labs/golang-apm/tracker"
	"github.com/middleware-labs/golang-apm/logger"
)

func main() {
	track.Track(
		track.WithConfigTag("service", "your service name"),
		track.WithConfigTag("projectName", "your project name"),
	)
	
	logger.Error("Error")
	
	logger.Info("Info")
	
	logger.Warn("Warn")
	
	logger.Debug("Debug")
}

If you want to record exception in traces then you can use track.RecordError(ctx,error) method.


app.get('/hello', (req, res) => {
    ctx := req.Context()
    try {
        throw ("error");
    } catch (error) {
        track.RecordError(ctx, error)
    }
})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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