{"id":26879822,"url":"https://github.com/d4rckh/voltgate","last_synced_at":"2025-10-15T05:13:22.789Z","repository":{"id":279409714,"uuid":"938713925","full_name":"d4rckh/voltgate","owner":"d4rckh","description":"lightweight reverse proxy written in go with prometheus, loki integration, rate limiting and caching","archived":false,"fork":false,"pushed_at":"2025-02-28T12:29:30.000Z","size":178,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T16:24:00.446Z","etag":null,"topics":["caching","edge-proxy","go","http","http-proxy","loki","monitoring","prometheus","proxy","rate-limiting","redis","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d4rckh.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-02-25T11:41:49.000Z","updated_at":"2025-05-10T03:50:36.000Z","dependencies_parsed_at":"2025-02-25T12:36:40.622Z","dependency_job_id":"1c7962a2-da75-47bf-85d5-513230938c24","html_url":"https://github.com/d4rckh/voltgate","commit_stats":null,"previous_names":["d4rckh/voltgate-proxy","d4rckh/voltgate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d4rckh/voltgate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rckh%2Fvoltgate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rckh%2Fvoltgate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rckh%2Fvoltgate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rckh%2Fvoltgate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4rckh","download_url":"https://codeload.github.com/d4rckh/voltgate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rckh%2Fvoltgate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279052476,"owners_count":26093930,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["caching","edge-proxy","go","http","http-proxy","loki","monitoring","prometheus","proxy","rate-limiting","redis","reverse-proxy"],"created_at":"2025-03-31T13:33:22.301Z","updated_at":"2025-10-15T05:13:22.747Z","avatar_url":"https://github.com/d4rckh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Voltgate\n\n## Features\n- Reverse proxy supporting multiple services and domains\n- Basic rate limiting with Redis\n- Basic caching with Redis\n- Hot reloading of endpoints and services\n- Log publishing to Loki\n\n### Docker-compose example\n```yaml\nservices:\n  proxy:\n    image: d4rckh/voltgate:latest\n    ports:\n      - \"80:80\" # proxy port\n      - \"9999:9999\" # management port\n    volumes:\n      - ./voltgate.yaml:/app/config.yaml\n```\n\n### Minimal Configuration Example (config.yaml)\n```yaml\nservices:\n  - name: service_name\n    url: http://localhost:9090\n\nendpoints:\n  - host: domain.com\n    service: service_name\n```\n\n## Grafana Dashboard\n\nUsing the [grafana.json](grafana.json) file you can import the dashboard below in your instance!\n\n![grafana.png](grafana.png)\n\n\n### All Configurations Example (config.yaml)\n```yaml\nmanagement:\n  address: \":9999\"\n    # Default: \":9999\"\nproxy:\n  address: \":80\"\n    # Default: \":80\"\n\nconfig:\n  reload_interval: 10\n    # Reloads monitoring, services, and endpoints every 10 seconds\n    # Default: do not reload\n\nstorage:\n  redis:\n    address: localhost:6379\n    password: my-password\n    username: my-username\n      # Configure Redis for use in rate limiting\n\nrate_limit:\n  storage: redis\n    # Use Redis for rate limiting\n    # Default: memory (Not recommended for production!)\n\ncache:\n  storage: redis\n    # Use Redis for caching\n    # Default: memory (Not recommended for production!)\n\nmonitoring:\n  loki: http://localhost:3100/loki/api/v1/push\n    # Publishes logs to Loki\n    # Default: do not publish\n  prometheus: true\n    # Exposes /metrics on the management address\n    # Default: false\n\nservices:\n  - name: service_name\n    url: http://localhost:9090\n\nendpoints:\n  - host: domain.com\n    service: service_name\n    cache:\n      rules:\n        - path: \"^/myendpoint\"\n          ttl: 10 # seconds\n          params: [\"param1\", \"params2\"] # Optional array of params to construct the cache key, by default it will use all params\n            # Optional caching rules, will cache all GET requests that match the regex path, make sure to configure Redis for production \n    rate_limit:\n      rules:\n        - path: \"^/api/some_action\" # regex\n          method: POST # must be defined\n          window: 10 # seconds\n          requests: 2\n            # Optional rate limiting rules, make sure to configure Redis for production\n```\n\n## Metrics Overview\nVoltgate Proxy collects and exposes metrics to Prometheus for monitoring.\n\n### `http_requests_total` (Counter)\nCounts the total number of HTTP requests received.\n\n- **Type:** Counter\n- **Labels:**\n  - `method`: HTTP method (e.g., GET, POST)\n  - `host`: Original requested host\n  - `target_service_name`: Proxied service name\n  - `path`: Request path\n  - `status`: HTTP response status code\n\n#### Query Example:\n```promql\nrate(http_requests_total{method=\"GET\", status=\"200\"}[5m])\n```\n(Displays the rate of successful GET requests over 5 minutes.)\n\n### `http_blocked_requests_total` (Counter)\nCounts the total number of blocked HTTP requests.\n\n- **Type:** Counter\n- **Labels:**\n  - `method`: HTTP method (e.g., GET, POST)\n  - `host`: Original requested host\n  - `target_service_name`: Proxied service name\n  - `path`: Request path\n\n#### Query Example:\n```promql\nrate(http_blocked_requests_total[5m])\n```\n(Displays the rate of successful blocked requests over 5 minutes.)\n\n---\n### `http_request_duration_seconds` (Histogram)\nMeasures the duration of HTTP requests in seconds.\n\n- **Type:** Histogram\n- **Buckets:** Default Prometheus latency buckets (`0.005s`, `0.01s`, `0.025s`, ...)\n- **Labels:**\n    - `method`: HTTP method\n    - `host`: Requested host\n    - `target_service_name`: Proxied service name\n    - `path`: Request path\n\n#### Query Example:\n```promql\nhistogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))\n```\n(Displays the 95th percentile of request durations over the last 5 minutes.)\n\n---\n### `http_response_size_bytes` (Histogram)\nTracks the size of HTTP responses in bytes.\n\n- **Type:** Histogram\n- **Buckets:** Exponential buckets (starting at 100 bytes, scaling by a factor of 2, up to 10 steps)\n- **Labels:**\n    - `method`: HTTP method\n    - `host`: Requested host\n    - `target_service_name`: Proxied service name\n    - `path`: Request path\n\n#### Query Example:\n```promql\nhistogram_quantile(0.5, rate(http_response_size_bytes_bucket[5m]))\n```\n(Displays the median response size over the last 5 minutes.)\n\n## Accessing Metrics\nPrometheus metrics are available via an HTTP endpoint. Ensure the monitoring service is running and query the endpoint:\n\n```\nGET /metrics\n```\n\n### Prometheus Configuration\nAdd the following to `prometheus.yml` to enable scraping of the proxy service:\n```yaml\nscrape_configs:\n  - job_name: \"voltgate_proxy\"\n    static_configs:\n      - targets: [\"localhost:9999\"] # Management address set in the configuration\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rckh%2Fvoltgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4rckh%2Fvoltgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rckh%2Fvoltgate/lists"}