{"id":15572893,"url":"https://github.com/restorando/monolith","last_synced_at":"2025-04-24T00:43:51.321Z","repository":{"id":57349937,"uuid":"67159095","full_name":"restorando/monolith","owner":"restorando","description":"`statsd` client wrapper and `express` middleware","archived":false,"fork":false,"pushed_at":"2017-04-20T16:07:05.000Z","size":10,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-08T07:47:41.747Z","etag":null,"topics":["express","expressjs","middleware","statsd"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/restorando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-01T19:12:11.000Z","updated_at":"2017-08-22T16:08:17.000Z","dependencies_parsed_at":"2022-09-16T02:01:04.830Z","dependency_job_id":null,"html_url":"https://github.com/restorando/monolith","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fmonolith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fmonolith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fmonolith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fmonolith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restorando","download_url":"https://codeload.github.com/restorando/monolith/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540945,"owners_count":21447426,"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","middleware","statsd"],"created_at":"2024-10-02T18:07:45.192Z","updated_at":"2025-04-24T00:43:51.294Z","avatar_url":"https://github.com/restorando.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monolith\nExpress middleware for your log-to-`statsd` needs.\n\n## Installation\n\n```\nnpm install --save redo-monolith\n```\n\n## Usage\n\n```js\nvar monolith = require('redo-monolith');\nvar statsd = monolith({\n  host: '127.0.0.1',\n  port: 8125,\n  queueHeader: 'X-Request-Start'\n});\n```\n\n### As an `express` middleware\n\n```js\nvar express = require('express');\nvar app = express();\n\nfunction sendFn(params) {\n  /**\n   *  `params` is an object with the following attributes for logging what you want about the request:\n   *  queueDuration: amount of time since the request has been enqueued by `nginx` until the request finishes\n   *  requestDuration: amount of time since the request started to be processed by `express` until it finishes\n   *  status: a `String` representation of the resulting HTTP status code\n   *  req: an `express#Request` object\n   *  res: an `express#Response` object\n   *  client: a `lynx` instance\n   */\n\n  params.client.increment(params.status);\n}\n\napp.use(statsd.middleware({ send: sendFn }))\n```\n\n### As a standalone statsd client\n\n```js\nstatsd.client.increment('myMetric');\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestorando%2Fmonolith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestorando%2Fmonolith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestorando%2Fmonolith/lists"}