{"id":15152733,"url":"https://github.com/a0s/prometheus_client_addons","last_synced_at":"2026-01-19T23:02:12.551Z","repository":{"id":56888915,"uuid":"206314139","full_name":"a0s/prometheus_client_addons","owner":"a0s","description":"The missed parts of prometheus/client_ruby","archived":false,"fork":false,"pushed_at":"2019-09-09T19:08:11.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-04T17:38:29.331Z","etag":null,"topics":["prometheus-exporter","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://github.com/a0s/prometheus_client_addons","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/a0s.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":"2019-09-04T12:28:55.000Z","updated_at":"2019-09-09T19:07:49.000Z","dependencies_parsed_at":"2022-08-20T16:00:31.709Z","dependency_job_id":null,"html_url":"https://github.com/a0s/prometheus_client_addons","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/a0s/prometheus_client_addons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fprometheus_client_addons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fprometheus_client_addons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fprometheus_client_addons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fprometheus_client_addons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a0s","download_url":"https://codeload.github.com/a0s/prometheus_client_addons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fprometheus_client_addons/sbom","scorecard":{"id":157982,"data":{"date":"2025-08-11","repo":{"name":"github.com/a0s/prometheus_client_addons","commit":"a954a790c5c9a256bf0f129e8e3eb81a8e2aae23"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T12:25:48.014Z","repository_id":56888915,"created_at":"2025-08-16T12:25:48.014Z","updated_at":"2025-08-16T12:25:48.014Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28588968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"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":["prometheus-exporter","ruby-on-rails"],"created_at":"2024-09-26T16:22:09.463Z","updated_at":"2026-01-19T23:02:12.528Z","avatar_url":"https://github.com/a0s.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus Ruby Client Addons\n\n## Usage (with Rails)\n\n### Puma server\n\nconfig/initializers/prometheus.rb\n```ruby\nrequire 'prometheus/client'\nrequire 'prometheus_client_addons'\n\nprometheus = Prometheus::Client.registry\npuma = PrometheusClientAddons::Prometheus::Client::Puma.new(\n  prefix: 'puma', \n  base_labels: { my_label: 'baz' }\n)\nprometheus.register(puma)\n```\n\nconfig/puma.rb\n```ruby\nactivate_control_app('auto')\nplugin :prometheus_client_addons\n```\n\nExample response in non-clustered mode\n```\n# TYPE puma_backlog gauge\n# HELP puma_backlog How many requests are waiting\npuma_backlog{my_label=\"baz\"} 0\n# TYPE puma_running gauge\n# HELP puma_running Number of running threads\npuma_running{my_label=\"baz\"} 5\n# TYPE puma_pool_capacity gauge\n# HELP puma_pool_capacity Number of requests that can be processed right now\npuma_pool_capacity{my_label=\"baz\"} 4\n# TYPE puma_max_threads gauge\n# HELP puma_max_threads Maximum number of worker threads\npuma_max_threads{my_label=\"baz\"} 5\n```\n\nExample response in clustered mode\n```\n# TYPE puma_workers gauge\n# HELP puma_workers Number of workers\npuma_workers{my_label=\"baz\"} 2\n# TYPE puma_phase gauge\n# HELP puma_phase Phase of worker\npuma_phase{my_label=\"baz\"} 0\n# TYPE puma_booted_workers gauge\n# HELP puma_booted_workers Number of booted workers\npuma_booted_workers{my_label=\"baz\"} 2\n# TYPE puma_old_workers gauge\n# HELP puma_old_workers Number of old workers\npuma_old_workers{my_label=\"baz\"} 0\n# TYPE puma_worker_status_phase gauge\n# HELP puma_worker_status_phase Phase of worker\npuma_worker_status_phase{my_label=\"baz\",worker_index=\"0\"} 0\npuma_worker_status_phase{my_label=\"baz\",worker_index=\"1\"} 0\n# TYPE puma_worker_status_booted gauge\n# HELP puma_worker_status_booted Booted or not\npuma_worker_status_booted{my_label=\"baz\",worker_index=\"0\"} true\npuma_worker_status_booted{my_label=\"baz\",worker_index=\"1\"} true\n# TYPE puma_worker_status_last_checkin gauge\n# HELP puma_worker_status_last_checkin Last update\npuma_worker_status_last_checkin{my_label=\"baz\",worker_index=\"0\"} 2019-09-04T15:01:33Z\npuma_worker_status_last_checkin{my_label=\"baz\",worker_index=\"1\"} 2019-09-04T15:01:33Z\n# TYPE puma_worker_status_last_status_backlog gauge\n# HELP puma_worker_status_last_status_backlog How many objects have yet to be processed by the pool\npuma_worker_status_last_status_backlog{my_label=\"baz\",worker_index=\"0\"} 0\npuma_worker_status_last_status_backlog{my_label=\"baz\",worker_index=\"1\"} 0\n# TYPE puma_worker_status_last_status_running gauge\n# HELP puma_worker_status_last_status_running Number of running threads\npuma_worker_status_last_status_running{my_label=\"baz\",worker_index=\"0\"} 5\npuma_worker_status_last_status_running{my_label=\"baz\",worker_index=\"1\"} 5\n# TYPE puma_worker_status_last_status_pool_capacity gauge\n# HELP puma_worker_status_last_status_pool_capacity Number of requests that can be processed right now\npuma_worker_status_last_status_pool_capacity{my_label=\"baz\",worker_index=\"0\"} 5\npuma_worker_status_last_status_pool_capacity{my_label=\"baz\",worker_index=\"1\"} 5\n# TYPE puma_worker_status_last_status_max_threads gauge\n# HELP puma_worker_status_last_status_max_threads Maximum number of worker threads\npuma_worker_status_last_status_max_threads{my_label=\"baz\",worker_index=\"0\"} 5\npuma_worker_status_last_status_max_threads{my_label=\"baz\",worker_index=\"1\"} 5\n```\n\n### ActiveRecord::Base.connection_pool.stat\n\n*Now it's not working with pre-forked/clustered-mode web servers. Sorry.*\n\nconfig/initializers/prometheus.rb\n```ruby\nrequire 'prometheus/client'\nrequire 'prometheus_client_addons'\n\nprometheus = Prometheus::Client.registry\npool = PrometheusClientAddons::Prometheus::Client::ActiveRecord.new(\n  prefix: 'activerecord', \n  base_labels: { my_label: 'foo' }\n)\nprometheus.register(pool)\n```\n\nExample response\n```\n# TYPE activerecord_size gauge\n# HELP activerecord_size Size of pool\nactiverecord_size{my_label=\"foo\"} 5\n# TYPE activerecord_connections gauge\n# HELP activerecord_connections Connections count\nactiverecord_connections{my_label=\"foo\"} 0\n# TYPE activerecord_busy gauge\n# HELP activerecord_busy Busy count\nactiverecord_busy{my_label=\"foo\"} 0\n# TYPE activerecord_dead gauge\n# HELP activerecord_dead Dead count\nactiverecord_dead{my_label=\"foo\"} 0\n# TYPE activerecord_idle gauge\n# HELP activerecord_idle Idle count\nactiverecord_idle{my_label=\"foo\"} 0\n# TYPE activerecord_waiting gauge\n# HELP activerecord_waiting Num waiting in queue\nactiverecord_waiting{my_label=\"foo\"} 0\n# TYPE activerecord_checkout_timeout gauge\n# HELP activerecord_checkout_timeout Checkout timeout\nactiverecord_checkout_timeout{my_label=\"foo\"} 5\n```\n\n### GC.stat\n\nconfig/initializers/prometheus.rb\n```ruby\nrequire 'prometheus/client'\nrequire 'prometheus_client_addons'\n\nprometheus = Prometheus::Client.registry\ngc = PrometheusClientAddons::Prometheus::Client::GC.new(\n  prefix: 'gc',\n  base_labels: { my_label: 'foo' }\n)\nprometheus.register(gc)\n```\n\nExample response\n```\n# TYPE gc_count gauge\n# HELP gc_count count\ngc_count{my_label=\"foo\"} 62\n# TYPE gc_heap_allocated_pages gauge\n# HELP gc_heap_allocated_pages heap_allocated_pages\ngc_heap_allocated_pages{my_label=\"foo\"} 3593\n# TYPE gc_heap_sorted_length gauge\n# HELP gc_heap_sorted_length heap_sorted_length\ngc_heap_sorted_length{my_label=\"foo\"} 3593\n# TYPE gc_heap_allocatable_pages gauge\n# HELP gc_heap_allocatable_pages heap_allocatable_pages\ngc_heap_allocatable_pages{my_label=\"foo\"} 0\n# TYPE gc_heap_available_slots gauge\n# HELP gc_heap_available_slots heap_available_slots\ngc_heap_available_slots{my_label=\"foo\"} 1464501\n# TYPE gc_heap_live_slots gauge\n# HELP gc_heap_live_slots heap_live_slots\ngc_heap_live_slots{my_label=\"foo\"} 1464445\n# TYPE gc_heap_free_slots gauge\n# HELP gc_heap_free_slots heap_free_slots\ngc_heap_free_slots{my_label=\"foo\"} 56\n# TYPE gc_heap_final_slots gauge\n# HELP gc_heap_final_slots heap_final_slots\ngc_heap_final_slots{my_label=\"foo\"} 0\n# TYPE gc_heap_marked_slots gauge\n# HELP gc_heap_marked_slots heap_marked_slots\ngc_heap_marked_slots{my_label=\"foo\"} 999525\n# TYPE gc_heap_eden_pages gauge\n# HELP gc_heap_eden_pages heap_eden_pages\ngc_heap_eden_pages{my_label=\"foo\"} 3593\n# TYPE gc_heap_tomb_pages gauge\n# HELP gc_heap_tomb_pages heap_tomb_pages\ngc_heap_tomb_pages{my_label=\"foo\"} 0\n# TYPE gc_total_allocated_pages gauge\n# HELP gc_total_allocated_pages total_allocated_pages\ngc_total_allocated_pages{my_label=\"foo\"} 3593\n# TYPE gc_total_freed_pages gauge\n# HELP gc_total_freed_pages total_freed_pages\ngc_total_freed_pages{my_label=\"foo\"} 0\n# TYPE gc_total_allocated_objects gauge\n# HELP gc_total_allocated_objects total_allocated_objects\ngc_total_allocated_objects{my_label=\"foo\"} 4665284\n# TYPE gc_total_freed_objects gauge\n# HELP gc_total_freed_objects total_freed_objects\ngc_total_freed_objects{my_label=\"foo\"} 3200839\n# TYPE gc_malloc_increase_bytes gauge\n# HELP gc_malloc_increase_bytes malloc_increase_bytes\ngc_malloc_increase_bytes{my_label=\"foo\"} 16693664\n# TYPE gc_malloc_increase_bytes_limit gauge\n# HELP gc_malloc_increase_bytes_limit malloc_increase_bytes_limit\ngc_malloc_increase_bytes_limit{my_label=\"foo\"} 30330547\n# TYPE gc_minor_gc_count gauge\n# HELP gc_minor_gc_count minor_gc_count\ngc_minor_gc_count{my_label=\"foo\"} 48\n# TYPE gc_major_gc_count gauge\n# HELP gc_major_gc_count major_gc_count\ngc_major_gc_count{my_label=\"foo\"} 14\n# TYPE gc_remembered_wb_unprotected_objects gauge\n# HELP gc_remembered_wb_unprotected_objects remembered_wb_unprotected_objects\ngc_remembered_wb_unprotected_objects{my_label=\"foo\"} 4357\n# TYPE gc_remembered_wb_unprotected_objects_limit gauge\n# HELP gc_remembered_wb_unprotected_objects_limit remembered_wb_unprotected_objects_limit\ngc_remembered_wb_unprotected_objects_limit{my_label=\"foo\"} 8690\n# TYPE gc_old_objects gauge\n# HELP gc_old_objects old_objects\ngc_old_objects{my_label=\"foo\"} 992074\n# TYPE gc_old_objects_limit gauge\n# HELP gc_old_objects_limit old_objects_limit\ngc_old_objects_limit{my_label=\"foo\"} 1743172\n# TYPE gc_oldmalloc_increase_bytes gauge\n# HELP gc_oldmalloc_increase_bytes oldmalloc_increase_bytes\ngc_oldmalloc_increase_bytes{my_label=\"foo\"} 37700816\n# TYPE gc_oldmalloc_increase_bytes_limit gauge\n# HELP gc_oldmalloc_increase_bytes_limit oldmalloc_increase_bytes_limit\ngc_oldmalloc_increase_bytes_limit{my_label=\"foo\"} 33438324\n```\n\n### CustomCollector\n\nconfig/initializers/prometheus.rb\n```ruby\nrequire 'prometheus/client'\nrequire 'prometheus_client_addons'\n\nprometheus = Prometheus::Client.registry\ncustom_collector = PrometheusClientAddons::Prometheus::Client::CustomCollector.new(\n  name: 'custom_metric',\n  docstring: 'This is a custom metric',\n  base_labels: { my_label: 'foo' },\n  \u0026Proc.new {\n    # return custom value from block\n    Time.now.to_i\n  }\n)\nprometheus.register(custom_collector)\n```\n\nExample response\n```\n# TYPE custom_metric gauge\n# HELP custom_metric This is a custom metric\ncustom_metric{my_label=\"foo\"} 1567612321\n```\n\n## Installation\n\n```ruby\ngem 'prometheus_client_addons'\n```\n\n```bash\nbundle install\n# or\ngem install prometheus_client_addons\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `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`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and 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/[USERNAME]/prometheus_client_addons.\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%2Fa0s%2Fprometheus_client_addons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa0s%2Fprometheus_client_addons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa0s%2Fprometheus_client_addons/lists"}