{"id":26264327,"url":"https://github.com/prometheus-erl/prometheus-cowboy","last_synced_at":"2025-04-30T14:10:25.625Z","repository":{"id":46158633,"uuid":"96009777","full_name":"prometheus-erl/prometheus-cowboy","owner":"prometheus-erl","description":"Expose Prometheus metrics using cowboy/cowboy2","archived":false,"fork":false,"pushed_at":"2025-02-25T11:51:41.000Z","size":2373,"stargazers_count":21,"open_issues_count":2,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-06T04:42:09.929Z","etag":null,"topics":["cowboy","erlang","instrumentation","monitoring","prometheus"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/prometheus-erl.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":"2017-07-02T07:53:44.000Z","updated_at":"2025-02-25T11:51:44.000Z","dependencies_parsed_at":"2025-02-25T12:37:21.101Z","dependency_job_id":"28d3f7c0-f466-4cab-881a-b15733a69218","html_url":"https://github.com/prometheus-erl/prometheus-cowboy","commit_stats":null,"previous_names":["prometheus-erl/prometheus-cowboy"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus-erl%2Fprometheus-cowboy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus-erl%2Fprometheus-cowboy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus-erl%2Fprometheus-cowboy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus-erl%2Fprometheus-cowboy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prometheus-erl","download_url":"https://codeload.github.com/prometheus-erl/prometheus-cowboy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243510127,"owners_count":20302294,"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":["cowboy","erlang","instrumentation","monitoring","prometheus"],"created_at":"2025-03-14T02:08:09.756Z","updated_at":"2025-03-14T02:08:10.340Z","avatar_url":"https://github.com/prometheus-erl.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus_cowboy #\n\n[![Hex.pm](https://img.shields.io/hexpm/v/prometheus_cowboy.svg?maxAge=2592000?style=plastic)](https://hex.pm/packages/prometheus_cowboy)\n[![Hex.pm](https://img.shields.io/hexpm/dt/prometheus_cowboy.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_cowboy)\n[![Hex\nDocs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/prometheus_cowboy/)\n[![GitHub Actions](https://github.com/prometheus-erl/prometheus-cowboy/actions/workflows/ci.yml/badge.svg)](https://github.com/prometheus-erl/prometheus-cowboy/actions/workflows/ci.yml)\n[![Codecov](https://codecov.io/github/prometheus-erl/prometheus-cowboy/graph/badge.svg?token=G9HB5UKNIY)](https://codecov.io/github/prometheus-erl/prometheus-cowboy)\n\n## Exporting metrics with handlers\n\nCowboy 1:\n\n```erlang\nRoutes = [\n          {'_', [\n                 {\"/metrics/[:registry]\", prometheus_cowboy1_handler, []},\n                 {\"/\", toppage_handler, []}\n                ]}\n         ]\n```\n\nCowboy 2:\n\n```erlang\nRoutes = [\n          {'_', [\n                 {\"/metrics/[:registry]\", prometheus_cowboy2_handler, []},\n                 {\"/\", toppage_handler, []}\n                ]}\n         ]\n```\n\n## Exporting Cowboy2 metrics\n\n```erlang\n    {ok, _} = cowboy:start_clear(http, [{port, 0}],\n                                 #{env =\u003e #{dispatch =\u003e Dispatch},\n                                   metrics_callback =\u003e fun prometheus_cowboy2_instrumenter:observe/1,\n                                   stream_handlers =\u003e [cowboy_metrics_h, cowboy_stream_h]})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprometheus-erl%2Fprometheus-cowboy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprometheus-erl%2Fprometheus-cowboy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprometheus-erl%2Fprometheus-cowboy/lists"}