go-redis
go-redis copied to clipboard
Add read/write instrumentation via OpenTelemetry
Part of: #1392
Description
This PR adds read/write metrics to go-redis/redis. The following instruments were added:
- The number of reads
- The number of bytes written
- The number of bytes read
- Errors (read/write)
I embedded net.Conn
into a tracedConn
struct that enabled me to collect bytes written/read. Let me know what you think of this approach.
TODO
- There are general semantic conventions regarding attributes/labels. I would like to add the necessary labels to the metrics, but I would like to get approval of my general approach to collecting read/write bytes first, before adding the labels.
/cc @nlehrer @danherr
This pull request is marked stale. It will be closed in 30 days if it is not updated.