{"id":20980692,"url":"https://github.com/statful/statful-middleware-express","last_synced_at":"2025-05-14T15:30:50.228Z","repository":{"id":22530387,"uuid":"96614286","full_name":"statful/statful-middleware-express","owner":"statful","description":"Middleware for Express servers to gather and send metrics to Statful.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:44:25.000Z","size":1223,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-29T14:07:53.663Z","etag":null,"topics":["express","expressjs","metrics","middleware","nodejs","performance","restify","statful"],"latest_commit_sha":null,"homepage":"https://www.statful.com/","language":"JavaScript","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/statful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-08T11:16:42.000Z","updated_at":"2021-05-17T07:51:24.000Z","dependencies_parsed_at":"2024-10-20T14:50:37.447Z","dependency_job_id":null,"html_url":"https://github.com/statful/statful-middleware-express","commit_stats":{"total_commits":30,"total_committers":7,"mean_commits":4.285714285714286,"dds":0.6666666666666667,"last_synced_commit":"a244c7a236b491b8a10d7bb458792cb63551a250"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-middleware-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-middleware-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-middleware-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-middleware-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statful","download_url":"https://codeload.github.com/statful/statful-middleware-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253411528,"owners_count":21904147,"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":["express","expressjs","metrics","middleware","nodejs","performance","restify","statful"],"created_at":"2024-11-19T05:29:39.440Z","updated_at":"2025-05-14T15:30:49.450Z","avatar_url":"https://github.com/statful.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# statful-middleware-express\n\nA common pattern in expressjs/restify applications it to gather response times from all received requests, this middleware takes care of collecting common useful metrics automatically.\n\n[![npm version](https://badge.fury.io/js/statful-middleware-express.svg)](https://badge.fury.io/js/statful-middleware-express) [![Build Status](https://travis-ci.org/statful/statful-middleware-express.svg?branch=master)](https://travis-ci.org/statful/statful-middleware-express)\n\n## Installing\n\n```shell\nnpm install --save statful-middleware-express statful-client\n```\n\n```shell\nyarn add statful-middleware-express statful-client\n```\n\n## Getting started\n\n```js\nconst express = require(\"express\");\nconst Statful = require(\"statful-client\");\nconst statfulMiddleware = require(\"statful-middleware-express\");\n\nconst app = express();\nconst statful = new Statful({\n  /* statful configuration */\n});\n\napp.use(statfulMiddleware(statful));\napp.listen(3000);\n```\n\n## Configuration\n\nMost of the configuration is done directly in the statful instance. You can read more about the available options directly from the [Statful repository](https://github.com/statful/statful-client-nodejs#global-configuration).\n\n## Default Metrics\n\nBy default, the follow metrics are collected, with the corresponding tags:\n\n- `response_time`\n  - `hostname`\n  - `method`: GET, POST, PUT ...\n  - `statusCode`: 200, 400, 404 ...\n  - `statusCodeCategory`\n    - informational\n    - success\n    - redirection\n    - client_error\n    - server_error\n  - `route`: Either the route handler's name, the route path or `unknown_route`. e.g.: `/users/:id?`\n\n## Authors\n\n[Mindera - Software Craft](https://github.com/Mindera)\n\n## License\n\nstatful-middleware-express is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/statful/statful-middleware-express/master/LICENSE.md) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-middleware-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatful%2Fstatful-middleware-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-middleware-express/lists"}