{"id":13582011,"url":"https://github.com/rrreeeyyy/prometheus-http-sd","last_synced_at":"2026-02-03T01:52:56.087Z","repository":{"id":57652489,"uuid":"136529139","full_name":"rrreeeyyy/prometheus-http-sd","owner":"rrreeeyyy","description":"Prometheus service discovery using with HTTP API and file_sd_config.","archived":false,"fork":false,"pushed_at":"2021-12-15T01:58:33.000Z","size":6058,"stargazers_count":24,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-01T17:04:45.249Z","etag":null,"topics":["prometheus","prometheus-service-discovery"],"latest_commit_sha":null,"homepage":"","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/rrreeeyyy.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":"2018-06-07T20:44:33.000Z","updated_at":"2025-03-05T04:19:05.000Z","dependencies_parsed_at":"2022-08-25T20:12:13.214Z","dependency_job_id":null,"html_url":"https://github.com/rrreeeyyy/prometheus-http-sd","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrreeeyyy%2Fprometheus-http-sd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrreeeyyy%2Fprometheus-http-sd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrreeeyyy%2Fprometheus-http-sd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrreeeyyy%2Fprometheus-http-sd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rrreeeyyy","download_url":"https://codeload.github.com/rrreeeyyy/prometheus-http-sd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478102,"owners_count":20945256,"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":["prometheus","prometheus-service-discovery"],"created_at":"2024-08-01T15:02:22.973Z","updated_at":"2026-02-03T01:52:56.039Z","avatar_url":"https://github.com/rrreeeyyy.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"Since prometheus version 2.28, Prometheus provides a generic HTTP Service discovery.\nWe recommend to use prometheus native http_sd feature.\n\nhttps://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config\n\n# prometheus-http-sd\n\nPrometheus service discovery using with HTTP API and `file_sd_config`.\n\n## Install\n\n### Precompiled binaries\n\nDownload from https://github.com/rrreeeyyy/prometheus-http-sd\n\n### Docker\n\n```\ndocker pull rrreeeyyy/prometheus-http-sd\n```\n\n## Usage\n\n- Run a single API endpoint\n\n    ```\n    ./prometheus-http-sd --api.url=\"http://api.example.com/service_discovery.json\" --output.file=/path/to/http_sd.json --refresh.interval=60\n    ```\n\n- Run multiple API endpoints\n\n    ```\n    ./prometheus-http-sd --api.url=\"http://api.example.com/foo_service_discovery.json\" --output.file=/path/to/http_foo_sd.json --api.url=\"http://api.example.com/bar_service_discovery.json\" --output.file=/path/to/http_bar_sd.json --refresh.interval=60\n    ```\n\n## HTTP API format\n\nHTTP API response should be follow prometheus `file_sd_config` format like below:\n\n```json\n[\n\t{\n\t\t\"targets\": [\n\t\t\t\"192.0.2.1:8080\",\n\t\t\t\"192.0.2.2:8080\",\n\t\t],\n\t\t\"labels\": {\n\t\t\t\"service\": \"web\",\n\t\t\t\"role\": \"role-1\"\n\t\t}\n\t},\n\t{\n\t\t\"targets\": [\n\t\t\t\"192.0.3.1:3306\"\n\t\t],\n\t\t\"labels\": {\n\t\t\t\"service\": \"db\",\n\t\t\t\"role\": \"role-2\"\n\t\t}\n\t}\n]\n```\n\n## Example prometheus settings\n\nThe part of your `prometheus.yml` is probably as follows.\n\n```\n  scrape_configs:\n    - job_name: 'http_sd'\n      file_sd_configs:\n        - files:\n          - /path/to/http_sd.json\n```\n\n## Metrics\n\n- `prometheus_sd_http_http_requests_total`\n\t- labels\n\t\t- `api_url`: target API URL\n\t\t- `code`: http response code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrreeeyyy%2Fprometheus-http-sd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frrreeeyyy%2Fprometheus-http-sd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrreeeyyy%2Fprometheus-http-sd/lists"}