Closed frouioui closed 3 years ago
Some research about how to trace spans with Jaeger all the way to Redis has been done. The package https://godoc.org/github.com/opencensus-integrations/redis seems to contain a nice interface to send contexts.
Moreover, go-redis packages seem to handle cluster, cache, and open tracing natively. The following repo is a library for using Redis cache: https://github.com/go-redis/cache, and https://github.com/go-redis/redis is the usual Redis go package. The library official website shows how to integrate open tracing.
The cache implementation made in 2e00f6e and e9ad379 allows a great decrease of the overall query time. Cache TTL was setup to 1 minute.
As we can see, the first trace does not contain cache. We cached Vitess' response, making the second span go much quicker.
Tracing is not yet implemented all the way to Redis.
As #41 mentions, tracing all the way to Redis nodes wont be done in this PR.
A more optimal way to use Redis can be done in the redis.go
file of both API's server package. A set and get function could take an interface.
This PR contains the changes required by #38. A Redis Cluster is being implemented. Allowing the APIs to cache the request that are being made to Vitess.