Installation steps
Get the latest Go agent from
copygo get go.atatus.com/agent
Add
atgorm
into*gorm.DB
.After gorm.Open, you need to call
db.WithContext
to propagate a transaction context to the Operations:copyimport ( "gorm.io/gorm" postgres "go.atatus.com/agent/module/atgormv2/driver/postgres" ) func main() { dsn := "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Chennai" db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) // ... db.WithContext(ctx).Find(...) // creates a "INSERT INTO <TABLE>" span }
Update your go module dependency.
go mod tidy
Restart your Echo server to view your performance data within minutes.
env ATATUS_LICENSE_KEY="lic_apm_aajer7238823kkdsv" ATATUS_APP_NAME="Go App" go run *.go