{"id":13393260,"url":"https://github.com/hopsoft/docker-graphite-statsd","last_synced_at":"2025-05-16T09:04:00.128Z","repository":{"id":1071599,"uuid":"14504472","full_name":"hopsoft/docker-graphite-statsd","owner":"hopsoft","description":"Docker image for Graphite \u0026 Statsd","archived":false,"fork":false,"pushed_at":"2022-11-06T17:47:44.000Z","size":120,"stargazers_count":867,"open_issues_count":35,"forks_count":310,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-10-29T21:01:48.264Z","etag":null,"topics":["docker","graphite","statsd"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/hopsoft.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":"2013-11-18T20:39:04.000Z","updated_at":"2024-09-04T00:30:14.000Z","dependencies_parsed_at":"2023-01-11T15:49:32.491Z","dependency_job_id":null,"html_url":"https://github.com/hopsoft/docker-graphite-statsd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hopsoft%2Fdocker-graphite-statsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hopsoft%2Fdocker-graphite-statsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hopsoft%2Fdocker-graphite-statsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hopsoft%2Fdocker-graphite-statsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hopsoft","download_url":"https://codeload.github.com/hopsoft/docker-graphite-statsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501556,"owners_count":22081528,"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":["docker","graphite","statsd"],"created_at":"2024-07-30T17:00:47.920Z","updated_at":"2025-05-16T09:04:00.107Z","avatar_url":"https://github.com/hopsoft.png","language":"Python","readme":"\u003c!-- Tocer[start]: Auto-generated, don't remove. --\u003e\n\n## Table of Contents\n\n- [Docker Image for Graphite \u0026 Statsd](#docker-image-for-graphite--statsd)\n  - [Get Graphite \u0026 Statsd running instantly](#get-graphite--statsd-running-instantly)\n  - [Quick Start](#quick-start)\n    - [Includes the following components](#includes-the-following-components)\n    - [Mapped Ports](#mapped-ports)\n    - [Mounted Volumes](#mounted-volumes)\n    - [Base Image](#base-image)\n  - [Start Using Graphite \u0026 Statsd](#start-using-graphite--statsd)\n    - [Send Some Stats](#send-some-stats)\n    - [Visualize the Data](#visualize-the-data)\n  - [Secure the Django Admin](#secure-the-django-admin)\n  - [Change the Configuration](#change-the-configuration)\n  - [Statsd Admin Management Interface](#statsd-admin-management-interface)\n  - [Secure Grafana](#secure-grafana)\n  - [Connect Grafana to Graphite](#connect-grafana-to-graphite)\n  - [A Note on Volumes](#a-note-on-volumes)\n  - [Memcached config](#memcached-config)\n  - [Additional Reading](#additional-reading)\n  - [Contributors](#contributors)\n\n\u003c!-- Tocer[finish]: Auto-generated, don't remove. --\u003e\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/hopsoft/graphite-statsd.svg?style=flat)](https://hub.docker.com/r/hopsoft/graphite-statsd/)\n\n\u003e __NOTICE:__ Check out the official Graphite \u0026 Statsd Docker image at https://github.com/graphite-project/docker-graphite-statsd\n\n# Docker Image for Graphite \u0026 Statsd\n\n## Get Graphite \u0026 Statsd running instantly\n\nGraphite \u0026 Statsd can be complex to setup.\nThis image will have you running \u0026 collecting stats in just a few minutes.\n\n## Quick Start\n\n```sh\ndocker run -d\\\n --name graphite\\\n --restart=always\\\n -p 80:80\\\n -p 81:81\\\n -p 2003-2004:2003-2004\\\n -p 2023-2024:2023-2024\\\n -p 8125:8125/udp\\\n -p 8126:8126\\\n hopsoft/graphite-statsd\n```\n\nThis starts a Docker container named: **graphite**\n\nThat's it, you're done ... almost.\n\n### Includes the following components\n\n* [Nginx](http://nginx.org/) - reverse proxies the graphite dashboard\n* [Graphite](http://graphite.readthedocs.org/en/latest/) - front-end dashboard\n* [Carbon](http://graphite.readthedocs.org/en/latest/carbon-daemons.html) - back-end\n* [Statsd](https://github.com/statsd/statsd/wiki) - UDP based back-end proxy\n* [Grafana](https://grafana.com) - front-end dashboard (more refined than Graphite)\n\n### Mapped Ports\n\nHost | Container | Service\n---- | --------- | -------------------------------------------------------------------------------------------------------------------\n  80 |        80 | [nginx - grafana](https://www.nginx.com/resources/admin-guide/)\n  81 |        81 | [nginx - graphite](https://www.nginx.com/resources/admin-guide/)\n2003 |      2003 | [carbon receiver - plaintext](http://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-plaintext-protocol)\n2004 |      2004 | [carbon receiver - pickle](http://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-pickle-protocol)\n2023 |      2023 | [carbon aggregator - plaintext](http://graphite.readthedocs.io/en/latest/carbon-daemons.html#carbon-aggregator-py)\n2024 |      2024 | [carbon aggregator - pickle](http://graphite.readthedocs.io/en/latest/carbon-daemons.html#carbon-aggregator-py)\n8125 |      8125 | [statsd](https://github.com/statsd/statsd/blob/master/docs/server.md)\n8126 |      8126 | [statsd admin](https://github.com/statsd/statsd/blob/master/docs/admin_interface.md)\n\nBy default, statsd listens on the UDP port 8125. If you want it to listen on the TCP port 8125 instead, you can set the environment variable `STATSD_INTERFACE` to `tcp` when running the container.\n\n### Mounted Volumes\n\nHost              | Container                  | Notes\n----------------- | -------------------------- | -------------------------------\nDOCKER ASSIGNED   | /opt/graphite/conf         | graphite config\nDOCKER ASSIGNED   | /opt/graphite/storage      | graphite stats storage\nDOCKER ASSIGNED   | /etc/grafana               | grafana config\nDOCKER ASSIGNED   | /etc/nginx                 | nginx config\nDOCKER ASSIGNED   | /opt/statsd                | statsd config\nDOCKER ASSIGNED   | /etc/logrotate.d           | logrotate config\nDOCKER ASSIGNED   | /var/log                   | log files\n\n### Base Image\n\nBuilt using [Phusion's base image](https://github.com/phusion/baseimage-docker).\n\n* All Graphite related processes are run as daemons \u0026 monitored with [runit](http://smarden.org/runit/).\n* Includes additional services such as logrotate.\n\n## Start Using Graphite \u0026 Statsd\n\n### Send Some Stats\n\nLet's fake some stats with a random counter to prove things are working.\n\n```sh\nwhile true; do echo -n \"example:$((RANDOM % 100))|c\" | nc -w 1 -u 127.0.0.1 8125; done\n```\n\n### Visualize the Data\n\nOpen Graphite in a browser.\n\n* http://localhost:81/dashboard\n* http://localhost:81/render?from=-10mins\u0026until=now\u0026target=stats.example\n\n## Secure the Django Admin\n\nUpdate the default Django admin user account. _The default is insecure._\n\n  * username: root\n  * password: root\n  * email: root.graphite@mailinator.com\n\nFirst login at: http://localhost:81/account/login\nThen update the root user's profile at: http://localhost:81/admin/auth/user/1/\n\n## Change the Configuration\n\nRead up on Graphite's [post-install tasks](https://graphite.readthedocs.org/en/latest/install.html#post-install-tasks).\nFocus on the [storage-schemas.conf](https://graphite.readthedocs.org/en/latest/config-carbon.html#storage-schemas-conf).\n\n1. Stop the container `docker stop graphite`.\n1. Find the configuration files on the host by inspecting the container `docker inspect graphite`.\n1. Update the desired config files.\n1. Restart the container `docker start graphite`.\n\n**Note**: If you change settings in `/opt/graphite/conf/storage-schemas.conf`\nbe sure to delete the old whisper files under `/opt/graphite/storage/whisper/`.\n\n---\n\n**Important:** Ensure your Statsd flush interval is at least as long as the highest-resolution retention.\nFor example, if `/opt/statsd/config.js` looks like this.\n\n```\nflushInterval: 10000\n```\n\nEnsure that `storage-schemas.conf` retentions are no finer grained than 10 seconds.\n\n```\n[all]\npattern = .*\nretentions = 5s:12h # WRONG\nretentions = 10s:12h # OK\nretentions = 60s:12h # OK\n```\n\n## Statsd Admin Management Interface\n\nA management interface (default on port 8126) allows you to manage statsd \u0026 retrieve stats.\n\n```sh\n# show all current counters\necho counters | nc localhost 8126\n```\n\n[More info \u0026 additional commands.](https://github.com/statsd/statsd/blob/master/docs/admin_interface.md)\n\n## Secure Grafana\n\nUpdate the default Grafana admin account. _The default is insecure._\n\n  * username: admin\n  * password: admin\n  * email: admin@localhost\n\nFirst login at: http://localhost\nThen update the admin user's profile at: http://localhost/admin/users/edit/1\n\n## Connect Grafana to Graphite\n\nVisit http://localhost/datasources/new\nThen configure the Graphite data source with the URL http://localhost:81\n\n## A Note on Volumes\n\nYou may find it useful to mount explicit volumes so configs \u0026 data can be managed from a known location on the host.\n\nSimply specify the desired volumes when starting the container.\n\n```\ndocker run -d\\\n --name graphite\\\n --restart=always\\\n -v /path/to/graphite/configs:/opt/graphite/conf\\\n -v /path/to/graphite/data:/opt/graphite/storage\\\n -v /path/to/statsd:/opt/statsd\\\n hopsoft/graphite-statsd\n```\n\n**Note**: The container will initialize properly if you mount empty volumes at\n          `/opt/graphite`, `/opt/graphite/conf`, `/opt/graphite/storage`, or `/opt/statsd`\n\n## Memcached config\n\nIf you want Graphite to use an existing Memcached server, set the following environment variables:\n\n```\ndocker run -d\\\n --name graphite\\\n --restart=always\\\n -p 80:80\\\n -p 2003-2004:2003-2004\\\n -p 2023-2024:2023-2024\\\n -p 8125:8125/udp\\\n -p 8126:8126\\\n -e \"MEMCACHE_HOST=127.0.0.1:11211\"\\  # Memcached host(s) comma delimited\n -e \"CACHE_DURATION=60\"\\              # in seconds\n hopsoft/graphite-statsd\n```\n\n## Additional Reading\n\n* [Introduction to Docker](http://docs.docker.io/#introduction)\n* [Official Statsd Documentation](https://github.com/statsd/statsd/)\n* [Practical Guide to StatsD/Graphite Monitoring](http://matt.aimonetti.net/posts/2013/06/26/practical-guide-to-graphite-monitoring/)\n* [Configuring Graphite for StatsD](https://github.com/statsd/statsd/blob/master/docs/graphite.md)\n\n## Contributors\n\nBuild the image yourself.\n\n1. `git clone https://github.com/hopsoft/docker-graphite-statsd.git`\n1. `docker build -t hopsoft/graphite-statsd .`\n","funding_links":[],"categories":["Interesting and Useful Docker containers","Python","statsd"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopsoft%2Fdocker-graphite-statsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhopsoft%2Fdocker-graphite-statsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopsoft%2Fdocker-graphite-statsd/lists"}