{"id":19308729,"url":"https://github.com/mtulio/prometheus-sd-redis","last_synced_at":"2026-05-12T12:42:07.401Z","repository":{"id":89055505,"uuid":"192259843","full_name":"mtulio/prometheus-sd-redis","owner":"mtulio","description":"Prometheus File Service Discovery for Redis Cluster and Standalone","archived":false,"fork":false,"pushed_at":"2019-06-30T07:31:20.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-10T00:02:38.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtulio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-17T02:14:26.000Z","updated_at":"2024-06-19T07:44:59.389Z","dependencies_parsed_at":"2023-06-13T17:54:08.279Z","dependency_job_id":null,"html_url":"https://github.com/mtulio/prometheus-sd-redis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-sd-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-sd-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-sd-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtulio%2Fprometheus-sd-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtulio","download_url":"https://codeload.github.com/mtulio/prometheus-sd-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240409849,"owners_count":19796797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T00:16:16.647Z","updated_at":"2026-05-12T12:42:07.371Z","avatar_url":"https://github.com/mtulio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus-sd-redis\n\nPrometheus File Service Discovery for Redis Cluster and Standalone.\n\nThis job discovery redis endpoints and use [redis exporter](https://github.com/oliver006/redis_exporter#prometheus-configuration-to-scrape-multiple-redis-hosts) to scrape metrics from multiple redis hosts.\n\n## Config\n\nFirst of all you need to create an config file for each service to discover. In general each server could be an group of common servers to be disvered, E.g: an Redis Cluster, then one extra labels could be added that will be attached on the list of labels of the jobs.\n\nSee an example of config:\n\n```json\n{\n    \"services\": [\n        {\n            \"type\": \"cluster\",\n            \"job\": \"redis\",\n            \"url\": \"redis-cluster-ecache.sample:6379\",\n            \"labels\":\n                {\n                    \"type\": \"cluster\",\n                    \"name\": \"rcluster-elasticache\"\n                }\n        },\n        {\n            \"type\": \"cluster\",\n            \"job\": \"redis\",\n            \"url\": \"redis-cluster-ec2.sample:7500\",\n            \"labels\":\n                {\n                    \"type\": \"cluster\",\n                    \"name\": \"rcluster-ec2\"\n                }\n        }\n    ]\n}\n```\n\n* `services`: list of services\n* `type`: could be `cluster` or `standalone`, is the type of the endpoint, and the way that the discovery will be done.\n* `job`: the job name of Prometheus.\n* `url`: the URL of one node of the server. Baseline to discovery\n* `labels`: extra labels that will be attached to the discovery file used by Prometheus' SD `file_sd_configs`.\n\n## Usage\n\n* One shot running:\n\n```bash\n./prometheus-sd-redis --in-file ./contrib/config-sample.json --out-file ./contrib/out.json\n```\n\n* Data generated on `./contrib/out.json`\n\n```json\n[\n {\n  \"targets\": [\n   \"172.18.92.63:6379\",\n   \"172.18.2.23:6379\",\n   \"172.18.83.251:6379\",\n   \"172.18.3.186:6379\",\n   \"172.18.89.24:6379\",\n   \"172.18.15.69:6379\",\n   \"172.18.82.197:6379\",\n   \"172.18.1.165:6379\"\n  ],\n  \"labels\": {\n   \"job\": \"redis\",\n   \"name\": \"rcluster-elasticache\",\n   \"type\": \"cluster\"\n  }\n },\n {\n  \"targets\": [\n   \"10.250.111.80:8800\",\n   \"10.250.110.120:8801\",\n   \"10.250.108.246:8800\",\n   \"10.250.108.47:8800\",\n   \"10.250.108.223:8801\",\n   \"10.250.110.238:8801\",\n   \"10.250.109.131:8801\",\n   \"10.250.108.246:8801\",\n   \"10.250.110.6:8801\",\n   \"10.250.108.143:8801\",\n   \"10.250.110.27:8801\",\n   \"10.250.109.106:8800\",\n   \"10.250.108.86:8801\",\n   \"10.250.111.21:8801\",\n   \"10.250.109.130:8800\",\n   \"10.250.109.9:8800\",\n   \"10.250.110.99:8801\",\n   \"10.250.109.131:8800\",\n   \"10.250.108.86:8800\",\n   \"10.250.111.73:8800\",\n   \"10.250.110.238:8800\",\n   \"10.250.110.209:8800\",\n   \"10.250.110.106:8801\",\n   \"10.250.109.130:8801\",\n   \"10.250.110.99:8800\",\n   \"10.250.111.73:8801\",\n   \"10.250.110.27:8800\",\n   \"10.250.110.106:8800\",\n   \"10.250.108.47:8801\",\n   \"10.250.110.156:8801\",\n   \"10.250.108.223:8800\",\n   \"10.250.111.21:8800\",\n   \"10.250.110.209:8801\",\n   \"10.250.111.80:8801\",\n   \"10.250.110.156:8800\",\n   \"10.250.109.9:8801\",\n   \"10.250.110.6:8800\",\n   \"10.250.109.106:8801\",\n   \"10.250.110.120:8800\",\n   \"10.250.108.143:8800\"\n  ],\n  \"labels\": {\n   \"job\": \"redis\",\n   \"name\": \"rcluster-ec2\",\n   \"type\": \"cluster\"\n  }\n }\n]\n```\n\n## Contribute\n\nOpen and PR or Issue. =)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtulio%2Fprometheus-sd-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtulio%2Fprometheus-sd-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtulio%2Fprometheus-sd-redis/lists"}