{"id":29403866,"url":"https://github.com/solvro/lib-backend-solvronis-metrics","last_synced_at":"2025-07-10T19:02:43.028Z","repository":{"id":297849369,"uuid":"998085837","full_name":"Solvro/lib-backend-solvronis-metrics","owner":"Solvro","description":"Prometheus metrics exporter for adonis","archived":false,"fork":false,"pushed_at":"2025-06-07T21:43:38.000Z","size":97,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-09T15:23:06.736Z","etag":null,"topics":["adonis","metrics","prometheus","request-timings","solvro","solvronis"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@solvro/solvronis-metrics","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Solvro.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,"zenodo":null}},"created_at":"2025-06-07T20:44:32.000Z","updated_at":"2025-06-08T11:12:07.000Z","dependencies_parsed_at":"2025-06-07T22:30:15.545Z","dependency_job_id":null,"html_url":"https://github.com/Solvro/lib-backend-solvronis-metrics","commit_stats":null,"previous_names":["solvro/lib-backend-solvronis-metrics"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Solvro/lib-backend-solvronis-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solvro%2Flib-backend-solvronis-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solvro%2Flib-backend-solvronis-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solvro%2Flib-backend-solvronis-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solvro%2Flib-backend-solvronis-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Solvro","download_url":"https://codeload.github.com/Solvro/lib-backend-solvronis-metrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Solvro%2Flib-backend-solvronis-metrics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264637898,"owners_count":23642070,"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":["adonis","metrics","prometheus","request-timings","solvro","solvronis"],"created_at":"2025-07-10T19:01:20.556Z","updated_at":"2025-07-10T19:02:43.023Z","avatar_url":"https://github.com/Solvro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solvronis metrics\n\nA request metrics collector \u0026 exporter, compatible with prometheus, that we built because the prometheus exporter format is way too simple to justify using an existing library.\n\n## Collected metrics\n\n- response counts (grouped by route, method and response status)\n- response timings (available as summaries on the route+method+status level, the route+method level, and the global level)\n\n## How 2 install\n\nTo start recording metrics, add the middleware to the global middleware list in `start/kernel.ts`, **as the first item on the list**.\nRequest timings might not include the run time of middleware above the metrics middleware on the list.\n\n```ts\nserver.use([\n  () =\u003e import(\"@solvro/solvronis-metrics\"),\n  // any other middleware you may have goes here\n]);\n```\n\nTo export metrics, register the `emitMetrics` method on the middleware as a controller for the `GET /metrics` route.\nIf you want to add additional metrics, you can instead write a custom controller, that appends your own metrics to metrics generated by `emitMetrics`.\nThe `emitMetrics` function is also available as a named export for this purpose.\n\n```ts\nconst MetricsMiddleware = () =\u003e import(\"@solvro/solvronis-metrics\");\n\nrouter.get(\"/metrics\", [MetricsMiddleware, \"emitMetrics\"]);\n```\n\n## License\n\nThis library is licensed under MPL-2.0.\n\n## Special thanx\n\nSpecial thanks to the editors of the [English Wikipedia page on Percentiles](https://en.wikipedia.org/wiki/Percentile#The_nearest-rank_method),\nfrom which I've taken the method of calculating arbitrary percentiles from a sorted list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolvro%2Flib-backend-solvronis-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolvro%2Flib-backend-solvronis-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolvro%2Flib-backend-solvronis-metrics/lists"}