{"id":38803644,"url":"https://github.com/etf1/restify-prom-bundle","last_synced_at":"2026-01-17T12:48:44.107Z","repository":{"id":17280767,"uuid":"81614969","full_name":"etf1/restify-prom-bundle","owner":"etf1","description":"Restify prometheus middleware to expose HTTP metrics","archived":false,"fork":false,"pushed_at":"2023-01-11T12:51:45.000Z","size":254,"stargazers_count":6,"open_issues_count":16,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T03:33:33.519Z","etag":null,"topics":["nodejs","prometheus","restify"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/etf1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-10T23:03:43.000Z","updated_at":"2019-10-07T15:32:06.000Z","dependencies_parsed_at":"2023-01-13T19:15:15.725Z","dependency_job_id":null,"html_url":"https://github.com/etf1/restify-prom-bundle","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/etf1/restify-prom-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etf1%2Frestify-prom-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etf1%2Frestify-prom-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etf1%2Frestify-prom-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etf1%2Frestify-prom-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etf1","download_url":"https://codeload.github.com/etf1/restify-prom-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etf1%2Frestify-prom-bundle/sbom","scorecard":{"id":383742,"data":{"date":"2025-08-11","repo":{"name":"github.com/etf1/restify-prom-bundle","commit":"c6226d6f62a7131a9e5e27644aed05b6f879fc21"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 2/10 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"63 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-8w4h-3cm3-2pm2","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-582f-p4pg-xc74","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-446m-mv8f-q348","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-gqgv-6jq5-jjj9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T16:06:09.996Z","repository_id":17280767,"created_at":"2025-08-18T16:06:09.996Z","updated_at":"2025-08-18T16:06:09.996Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["nodejs","prometheus","restify"],"created_at":"2026-01-17T12:48:44.016Z","updated_at":"2026-01-17T12:48:44.079Z","avatar_url":"https://github.com/etf1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Restify middleware to export standard http prometheus metrics.\n\n[![dependencies Status](https://david-dm.org/etf1/restify-prom-bundle/status.svg)](https://david-dm.org/etf1/restify-prom-bundle) [![Build Status](https://travis-ci.org/etf1/restify-prom-bundle.svg?branch=master)](https://travis-ci.org/etf1/restify-prom-bundle) [![codecov](https://codecov.io/gh/etf1/restify-prom-bundle/branch/master/graph/badge.svg)](https://codecov.io/gh/etf1/restify-prom-bundle) [![Known Vulnerabilities](https://snyk.io/test/github/etf1/restify-prom-bundle/badge.svg)](https://snyk.io/test/github/etf1/restify-prom-bundle)\n\n## Usage\n\n```js\nconst promBundle = require('restify-prom-bundle');\nconst restify = require('restify');\n\nconst server = restify.createServer({ /* options */ });\n\nserver.pre(promBundle.preMiddleware(server, { /* options */ }));\n\nserver.get('/api', (req, res) =\u003e {\n  // Custom metrics can be added by using the client.\n  const counter = new promBundle.client.Gauge(\n    'my_custom_counter',\n    'My custom counter'\n  );\n\n  counter.inc();\n  res.end('OK');\n});\n\nserver.listen(8000);\n\n// The /metrics route is now available with metrics.\n```\n\nSince prom-client is a singleton, it can be accessed from everywhere by just require'ing / import the module, aggregated metrics will be exposed on the route.\n\n## API\n\n\n### preMiddleware(server[, options]) =\u003e `Restify.Handler`\n\nCreates the restify pre-middleware to\n\n- Creates the expose route used by prometheus server to index metrics\n- Setup default metrics you want to measure\n\nOptions :\n\n| Name               | Type        | Default      | Description |\n| ---------          | ---------   | ---------    | --------- |\n| route              | `string`    | `'/metrics'` | Exposed route (as GET) for metrics. If `false` no route will be exposed. |\n| defaults           | `string[] ` | All metrics  | Name of default metrics (see table below) to add for each routes. |\n| exclude            | `string` \u003cbr/\u003e `string[]`  \u003cbr/\u003e `RegExp`  \u003cbr/\u003e `Function` | `undefined` | URI(s), uri that match regular expression or uri that passed to function returns true that will be excluded from default metrics. |\n| promDefaultDelay   | `number `   | 10000        | How often (ms) should prom-client fire default probes |\n| maxPathsToCount    | `number `   | 100          | How many paths at max should we measure calls on (restify_path_count), use 0 for unlimited (See [below](#paths-limitation). |\n\nDefault metrics :\n\n| Name          | Metric Name           | Type        | Description |\n| ---------     | ---------             | ---------   | ---------   |\n| status        | restify_status_codes  | [Counter](https://github.com/siimon/prom-client#counter)      | Number of response for each HTTP status code with `status_code` as label. |\n| pathDuration  | restify_path_duration | [Histogram](https://github.com/siimon/prom-client#histogram)  | Duration (seconds) by percentiles taken by each restify-defined path to generate the response with the `path`, `status_code` and the `method` as labels.  |\n| pathCount     | restify_path_count    | [Counter](https://github.com/siimon/prom-client#counter)      | Number of calls to each path with the `path`, `status_code` and the `method` as labels. |\n\n`duration` metrics precision will depends on the pre-middleware registering order, the sooner you register (first `server.pre()` call), the better it will be.\n\n### `prom-client`: client\n\nSingleton instance of [prom-client](https://github.com/siimon/prom-client) to set custom metrics.\n\n## Paths limitation\n\nIf a huge number of different non-routed requests (404) are sent to the server, the process will have to keep a `restify_path_count` label for each one and the process memory will increase undefinitively.\nIn addition, the prometheus (and grafana) service that uses this probes will be flooded.\nTo prevent this situation, number of measured paths are limited to `maxPathsToCount`.\n\nThis does not affect `restify_path_duration` as it only measures the restify-defined paths, nor `restify_status_codes` as it's limited to HTTP status codes.\n\nOnce `maxPathsToMeasure` paths are measured, every new paths will be ignored for `restify_path_duration` and `restify_path_count`.\n\n## Grafana dashboard\n\nA sample grafana dashboard can be found [here](https://grafana.net/dashboards/1485) .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetf1%2Frestify-prom-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetf1%2Frestify-prom-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetf1%2Frestify-prom-bundle/lists"}