{"id":13582069,"url":"https://github.com/kha7iq/drl-exporter","last_synced_at":"2025-04-14T22:09:42.050Z","repository":{"id":65753604,"uuid":"335514861","full_name":"kha7iq/drl-exporter","owner":"kha7iq","description":"Prometheus exporter for dockerhub rate limits","archived":false,"fork":false,"pushed_at":"2024-10-18T04:53:42.000Z","size":2337,"stargazers_count":38,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T22:09:34.026Z","etag":null,"topics":["docker","dockerhub-rate-limit","golang","grafana","helm-chart","helm-charts","prometheus","prometheus-exporter"],"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/kha7iq.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":"2021-02-03T05:13:53.000Z","updated_at":"2025-03-27T07:11:36.000Z","dependencies_parsed_at":"2024-06-21T19:04:39.374Z","dependency_job_id":"29bc99f1-46a1-4d23-b452-1ba808022fb2","html_url":"https://github.com/kha7iq/drl-exporter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kha7iq%2Fdrl-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kha7iq%2Fdrl-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kha7iq%2Fdrl-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kha7iq%2Fdrl-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kha7iq","download_url":"https://codeload.github.com/kha7iq/drl-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968914,"owners_count":21191162,"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":["docker","dockerhub-rate-limit","golang","grafana","helm-chart","helm-charts","prometheus","prometheus-exporter"],"created_at":"2024-08-01T15:02:24.898Z","updated_at":"2025-04-14T22:09:42.032Z","avatar_url":"https://github.com/kha7iq.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cp align=\"center\"\u003e\u003cimg width=30% src=\"https://raw.githubusercontent.com/kha7iq/drl-exporter/master/.github/img/logo.png\"\u003e\u003c/p\u003e\n\u003c/h2\u003e\n\n\u003ch4 align=\"center\"\u003eDockerhub rate limit prometheus metrics exporter \u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://hub.docker.com/r/khaliq/drl-exporter\"\u003e\n    \u003cimg alt=\"Docker Image Size (latest by date)\" src=\"https://img.shields.io/docker/image-size/khaliq/drl-exporter?style=flat-square\u0026logo=docker\"\u003e\n    \u003ca href=\"https://hub.docker.com/r/khaliq/drl-exporter/tags\"\u003e\n    \u003cimg alt=\"Docker Image Version (latest by date)\" src=\"https://img.shields.io/docker/v/khaliq/drl-exporter?style=flat-square\u0026logo=docker\"\u003e\n    \u003ca href=\"https://hub.docker.com/r/khaliq/drl-exporter/tags\"\u003e\n    \u003cimg alt=\"Docker Pulls\" src=\"https://img.shields.io/docker/pulls/khaliq/drl-exporter\"\u003e\n    \u003ca href=\"https://github.com/kha7iq/drl-exporter/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/kha7iq/drl-exporter?style=flat-square\u0026logo=github\u0026logoColor=white\"\u003e\n    \u003ca href=\"https://github.com/kha7iq/drl-exporter/issues\"\u003e\n    \u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/kha7iq/drl-exporter?style=flat-square\u0026logo=github\u0026logoColor=white\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#about\"\u003eAbout\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#configuration-variables\"\u003eImage Configuration\u003c/a\u003e •\n  \u003ca href=\"#local-demo\"\u003eLocal Demo\u003c/a\u003e •\n  \u003ca href=\"#helm-chart\"\u003eHelm Chart\u003c/a\u003e •\n  \u003ca href=\"#todo\"\u003eTodo\u003c/a\u003e •\n  \u003ca href=\"#issues\"\u003eIssues\u003c/a\u003e •\n  \u003ca href=\"#acknowledgment\"\u003eAcknowledgment\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## About\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cp\u003eThis exporter allows to retrieve the DockerHub rate limit counts as scrape target for Prometheus.\nThe exporter obtains an auth token and then queries the Docker Hub registry with a HEAD request to parse RateLimit-Limit,\nRateLimit-Remaining and RateLimit-Reset into a Gauge metric.\nYou can use your Docker Hub credentials to authenticate, otherwise an anonymous token is used.\u003c/p\u003e\n\n## Screenshot\n\u003cp align=\"center\"\u003e\u003cimg width=70% src=\"https://raw.githubusercontent.com/kha7iq/drl-exporter/master/.github/img/dashboard.png\"\u003e\u003c/p\u003e\n\n## Usage\nMulti Arch docker images are available (arm64/amd64) you can pull it from dockerhub/github and run in your environment.\n\n\n## Docker\n\n```bash\n# \ndocker pull khaliq/drl-exporter:latest\ndocker pull ghcr.io/kha7iq/drl-exporter:latest\n\n# ARM \ndocker pull ghcr.io/kha7iq/drl-exporter:v2.1.3-arm64\ndocker pull khaliq/drl-exporter:v2.1.3-arm64\n\ndocker run -d -p 2121:2121  khaliq/drl-exporter:latest\n\ncurl localhost:2121/metrics\n```\n\n## Kubernetes\n\n1. Add chart repository\n```\nhelm repo add tektonops http://charts.tektonops.com\nhelm repo update\n```\n2. Install the chart\n```\nhelm install drl-exporter tektonops/drl-exporter\n```\n\n### Installing the Chart with Username and Password\nCustomize the chart by setting values at runtime or in the `values.yaml` file. \n\nTo use the exporter with a username and password, ensure `enableUserAuth=true` is set.\n\nRefer to the [chart repository](https://github.com/kha7iq/charts/tree/main/charts/drl-exporter) for all configuration options.\n\n```bash\nhelm install drl-exporter tektonops/drl-exporter \\\n --set exporter.auth.enabled=true \\\n --set exporter.auth.dockerHubUsername=\u003cusername\u003e \\\n --set exporter.auth.dockerHubPassword=\u003cpassword\u003e\n```\n\n### Output\n```text\n# HELP dockerhub_limit_max_requests_time Dockerhub rate limit maximum requests total time seconds\n# TYPE dockerhub_limit_max_requests_time gauge\ndockerhub_limit_max_requests_time 21600{reqsource=\"10.50.00.0\"}\n# HELP dockerhub_limit_max_requests_total Dockerhub rate limit maximum requests in given time\n# TYPE dockerhub_limit_max_requests_total gauge\ndockerhub_limit_max_requests_total 100{reqsource=\"10.50.00.0\"}\n# HELP dockerhub_limit_remaining_requests_time Dockerhub rate limit remaining requests time seconds\n# TYPE dockerhub_limit_remaining_requests_time gauge\ndockerhub_limit_remaining_requests_time 21600{reqsource=\"10.50.00.0\"}\n# HELP dockerhub_limit_remaining_requests_total Dockerhub rate limit remaining requests in given time\n# TYPE dockerhub_limit_remaining_requests_total gauge\ndockerhub_limit_remaining_requests_total 99{reqsource=\"10.50.00.0\"}\n```\n\u003cbr\u003e\n\n\n## Configuration Variables\n\n|          Variables         | Default Value  | Description |\n| -------------------------- | :----------------: | :-------------: |\n| EXPORTER_PORT           |         2121        |        Server listening port        |\n| ENABLE_USER_AUTH   |         false️         |        **Must** be set to **true** if providing username        |\n| DOCKERHUB_USER            |         \"\"         |        Dockerhub account        |\n| DOCKERHUB_PASSWORD        |         \"\"         |        Account password        |\n| DOCKERHUB_REPO_IMAGE |         ratelimitpreview/test         |        custom repository/image        |\n| ENABLE_FILE_AUTH |         false         |        Load auth credentials from docker config file\u003cbr\u003eat /$FILE_AUTH_DIR/config.json\u003cbr\u003eMust leave auth through ENV empty.       |\n| FILE_AUTH_DIR |         /config         |        Directory where config.json resides       |\n| ENABLE_IPV6   |         false           | Use IPv6 instead of IPv4 when fetching rate limits |\n| REQUEST_INTERVAL   |         15           | Specify the interval in seconds at which requests should be sent to Dockerhub |\n\u003cbr\u003e\n\nExample docker configuration config.json file below. \u003cbr\u003e\nNote that a more extensive configuration can be handled, as long as at least an 'auths' exists for `https://index.docker.io/v1/`, with a username and password.\n```\n{\n  \"auths\": {\n    \"https://index.docker.io/v1/\": {\n      \"username\": \"MyUsername\",\n      \"password\": \"MyPasswordOrToken\"\n    }\n  }\n}\n```\n\n\n- To build the image in your local environment\n```bash\ngit clone https://github.com/kha7iq/drl-exporter.git\ncd drl-exporter\nmake docker\n```\n\n## Local Demo\nYou can find the complete docker-compose file along with a dashboard under deploy folder to test it out.\n\n```bash\ncd deploy/docker-compose\ndocker-compose up -d\n```\n\n## Web UI\nWeb          | URL\n-------------|-------------\nGrafana      | http://localhost:3000\nPrometheus   | http://localhost:9090\nExporter     | http://localhost:8881\n\n\u003cbr\u003e\n\n\n## TODO\n- [x] Tests \n- [x] Helm Chart\n\u003cbr\u003e\n\n## Issues\nPlease open an issue if you are facing any problems.\n\u003cbr\u003e\n\n## Acknowledgments\nThis project is inspired by [Michael Friedrich's](https://gitlab.com/dnsmichi) amazing work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkha7iq%2Fdrl-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkha7iq%2Fdrl-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkha7iq%2Fdrl-exporter/lists"}