{"id":41254638,"url":"https://github.com/c1982/redis-traffic-stats","last_synced_at":"2026-01-23T01:48:19.561Z","repository":{"id":45907952,"uuid":"315048146","full_name":"c1982/redis-traffic-stats","owner":"c1982","description":"Live monitor \u0026 analyze Redis queries on your client","archived":false,"fork":false,"pushed_at":"2021-01-31T21:24:00.000Z","size":993,"stargazers_count":84,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-06-20T06:31:45.693Z","etag":null,"topics":["monitor","prometheus","redis","resp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c1982.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-22T13:48:18.000Z","updated_at":"2024-05-15T20:17:57.000Z","dependencies_parsed_at":"2022-08-26T11:10:52.135Z","dependency_job_id":null,"html_url":"https://github.com/c1982/redis-traffic-stats","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/c1982/redis-traffic-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c1982%2Fredis-traffic-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c1982%2Fredis-traffic-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c1982%2Fredis-traffic-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c1982%2Fredis-traffic-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c1982","download_url":"https://codeload.github.com/c1982/redis-traffic-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c1982%2Fredis-traffic-stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monitor","prometheus","redis","resp"],"created_at":"2026-01-23T01:48:16.506Z","updated_at":"2026-01-23T01:48:19.555Z","avatar_url":"https://github.com/c1982.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis-traffic-stats\n\n`redis-traffic-stats` is a live monitor and analyze RESP packets in your server. This tool does not touch Redis Server.  Just monitors redis client request and response on the real time.\n\nAll redis stats exported as prometheus metrics so you can visualize analytics data on your favorite dashboard (like grafana).\n\nFeatures:\n\n* Live Monitoring\n* Low CPU utilization\n* Prometheus Exporter\n* Basic-Auth protection\n* Top commands of count\n* Top command and keys count\n* No dependencies\n* No Redis performance degradation\n\n![](./screen_shot.png)\n\n### Tasks:\n\n- [x] Count commands and arguments  \n- [ ] Count network traffic of command\n- [x] Monitor Slow commands\n- [x] Monitor big response\n\n## Installation\n\n* [redis-traffic-stats_linux_amd64](https://github.com/c1982/redis-traffic-stats/releases/download/v1.0.0/redis-traffic-stats_linux_amd64) \n\n## Usage\n\n```bash\n./redis-traffic-stats --interface=ens5 --addr=:9200 \\\n--password=pass \\\n--debug=false \\\n-s=: \\\n-r=\"[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\" \\\n--redisport=6379 \\\n--max=150 \\\n--slow-response-threshold=20ms\n--snaplen=50000\n```\n\nFlag | Default | Usage\n--- | --- | ---\ndebug | false | Enable debug logs\ninterface | empty | Ethernet infreface name. eth0, ens5\nredisport | 6379 | Redis server port number\naddr | :9200 | http listener port for prometheus metrics\nusername | admin | Prometheus metrics username\npassword | **** | Prometheus metrics password\ns | empty | Separator of keys (for split). If it empty does not split keys.\nr | empty | Regex pattern of keys (for clean)\nmax | 150 | Maximum lookup size of key. If value -1 unlimited lookup. \nslow-response-threshold | 500 | threshold for recording slow response. Millisecond\nbig-response-threshold | 1500 | threshold for recording slow response. Bytes\nsnap | 2048 | the maximum size to read for each packet (snaplen)\n\n### Grafana Dashboard\n\nThis easy way for dasboarding. You can upload to grafana [this](./grafana-dashboard.json) file.\n\n\n### Run test environment\n\n```bash\ndocker-compose up\n```\n\ngarafana:\n\n\u003e http://localhost:3000/\n\nprometheus:\n\n\u003e http://localhost:9090/\n\n### Static Compilation\n\nThis tool require libpcap library (https://www.tcpdump.org/). \nYou can embed dependencies on the compilation process. This helps for portability.\nCheck the build command below\n\n```bash\nLDFLAGS='-l/usr/lib/libpcap.a' CGO_ENABLED=1 go build -ldflags '-linkmode external -extldflags -static' .\n```\n\n### Troubleshooting\n\nIf you get an error about libpcap like below\n\n```bash\n./redis-traffic-stats: error while loading shared libraries: libpcap.so.0.8: cannot open shared object file: No such file or directory\n```\n\ninstall libpcap\n\nfor centos\n\u003eyum install libpcap-devel\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\n\nOğuzhan YILMAZ - [@c1982](https://twitter.com/c1982) - aspsrc@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc1982%2Fredis-traffic-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc1982%2Fredis-traffic-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc1982%2Fredis-traffic-stats/lists"}