Installation steps
Get the latest Go agent from
copygo get go.atatus.com/agent/module/atgoredis
In order to capture redis latency, you have to wrap redis top level commands such as redis.Client, redis.ClusterClient, or redis.Ring. Then you need to associate APM context to the redis client using
WithContext
instead of standard background context.copyimport ( "github.com/go-redis/redis" "go.atatus.com/agent/module/atgoredis" ) func Connection(c echo.Context) error { redisClient := redis.NewClient(&redis.Options{ Addr: "localhost:6379", // host:port of the redis server Password: "", // no password set DB: 0, // use default DB }) client := atgoredis.Wrap(redisClient).WithContext(c.Request().Context()) }
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