This package instruments the bradfitz/gomemcache package.
$ go get github.com/pinpoint-apm/pinpoint-go-agent/plugin/gomemcache
import "github.com/pinpoint-apm/pinpoint-go-agent/plugin/gomemcache"
This package instruments the gomemcache calls. Use the NewClient as the memcache.New.
mc := ppgomemcache.NewClient(addr...)
It is necessary to pass the context containing the pinpoint.Tracer to Client using Client.WithContext.
mc.WithContext(pinpoint.NewContext(context.Background(), tracer))
mc.Get("foo")
import (
"github.com/bradfitz/gomemcache/memcache"
"github.com/pinpoint-apm/pinpoint-go-agent"
"github.com/pinpoint-apm/pinpoint-go-agent/plugin/gomemcache"
)
func doMemcache(w http.ResponseWriter, r *http.Request) {
addr := []string{"localhost:11211"}
mc := ppgomemcache.NewClient(addr...)
mc.WithContext(r.Context())
item, err = mc.Get("foo")
...
}