{"id":15512596,"url":"https://github.com/yabeda-rb/example-prometheus","last_synced_at":"2025-06-28T01:34:17.517Z","repository":{"id":50285001,"uuid":"151641895","full_name":"yabeda-rb/example-prometheus","owner":"yabeda-rb","description":"Easily runnable example to view how yabeda metrics works in action","archived":false,"fork":false,"pushed_at":"2023-12-14T04:35:48.000Z","size":129,"stargazers_count":85,"open_issues_count":0,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-01T23:09:58.645Z","etag":null,"topics":["grafana","metrics","monitoring","prometheus","sidekiq"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yabeda-rb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2018-10-04T22:08:23.000Z","updated_at":"2025-05-12T06:38:46.000Z","dependencies_parsed_at":"2023-12-14T05:34:24.782Z","dependency_job_id":null,"html_url":"https://github.com/yabeda-rb/example-prometheus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yabeda-rb/example-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yabeda-rb%2Fexample-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yabeda-rb%2Fexample-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yabeda-rb%2Fexample-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yabeda-rb%2Fexample-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yabeda-rb","download_url":"https://codeload.github.com/yabeda-rb/example-prometheus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yabeda-rb%2Fexample-prometheus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262361551,"owners_count":23299082,"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":["grafana","metrics","monitoring","prometheus","sidekiq"],"created_at":"2024-10-02T09:53:44.425Z","updated_at":"2025-06-28T01:34:17.462Z","avatar_url":"https://github.com/yabeda-rb.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Example of Rails, Sidekiq and Puma metrics exported to Prometheus + Grafana\n\nThis example illustrates how to use [yabeda] gem suite with rails application to draw graphs for app metrics.\n\n## Prerequisites\n\nRecent versions of Docker and Docker Compose installed.\n\n## Usage\n\n- Execute `docker-compose up` to start.\n- Go to rails application at http://localhost:5000\n- Hit the button and refresh page few times\n- Go to Grafana Web UI at [localhost](http://localhost:3000/d/000000001/yabeda-metrics-for-rails-sidekiq-and-puma?refresh=5s) (user: `admin`/`admin`)\n- Look for graphs\n- After starting up docker-compose will run `rails-stressor` service to simulate huge load for the rails app. By default will do the request for 2 minutes.\nSettings could be changed in `docker-compose.yml` config (command parameter of the `rails_stressor` service).\n\nYou also could run rails stressor again by executing `docker-compose up rails_stressor` command.\n\n## Notes\n\n- Sample [Rails] application is equipped with [yabeda-rails], [yabeda-sidekiq], [yabeda-puma-plugin], and [yabeda-prometheus] gems and properly configured.\n- Raw rails metrics are exposed at http://localhost:5000/metrics\n- Raw sidekiq metrics are exposed at http://localhost:5100/metrics\n- Raw puma metrics are exposed at http://localhost:5100/metrics\n- The [Prometheus] Web UI runs at http://localhost:9090\n- The [Grafana] Web UI runs at http://localhost:3000 , user: `admin`/`admin`.\n- The [Sidekiq] Web UI is available at http://localhost:5000/sidekiq\n\n## Possible errors and their solutions\n\n### Permission denied error / My grafana container is not running (Stopping after boot)\n\nIf your grafana's container is not running correctly after you run `docker-compose up` you're probably getting this error, if you check at `docker ps -a` you'll see your grana container with the status `Exited`, picks the id of this container and run `docker logs YOUR_GRAFANA_CONTAINER_ID` and check if the errors is equal to the following:\n\n```\nGF_PATHS_DATA='/var/lib/grafana' is not writable.\nYou may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migration-from-a-previou\ns-version-of-the-docker-container-to-5-1-or-later\nmkdir: cannot create directory '/var/lib/grafana/plugins': Permission denied\n```\n\n#### Solution\n\nReplace at your `docker-compose.yml` line 38 by your user's `id` that you will get on the following command:\n\n```sh\nid -u\n```\n\n## Acknowledgement\n\nThe configurations are based off the following articles and repositories:\n - https://finestructure.co/blog/2016/5/16/monitoring-with-prometheus-grafana-docker-part-1\n - https://github.com/NikolajLeischner/local-prometheus-grafana\n - https://www.digitalocean.com/community/tutorials/how-to-add-a-prometheus-dashboard-to-grafana\n\n## License\n\nThis example is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n[yabeda]: https://github.com/yabeda-rb/yabeda\n[yabeda-rails]: https://github.com/yabeda-rb/yabeda-rails\n[yabeda-sidekiq]: https://github.com/yabeda-rb/yabeda-sidekiq\n[yabeda-puma-plugin]: https://github.com/yabeda-rb/yabeda-puma-plugin\n[yabeda-prometheus]: https://github.com/yabeda-rb/yabeda-prometheus\n[Rails]: https://rubyonrails.org \"Ruby on Rails MVC web-application framework optimized for programmer happiness\"\n[Sidekiq]: https://github.com/mperham/sidekiq/ \"Simple, efficient background processing for Ruby\"\n[Prometheus]: https://prometheus.io/ \"Open-source monitoring solution\"\n[Grafana]: https://grafana.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyabeda-rb%2Fexample-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyabeda-rb%2Fexample-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyabeda-rb%2Fexample-prometheus/lists"}