{"id":24529260,"url":"https://github.com/opencomponents/oc-statsd","last_synced_at":"2025-06-24T13:04:52.290Z","repository":{"id":57313218,"uuid":"59307186","full_name":"opencomponents/oc-statsd","owner":"opencomponents","description":"OpenComponents statsd plugin","archived":false,"fork":false,"pushed_at":"2018-05-19T04:00:49.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-15T21:45:53.428Z","etag":null,"topics":["oc-plugin","opencomponents","statsd"],"latest_commit_sha":null,"homepage":null,"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/opencomponents.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-05-20T15:52:56.000Z","updated_at":"2018-05-08T09:33:12.000Z","dependencies_parsed_at":"2022-09-20T23:30:41.909Z","dependency_job_id":null,"html_url":"https://github.com/opencomponents/oc-statsd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/opencomponents/oc-statsd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencomponents%2Foc-statsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencomponents%2Foc-statsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencomponents%2Foc-statsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencomponents%2Foc-statsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencomponents","download_url":"https://codeload.github.com/opencomponents/oc-statsd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencomponents%2Foc-statsd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261111397,"owners_count":23111196,"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":["oc-plugin","opencomponents","statsd"],"created_at":"2025-01-22T07:35:40.883Z","updated_at":"2025-06-24T13:04:52.265Z","avatar_url":"https://github.com/opencomponents.png","language":"JavaScript","readme":"oc-statsd [![Build Status](https://secure.travis-ci.org/opencomponents/oc-statsd.png?branch=master)](http://travis-ci.org/opencomponents/oc-statsd)\n==========\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/opencomponents/oc-statsd.svg)](https://greenkeeper.io/)\n\n[OpenComponents](https://github.com/opentable/oc) plugin for interacting with [StatsD](https://github.com/etsy/statsd) inside OC components.\n\n# Requirements:\n\n* Node version: min: **6**\n* OC registry\n* StatsD server\n\n### Install\n\n```js\nnpm i oc-statsd --save\n```\n\n### Registry setup\n\nMore info about integrating OC plugins: [here](https://github.com/opentable/oc/wiki/Registry#plugins)\n\n```js\n...\nconst registry = oc.registry(configuration);\n\nregistry.register({\n  name: 'statsd',\n  register: require('oc-statsd'),\n  options: {\n    host: 'statsd.hosts.com',\n    prefix: 'oc-registry.prod.vm12345',\n    port: 8125,\n    debug: false\n  }\n}, (err) =\u003e {\n  if(err){\n    console.log('plugin initialisation failed:', err);\n  } else {\n    console.log('statsd now available');\n  }\n});\n\n...\n\nregistry.start(callback);\n```\n\n### Using it inside components\n\nExample for a components' server.js:\n\n```js\n\nmodule.exports.data = (context, callback) =\u003e {\n\n  const before = new Date();\n  const stats = context.plugins.statsd('mycomponent.doSomething');\n\n  doSomething(() =\u003e {\n    ...\n    stats.timing('something.happened', new Date() - before);\n    callback(null, { ... });\n  });\n};\n```\n\n### API\n\n#### Api for plugin setup:\n\n|parameter|type|mandatory|description|\n|---------|----|---------|-----------|\n|debug|`boolean`|no|Debug mode|\n|host|`string`|yes|The statsd host|\n|port|`number`|no|Default 8152, the statsd port|\n|prefix|`string`|yes|The statsd prefix|\n\n#### Api for plugin usage\n\nThe plugin name is declared when initialising a plugin. Following assumes `statsd` is the designated name.\n\n##### context.plugins.statsd(namespace)\n\nGets instance of statsd client in the supplied namespace.\n\n# Contributing\n\nYes please. Open an issue first.\n\n### License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencomponents%2Foc-statsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencomponents%2Foc-statsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencomponents%2Foc-statsd/lists"}