{"id":13983945,"url":"https://github.com/miekg/caddy-prometheus","last_synced_at":"2025-07-21T23:31:35.741Z","repository":{"id":57480543,"uuid":"52715868","full_name":"miekg/caddy-prometheus","owner":"miekg","description":"Prometheus metrics middleware for caddy","archived":true,"fork":true,"pushed_at":"2019-08-13T18:59:48.000Z","size":48,"stargazers_count":65,"open_issues_count":15,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-28T22:35:58.049Z","etag":null,"topics":["caddy","go","metrics","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"captncraig/caddy-stats","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miekg.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":"2016-02-28T10:28:46.000Z","updated_at":"2024-01-25T08:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/miekg/caddy-prometheus","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/miekg/caddy-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miekg%2Fcaddy-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miekg%2Fcaddy-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miekg%2Fcaddy-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miekg%2Fcaddy-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miekg","download_url":"https://codeload.github.com/miekg/caddy-prometheus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miekg%2Fcaddy-prometheus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266403045,"owners_count":23923403,"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-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["caddy","go","metrics","prometheus"],"created_at":"2024-08-09T05:02:02.625Z","updated_at":"2025-07-21T23:31:35.480Z","avatar_url":"https://github.com/miekg.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Metrics\n\nThis module enables prometheus metrics for Caddy.\n\n## Use\n\nIn your `Caddyfile`:\n\n~~~\nprometheus\n~~~\n\nFor each virtual host that you want to see metrics for.\n\nThese are the (optional) parameters that can be used:\n\n  - **use_caddy_addr** - causes metrics to be exposed at the same address:port as Caddy itself. This can not be specified at the same time as **address**.\n  - **address** - the address where the metrics are exposed, the default is `localhost:9180`\n  - **path** - the path to serve collected metrics from, the default is `/metrics`\n  - **hostname** - the `host` parameter that can be found in the exported metrics, this defaults to the label specified for the server block\n  - **label** - Custom label to add on all metrics.\n    This directive can be used multiple times.  \n    You should specify a label name and a value.  \n    The value is a [placeholder](https://caddyserver.com/docs/placeholders) and can be used to extract value from response header for instance.  \n    Usage: `label route_name {\u003cX-Route-Name}`\n\nWith `caddyext` you'll need to put this module early in the chain, so that\nthe duration histogram actually makes sense. I've put it at number 0.\n\n## Metrics\n\nThe following metrics are exported:\n\n* caddy_http_request_count_total{host, family, proto}\n* caddy_http_request_duration_seconds{host, family, proto}\n* caddy_http_response_latency_seconds{host, family, proto, status}\n* caddy_http_response_size_bytes{host, family, proto, status}\n* caddy_http_response_status_count_total{host, family, proto, status}\n\nEach metric has the following labels:\n\n* `host` which is the hostname used for the request/response,\n* `family` which is the protocol family, either 1 (IP version 4) or 2 (IP version 6),\n* `proto` which is the HTTP protocol major and minor version used: 1.x or 2 signifying HTTP/1.x or HTTP/2.\n\nThe `response_*` metrics have an extra label `status` which holds the status code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiekg%2Fcaddy-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiekg%2Fcaddy-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiekg%2Fcaddy-prometheus/lists"}