{"id":18767984,"url":"https://github.com/riemann/riemann-ruby-client","last_synced_at":"2025-04-06T07:14:54.276Z","repository":{"id":2416748,"uuid":"3384981","full_name":"riemann/riemann-ruby-client","owner":"riemann","description":"A Ruby client for the Riemann event system","archived":false,"fork":false,"pushed_at":"2025-01-15T18:34:13.000Z","size":193,"stargazers_count":65,"open_issues_count":4,"forks_count":27,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-30T06:08:31.036Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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.markdown","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-02-08T06:55:24.000Z","updated_at":"2024-07-20T11:58:25.000Z","dependencies_parsed_at":"2025-02-28T20:13:15.504Z","dependency_job_id":"8533e392-c457-41ba-8bd4-811663cb1c60","html_url":"https://github.com/riemann/riemann-ruby-client","commit_stats":null,"previous_names":["aphyr/riemann-ruby-client"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-ruby-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-ruby-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-ruby-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riemann%2Friemann-ruby-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riemann","download_url":"https://codeload.github.com/riemann/riemann-ruby-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445681,"owners_count":20939961,"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":["ruby"],"created_at":"2024-11-07T19:09:59.184Z","updated_at":"2025-04-06T07:14:54.252Z","avatar_url":"https://github.com/riemann.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Riemann Ruby Client\n\n[![CI](https://github.com/riemann/riemann-ruby-client/actions/workflows/ci.yml/badge.svg)](https://github.com/riemann/riemann-ruby-client/actions/workflows/ci.yml)\n\n## Installing\n\n```shell\ngem install riemann-client\n```\n\n## Use\n\n```ruby\nrequire 'riemann/client'\n\n# Create a client. Host, port and timeout are optional.\nc = Riemann::Client.new host: 'localhost', port: 5555, timeout: 5\n\n# Send a simple event\nc \u003c\u003c {service: 'testing', metric: 2.5}\n\n# Or a more complex one\nc \u003c\u003c {\n  host: 'web3',\n  service: 'api latency',\n  state: 'warn',\n  metric: 63.5,\n  description: \"63.5 milliseconds per request\",\n  time: Time.now.to_i - 10\n}\n\n# :host defaults to gethostname(). :time defaults to current unix time. You\n# can explicitly override host...\n\nc \u003c\u003c {host: nil, service: 'the cloud', state: 'nebulous'}\n\n# Get all the states from the server\nc['true']\n\n# Or specific states matching a query\nc['host =~ \"%.dc1\" and (state = \"critical\" or state = \"warning\")']\n\n```\n\n## Transports\n\n\nRiemann::Client sends small events over UDP by default, and uses TCP for\nqueries and large events. UDP sends are essentially \"shouting into the void\".\nThey will not block your application and are roughly an order of magnitude\nfaster than TCP, but you will not know if the server is down or encountered an\nerror. You can specify what transport to use by selecting a subclient:\n\n``` ruby\nc.udp \u003c\u003c { :state =\u003e \"ok\" } # =\u003e nil\nc.tcp \u003c\u003c { :state =\u003e \"ok\" } # =\u003e #\u003cMessage ...\u003e\nc.tcp[\"true\"]            # =\u003e [#\u003cEvent ... \u003e, ...]\nc.udp[\"true\"]            # =\u003e raise Riemann::Client::Unsupported\n```\n\n## Client state management\n\nRiemann::Client provides some classes to make managing state updates easier.\n\nRiemann::MetricThread starts a thread to poll a metric periodically, which can\nbe used to flush an accumulated value to ustate at regular intervals.\n\nRiemann::AutoState bundles a state and a client together. Any changes to the\nAutoState automatically send the new state to the client.\n\n## License\n\nThe MIT License\n\nCopyright (c) 2011-2024 Kyle Kingsbury\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friemann%2Friemann-ruby-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friemann%2Friemann-ruby-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friemann%2Friemann-ruby-client/lists"}