{"id":20059530,"url":"https://github.com/elli-lib/elli_prometheus","last_synced_at":"2026-03-04T18:02:50.034Z","repository":{"id":57494769,"uuid":"65605669","full_name":"elli-lib/elli_prometheus","owner":"elli-lib","description":"Elli middleware for collecting stats via Prometheus.","archived":false,"fork":false,"pushed_at":"2020-02-16T21:47:37.000Z","size":83,"stargazers_count":14,"open_issues_count":6,"forks_count":8,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-09-08T20:59:09.837Z","etag":null,"topics":["elli","metrics-gathering","middleware","prometheus","statistics"],"latest_commit_sha":null,"homepage":"https://github.com/elli-lib/elli_prometheus/blob/master/doc/elli_prometheus.md","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elli-lib.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-08-13T07:40:10.000Z","updated_at":"2023-03-31T05:17:38.000Z","dependencies_parsed_at":"2022-08-28T19:40:18.643Z","dependency_job_id":null,"html_url":"https://github.com/elli-lib/elli_prometheus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/elli-lib/elli_prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elli-lib","download_url":"https://codeload.github.com/elli-lib/elli_prometheus/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_prometheus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30088339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T15:40:14.053Z","status":"ssl_error","status_checked_at":"2026-03-04T15:40:13.655Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elli","metrics-gathering","middleware","prometheus","statistics"],"created_at":"2024-11-13T13:08:05.343Z","updated_at":"2026-03-04T18:02:50.004Z","avatar_url":"https://github.com/elli-lib.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elli_prometheus\n\n[![Hex.pm][hex badge]][hex package]\n[![Documentation][docs badge]][docs]\n[![Erlang][erlang badge]][erlang downloads]\n[![Travis CI][build badge]][travis link]\n[![Coveralls][coverage badge]][coveralls link]\n[![BSD-3 License][license badge]](LICENSE)\n\n*[Elli][] middleware for collecting stats via [Prometheus][].*\n\n## Metrics\n\nHow Elli represents timings:\n\n```\nrequest_start\n    headers_start\n    ...headers receiving \u0026  parsing...\n    headers_end\n\n    body_start\n    ...body receiving \u0026 parsing...\n    body_end\n\n    user_start\n    ...callback code...\n    user_end\n\n   send_start\n   ...sending reply....\n   send_end\nrequest_end\n```\n\nHow Elli represents sizes:\n\nEach request has `resp_headers` key and, depending on\nresponse type, `resp_body` or `file` or `chunks` key.\n\n- `resp_header` is always present and denotes response headers wire size;\n- `resp_body` set for regular responses;\n- `file` set for file responses;\n- `chunks` set for chunked responses, wire size too.\n\nElli_prometheus exports the following metrics:\n\n- `http_requests_total`, counter. Total count of requests;\n- `http_request_duration_microseconds`, histogram. The difference between\n   `request_end` and `request_start`;\n- `http_request_headers_microseconds`, histogram. The difference between\n  `headers_end` and `headers_start`;\n- `http_request_body_microseconds`, histogram. The difference between\n  `body_end` and `body_start`;\n- `http_request_user_microseconds`, histogram. The difference between\n  `user_end` and `user_start`;\n- `http_request_send_microseconds`, histogram. The difference between\n  `send_end` and `send_start`;\n\n- `http_response_size_bytes`, summary. Total size of the response, includes\n  headers, body|file|chuncks;\n- `http_response_headers_size_bytes`, summary. Size of the response headers;\n- `http_response_body_size`, summary.\n  Size of the response body;\n\nFor failed requests:\n- `http_requests_failed_total{reason}`, Total count of failed requests. Reasons:\n  - `request_closed` - the client closes the connection when Elli is waiting for\n  the next request;\n  - `request_timeout` - the client times out when Elli is waiting for the request;\n  - `request_parse_error` - the request is invalid and cannot be parsed or it\n  contains a path Elli cannot parse or doesn't support;\n  - `client_closed` - the client closes the connection or socket closed\n  unexpectedly;\n  - `client_timeout` - data can't be received within a timeout;\n  - `bad_request` - Elli detects a request isn't well formatted or doesn't conform\n  to the configured limits.\n- `http_bad_requests_total{reason}` - Total count of `bad_request` errors.\n  Reasons:\n  - `too_many_headers`;\n  - `body_size`.\n- `http_client_closed_total{request_part}` - Total count of `client_closed` errors.\n   Parts:\n   - `receiving_headers`;\n   - `receiving_body`;\n   - `before_response`.\n- `http_client_timeout_total{request_part}` Total count of `client_timeout` errors.\n  Parts:\n   - `receiving_headers`;\n   - `receiving_body`.\n\nExporter metrics:\n\n* `telemetry_scrape_duration_seconds`\u003cbr /\u003e\nType: summary.\u003cbr /\u003e\nLabels: `registry`, `content_type`.\u003cbr /\u003e\nScrape duration.\n\n* `telemetry_scrape_size_bytes`\u003cbr /\u003e\nType: summary.\u003cbr /\u003e\nLabels: `registry`, `content_type`.\u003cbr /\u003e\nScrape size, not encoded.\n\n* `telemetry_scrape_encoded_size_bytes`\u003cbr /\u003e\nType: summary.\u003cbr /\u003e\nLabels: `registry`, `content_type`, `encoding`.\u003cbr /\u003e\nScrape size, encoded.\n\n## Dependencies\n\n`elli_prometheus` requires [Elli][] and [Prometheus][], but neither are included\nin this project. It has been tested and is known to work with `{elli, \"2.0.1\"}`\nand `{prometheus, \"3.1.1\"}`.\n\n[hex badge]: https://img.shields.io/hexpm/v/elli_prometheus.svg?maxAge=2592000\n[hex package]: https://hex.pm/packages/elli_prometheus\n[erlang badge]: https://img.shields.io/badge/erlang-%E2%89%A518.0-red.svg\n[erlang downloads]: http://www.erlang.org/downloads\n[build badge]: https://travis-ci.org/elli-lib/elli_prometheus.svg?branch=develop\n[travis link]: https://travis-ci.org/elli-lib/elli_prometheus\n[docs badge]: https://img.shields.io/badge/docs-edown-green.svg\n[docs]: doc/README.md\n[coverage badge]: https://coveralls.io/repos/github/elli-lib/elli_prometheus/badge.svg?branch=develop\n[coveralls link]: https://coveralls.io/github/elli-lib/elli_prometheus?branch=develop\n[license badge]: https://img.shields.io/badge/license-BSD--3-blue.svg\n\n[Elli]: https://github.com/elli-lib/elli\n[Prometheus]: https://github.com/deadtrickster/prometheus.erl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felli-lib%2Felli_prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felli-lib%2Felli_prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felli-lib%2Felli_prometheus/lists"}