{"id":22199247,"url":"https://github.com/babbel/puma-plugin-telemetry","last_synced_at":"2026-03-04T08:31:53.456Z","repository":{"id":37758118,"uuid":"318188603","full_name":"babbel/puma-plugin-telemetry","owner":"babbel","description":"Telemetry plugin for puma offering various targets to publish","archived":false,"fork":false,"pushed_at":"2025-06-02T17:31:49.000Z","size":195,"stargazers_count":19,"open_issues_count":9,"forks_count":4,"subscribers_count":39,"default_branch":"main","last_synced_at":"2026-01-05T08:37:56.123Z","etag":null,"topics":["gem","library","rack","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/babbel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-03T12:38:31.000Z","updated_at":"2025-10-06T09:08:52.000Z","dependencies_parsed_at":"2024-05-13T10:47:32.961Z","dependency_job_id":"57390c01-c36c-49e7-bd91-8d05cc7ddc92","html_url":"https://github.com/babbel/puma-plugin-telemetry","commit_stats":{"total_commits":52,"total_committers":4,"mean_commits":13.0,"dds":"0.17307692307692313","last_synced_commit":"30537c8b049ae3f50b483d59f61019e4cf85a06e"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/babbel/puma-plugin-telemetry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpuma-plugin-telemetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpuma-plugin-telemetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpuma-plugin-telemetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpuma-plugin-telemetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babbel","download_url":"https://codeload.github.com/babbel/puma-plugin-telemetry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpuma-plugin-telemetry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29443468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:51:12.367Z","status":"ssl_error","status_checked_at":"2026-02-14T10:50:52.088Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gem","library","rack","ruby"],"created_at":"2024-12-02T15:13:45.210Z","updated_at":"2026-03-04T08:31:53.430Z","avatar_url":"https://github.com/babbel.png","language":"Ruby","readme":"# Puma::Plugin::Telemetry\n\nPuma plugin which should be able to handle all your metric needs regarding your webserver:\n\n- ability to publish basic puma statistics (like queue backlog) to both logs and Datadog\n- ability to add custom target whenever you need it\n- ability to monitor puma socket listen queue (!)\n- ability to report requests queue time via custom rack middleware - the time request spent between being accepted by Load Balancer and start of its processing by Puma worker\n\n## Install\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"puma-plugin-telemetry\"\n```\n\nAnd then execute:\n\n```console\n$ bundle install\n```\n\nOr install it yourself as:\n\n```console\n$ gem install puma-plugin-telemetry\n```\n\n## Usage\n\nIn your puma configuration file (i.e. `config/puma.rb` or `config/puma/\u003cenv\u003e.rb`):\n\n```ruby\nplugin \"telemetry\"\n\nPuma::Plugin::Telemetry.configure do |config|\n  config.enabled = true\n\n  # \u003c\u003c here rest of the configuration, examples below\nend\n```\n\n### Basic\n\nOutput telemetry as JSON to `STDOUT`\n\n```ruby\n  config.add_target :io\n```\n\n### Datadog StatsD target\n\nGiven gem provides built in target for Datadog StatsD client, that uses batch operation to publish metrics.\n\n**NOTE** Be sure to have `dogstatsd` gem installed.\n\n```ruby\n  config.add_target :dogstatsd, client: Datadog::Statsd.new\n```\n\nYou can provide all the tags, namespaces, and other configuration options as always to `Datadog::Statsd.new` method.\n\n### All available options\n\nFor detailed documentation checkout [`Puma::Plugin::Telemetry::Config`](./lib/puma/plugin/telemetry/config.rb) class.\n\n```ruby\nPuma::Plugin::Telemetry.configure do |config|\n  config.enabled = true\n  config.initial_delay = 10\n  config.frequency = 30\n  config.puma_telemetry = %w[workers.requests_count queue.backlog queue.capacity]\n  config.socket_telemetry!\n  config.socket_parser = :inspect\n  config.add_target :io, formatter: :json, io: StringIO.new\n  config.add_target :dogstatsd, client: Datadog::Statsd.new(tags: { env: ENV[\"RAILS_ENV\"] })\nend\n```\n\n### Custom Targets\n\nTarget is a simple object that implements `call` methods that accepts `telemetry` hash object. This means it can be super simple `proc` or some sophisticated class calling some external API.\n\nJust be mindful that if the API takes long to call, it will slow down frequency with which telemetry will get reported.\n\n```ruby\n  # Example logfmt to stdout target\n  config.add_target proc { |telemetry| puts telemetry.map { |k, v| \"#{k}=#{v.inspect}\" }.join(\" \") }\n```\n\n## Extra middleware\n\nThis gems comes together with middleware for measuring request queue time, which will be reported in `request.env` and published to given StatsD client.\n\nExample configuration:\n\n```ruby\n# in Gemfile add `require` part\ngem \"puma-plugin-telemetry\", require: [\"rack/request_queue_time_middleware\"]\n\n# in initializer, i.e. `request_queue_time.rb`\nRails.application.config.middleware.insert_after(\n  0,\n  RequestQueueTimeMiddleware,\n  statsd: Datadog::Statsd.new(namespace: \"ruby.puma\", tags: { \"app\" =\u003e \"accounts\" })\n)\n\nRails.application.config.log_tags ||= {}\nRails.application.config.log_tags[:queue_time] = -\u003e(req) { req.env[::RequestQueueTimeMiddleware::ENV_KEY] }\n```\n\nThis will provide proper metric in Datadog and in logs as well. Logs can be transformed into log metrics and used for auto scaling purposes.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Release\n\nAll gem releases are manual, in order to create a new release follow:\n\n1. Create new PR (this could be included in feature PR, if it's meant to be released)\n   - update `VERSION`, we use [Semantic Versioning](https://semver.org/spec/v2.0.0.html)\n   - update `CHANGELOG`\n   - merge\n2. Draft new release via Github Releases\n   - use `v#{VERSION}` as a tag, i.e. `v0.1.0`\n   - add release notes based on the Changelog\n   - create\n3. Gem will get automatically published to given rubygems server\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/babbel/puma-plugin-telemetry.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the puma-plugin-telemetry project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/babbel/puma-plugin-telemetry/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Fpuma-plugin-telemetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabbel%2Fpuma-plugin-telemetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Fpuma-plugin-telemetry/lists"}