{"id":21304505,"url":"https://github.com/vassilevsky/influxdb-process","last_synced_at":"2025-03-15T19:22:17.927Z","repository":{"id":56877595,"uuid":"113506814","full_name":"vassilevsky/influxdb-process","owner":"vassilevsky","description":"Ruby process instrumentation to InfluxDB","archived":false,"fork":false,"pushed_at":"2018-03-05T20:26:16.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T23:45:44.902Z","etag":null,"topics":["influxdb","instrumentation","metrics","profiling","ruby"],"latest_commit_sha":null,"homepage":null,"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/vassilevsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-07T22:55:49.000Z","updated_at":"2018-03-06T08:21:27.000Z","dependencies_parsed_at":"2022-08-20T23:10:11.521Z","dependency_job_id":null,"html_url":"https://github.com/vassilevsky/influxdb-process","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vassilevsky%2Finfluxdb-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vassilevsky%2Finfluxdb-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vassilevsky%2Finfluxdb-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vassilevsky%2Finfluxdb-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vassilevsky","download_url":"https://codeload.github.com/vassilevsky/influxdb-process/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243778287,"owners_count":20346516,"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":["influxdb","instrumentation","metrics","profiling","ruby"],"created_at":"2024-11-21T16:08:42.324Z","updated_at":"2025-03-15T19:22:17.906Z","avatar_url":"https://github.com/vassilevsky.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/influxdb-process.svg)](https://badge.fury.io/rb/influxdb-process)\n[![Build Status](https://travis-ci.org/vassilevsky/influxdb-process.svg?branch=master)](https://travis-ci.org/vassilevsky/influxdb-process)\n\n# InfluxDB::Process\n\nGathers metrics from the Ruby process it is executed in and sends them to an InfluxDB database.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'influxdb-process'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr do all this at once:\n\n    $ bundle add influxdb-process\n\n## Usage\n\nThis library assumes that you already have a working InfluxDB client instance.\nIt does not attempt to create one for you.\nIf not, see [InfluxDB Ruby](https://github.com/influxdata/influxdb-ruby) for client initialization instructions.\nLet's say you have the client in the `influxdb` variable, as it says.\n\nAdd this to any place in your Ruby program:\n\n```ruby\nInfluxDB::Process::Instrumentation.new(influxdb).start\n```\n\nWhen you deploy this, the process where this code is executed will create a new thread.\nIt will periodically collect process metrics and send them to InfluxDB via the provided client.\n\nAlternatively, you can instrument whenever you want (after each request / job / batch):\n\n```ruby\n# in an initializer, once\np = InfluxDB::Process::Instrumentation.new(influxdb)\n\n# later, in an appropriate place, as many times as needed\np.instrument\n```\n\nYou can pass additional options to customize the behavior of this gem. Here they are (with default values):\n\n```ruby\nInfluxDB::Process::Instrumentation.new(\n  influxdb,\n  memory_series: 'process_memory',\n  object_series: 'process_objects',\n  interval: 10, # seconds\n  process: $PROGRAM_NAME\n)\n```\n\nMetrics will be tagged with process name.\nBy default, `$0`/`$PROGRAM_NAME` will be used.\nYou can set your own process name via an additional keyword argument in the constructor. For example:\n\n```ruby\nInfluxDB::Process::Instrumentation.new(influxdb, process: 'report_generator')\n```\n\nYou can also set the `INFLUXDB_PROCESS_NAME` environment variable:\n\n    INFLUXDB_PROCESS_NAME=cache_cleaner bundle exec ruby ...\n\nIt will take precedence over the keyword argument.\n\n## Limitations\n\nSystem memory metrics (total, resident, shared memory used by the process as seen from the OS) are read\nfrom the `/proc` filesystem. They are not reported on systems where it is not available.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\nYou can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nHow to test this gem:\n* Install and run InfluxDB\n* Create a `test` database in it\n* Run `make points`\n\nIt will generate metrics and push them to the `test` database.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\nTo release a new version:\n* Update the version number in `version.rb`\n* Run `bundle exec rake release`, which will do the following:\n  * create a git tag for the version\n  * push git commits and tags\n  * push the `.gem` file to [rubygems.org](https://rubygems.org)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/vassilevsky/influxdb-process\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvassilevsky%2Finfluxdb-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvassilevsky%2Finfluxdb-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvassilevsky%2Finfluxdb-process/lists"}