{"id":18767981,"url":"https://github.com/riemann/riemann-nodejs-client","last_synced_at":"2025-04-04T15:06:36.300Z","repository":{"id":3776355,"uuid":"4853523","full_name":"riemann/riemann-nodejs-client","owner":"riemann","description":"node.js client for Riemann. Because you should be monitoring all of those non-blocking buffet plates.","archived":false,"fork":false,"pushed_at":"2025-02-18T00:38:33.000Z","size":138,"stargazers_count":60,"open_issues_count":3,"forks_count":20,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-28T14:06:08.409Z","etag":null,"topics":["nodejs"],"latest_commit_sha":null,"homepage":"","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/riemann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"perezd","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2012-07-01T21:27:52.000Z","updated_at":"2024-09-03T22:15:17.000Z","dependencies_parsed_at":"2024-04-11T15:25:57.338Z","dependency_job_id":"c88b1646-b19d-4d5f-8e9a-e7ee951c403d","html_url":"https://github.com/riemann/riemann-nodejs-client","commit_stats":{"total_commits":80,"total_committers":16,"mean_commits":5.0,"dds":0.625,"last_synced_commit":"4a639a72a285111471978bf1b73b04df08b0c3e9"},"previous_names":["perezd/riemann-nodejs-client"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-nodejs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-nodejs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-nodejs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-nodejs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riemann","download_url":"https://codeload.github.com/riemann/riemann-nodejs-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198449,"owners_count":20900079,"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":["nodejs"],"created_at":"2024-11-07T19:09:58.754Z","updated_at":"2025-04-04T15:06:36.266Z","avatar_url":"https://github.com/riemann.png","language":"JavaScript","funding_links":["https://github.com/sponsors/perezd"],"categories":[],"sub_categories":[],"readme":"# [Riemann](https://riemann.io) Node.js Client\n\n[![Riemann NodeJS Client testing](https://github.com/riemann/riemann-nodejs-client/actions/workflows/test.yml/badge.svg)](https://github.com/riemann/riemann-nodejs-client/actions/workflows/test.yml)\n\nbecause you should be monitoring all of those [non-blocking buffet plates.](http://www.infinitelooper.com/?v=-sfZqL4Plxc\u0026p=n#/242;267)\n\n## Installation\n\n```sh\nnpm install riemann\n```\n\n## Getting Started\n\nfirst things first, we'll want to establish a new client:\n\n```js\nvar client = require('riemann').createClient({\n  host: 'some.riemann.server',\n  port: 5555\n});\n\nclient.on('connect', function() {\n  console.log('connected!');\n});\n```\n\nPromise-based workflow is supported, too. Just pass 'returnPromise' flag set to _true_.\nAll the Client's methods will return promises in that case.\n\n```js\nvar client = await require('riemann').createClient({\n  host: 'some.riemann.server',\n  port: 5555,\n  returnPromise: true\n});\n```\n\nJust like [Riemann ruby client](https://github.com/aphyr/riemann-ruby-client), the client sends small events over UDP, by default. TCP is used for queries, and large events. There is no acknowledgement of UDP packets, but they are roughly an order of magnitude faster than TCP. We assume both TCP and UDP are listening to the same port.\n\nsending events is easy (see [list of valid event properties](http://aphyr.github.com/riemann/concepts.html)):\n\n```js\nclient.send(client.Event({\n  service: 'buffet_plates',\n  metric:  252.2,\n  tags:    ['nonblocking']\n}));\n```\n\nIf you wanted to send that message over TCP and receive an acknowledgement, you can specify the transport, explicitly:\n\n```js\nclient.on('data', function(ack) {\n  console.log('got it!');\n});\n\nclient.send(client.Event({\n  service: 'buffet_plates',\n  metric:  252.2,\n  tags:    ['nonblocking']\n}), client.tcp);\n\n// ... or via promises\n\nvar data = await client.send(client.Event({\n  service: 'buffet_plates',\n  metric:  252.2,\n  tags:    ['nonblocking']\n}), client.tcp);\n```\n\nYou can also send events with custom attributes:\n\n```js\nclient.send(client.Event({\n  service: 'buffet_plates',\n  metric: 150,\n  attributes: [{key: \"sessionID\", value: \"000-001-165\"}],\n  tags: ['nonblocking']\n}), client.tcp);\n```\n\n\nWhen you're done monitoring, disconnect:\n\n```js\nclient.on('disconnect', function(){\n  console.log('disconnected!');\n});\nclient.disconnect();\n\n// ... or just\n\nawait client.disconnect();\n```\n\n## Contributing\n\nContributing is easy, just send me a pull request. Please take a look at the project issues, to see how you can help. Here are some helpful tips:\n\n- install the dependencies using `npm install`.\n- install Riemann using the [quickstart instructions](http://riemann.io/quickstart.html). A running Riemann server is required to run the tests.\n- please add tests. I'm using [Mocha](https://mochajs.org/) as a test runner, you can run the tests using `npm run test`\n- please check your syntax with the included jshint configuration using `npm run lint`. It shouldn't report any errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friemann%2Friemann-nodejs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friemann%2Friemann-nodejs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friemann%2Friemann-nodejs-client/lists"}