Installation steps

  1. Get the latest Go agent from

    copy
    icon/buttons/copy
    go get go.atatus.com/agent/module/atgoredis
    
  2. 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.

    copy
    icon/buttons/copy
        import (
            "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())
        }
    
  3. Update your go module dependency.

    go mod tidy
    
  4. 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