• Stars
    star
    871
  • Rank 50,284 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker image for Graphite & Statsd

Table of Contents

Docker Pulls

NOTICE: Check out the official Graphite & Statsd Docker image at https://github.com/graphite-project/docker-graphite-statsd

Docker Image for Graphite & Statsd

Get Graphite & Statsd running instantly

Graphite & Statsd can be complex to setup. This image will have you running & collecting stats in just a few minutes.

Quick Start

docker run -d\
 --name graphite\
 --restart=always\
 -p 80:80\
 -p 81:81\
 -p 2003-2004:2003-2004\
 -p 2023-2024:2023-2024\
 -p 8125:8125/udp\
 -p 8126:8126\
 hopsoft/graphite-statsd

This starts a Docker container named: graphite

That's it, you're done ... almost.

Includes the following components

  • Nginx - reverse proxies the graphite dashboard
  • Graphite - front-end dashboard
  • Carbon - back-end
  • Statsd - UDP based back-end proxy
  • Grafana - front-end dashboard (more refined than Graphite)

Mapped Ports

Host Container Service
80 80 nginx - grafana
81 81 nginx - graphite
2003 2003 carbon receiver - plaintext
2004 2004 carbon receiver - pickle
2023 2023 carbon aggregator - plaintext
2024 2024 carbon aggregator - pickle
8125 8125 statsd
8126 8126 statsd admin

By 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.

Mounted Volumes

Host Container Notes
DOCKER ASSIGNED /opt/graphite/conf graphite config
DOCKER ASSIGNED /opt/graphite/storage graphite stats storage
DOCKER ASSIGNED /etc/grafana grafana config
DOCKER ASSIGNED /etc/nginx nginx config
DOCKER ASSIGNED /opt/statsd statsd config
DOCKER ASSIGNED /etc/logrotate.d logrotate config
DOCKER ASSIGNED /var/log log files

Base Image

Built using Phusion's base image.

  • All Graphite related processes are run as daemons & monitored with runit.
  • Includes additional services such as logrotate.

Start Using Graphite & Statsd

Send Some Stats

Let's fake some stats with a random counter to prove things are working.

while true; do echo -n "example:$((RANDOM % 100))|c" | nc -w 1 -u 127.0.0.1 8125; done

Visualize the Data

Open Graphite in a browser.

Secure the Django Admin

Update the default Django admin user account. The default is insecure.

First login at: http://localhost:81/account/login Then update the root user's profile at: http://localhost:81/admin/auth/user/1/

Change the Configuration

Read up on Graphite's post-install tasks. Focus on the storage-schemas.conf.

  1. Stop the container docker stop graphite.
  2. Find the configuration files on the host by inspecting the container docker inspect graphite.
  3. Update the desired config files.
  4. Restart the container docker start graphite.

Note: If you change settings in /opt/graphite/conf/storage-schemas.conf be sure to delete the old whisper files under /opt/graphite/storage/whisper/.


Important: Ensure your Statsd flush interval is at least as long as the highest-resolution retention. For example, if /opt/statsd/config.js looks like this.

flushInterval: 10000

Ensure that storage-schemas.conf retentions are no finer grained than 10 seconds.

[all]
pattern = .*
retentions = 5s:12h # WRONG
retentions = 10s:12h # OK
retentions = 60s:12h # OK

Statsd Admin Management Interface

A management interface (default on port 8126) allows you to manage statsd & retrieve stats.

# show all current counters
echo counters | nc localhost 8126

More info & additional commands.

Secure Grafana

Update the default Grafana admin account. The default is insecure.

  • username: admin
  • password: admin
  • email: admin@localhost

First login at: http://localhost Then update the admin user's profile at: http://localhost/admin/users/edit/1

Connect Grafana to Graphite

Visit http://localhost/datasources/new Then configure the Graphite data source with the URL http://localhost:81

A Note on Volumes

You may find it useful to mount explicit volumes so configs & data can be managed from a known location on the host.

Simply specify the desired volumes when starting the container.

docker run -d\
 --name graphite\
 --restart=always\
 -v /path/to/graphite/configs:/opt/graphite/conf\
 -v /path/to/graphite/data:/opt/graphite/storage\
 -v /path/to/statsd:/opt/statsd\
 hopsoft/graphite-statsd

Note: The container will initialize properly if you mount empty volumes at /opt/graphite, /opt/graphite/conf, /opt/graphite/storage, or /opt/statsd

Memcached config

If you want Graphite to use an existing Memcached server, set the following environment variables:

docker run -d\
 --name graphite\
 --restart=always\
 -p 80:80\
 -p 2003-2004:2003-2004\
 -p 2023-2024:2023-2024\
 -p 8125:8125/udp\
 -p 8126:8126\
 -e "MEMCACHE_HOST=127.0.0.1:11211"\  # Memcached host(s) comma delimited
 -e "CACHE_DURATION=60"\              # in seconds
 hopsoft/graphite-statsd

Additional Reading

Contributors

Build the image yourself.

  1. git clone https://github.com/hopsoft/docker-graphite-statsd.git
  2. docker build -t hopsoft/graphite-statsd .

More Repositories

1

rails_standards

A developer's guide of practices to follow when building Rails applications.
350
star
2

universalid

Fast, recursive, optimized, URL-Safe serialization for any Ruby object
Ruby
325
star
3

turbo_boost-commands

Commands to help you build robust reactive applications with Rails & Hotwire.
HTML
277
star
4

turbo_boost-streams

Take full control of the DOM with Turbo Streams
HTML
260
star
5

model_probe

ActiveRecord schema visualization and model organization made easy
Ruby
161
star
6

relay

140
star
7

sr_mini

A single file Rails app that will have you running a StimulusReflex and CableReady demo in just 2 steps.
Ruby
138
star
8

stimulus_reflex_expo

StimulusReflex demos
Ruby
90
star
9

turbo_boost-elements

Pre-built easy to use reactive TurboBoost behaviors for Rails/Hotwire apps.
JavaScript
83
star
10

goldmine

Extract a wealth of information from lists
Ruby
75
star
11

composite_cache_store

A composite cache store comprised of layered ActiveSupport::Cache::Store instances
Ruby
74
star
12

job_contracts

Enforceable contracts with test-like assurances for jobs
Ruby
74
star
13

debounced

Debounced versions of standard DOM events
JavaScript
68
star
14

stimulus_controllers

[WIP] Stimulus controller library common enough to span multiple projects
JavaScript
59
star
15

chatter

Build a twitter clone in 10 mins with Rails, CableReady, and StimulusReflex
Ruby
52
star
16

tag_columns

Fast & simple Rails ActiveRecord model tagging using PostgreSQL's Array datatype
Ruby
51
star
17

stimulus_reflex_todomvc

An implementation of TodoMVC using Ruby on Rails, StimulusJS, and StimulusReflex
Ruby
49
star
18

bg

Non-blocking ActiveRecord method invocation
Ruby
47
star
19

pipe_envy

Elixir style pipe operator for Ruby
Ruby
46
star
20

hero

Business process modeling for the Rubyist
Ruby
39
star
21

polysearch

Simplified polymorphic full text + similarity search based on postgres
Ruby
38
star
22

coast

RESTful behavior for Rails controllers
Ruby
28
star
23

field_mapper

Data mapping & transformation
Ruby
25
star
24

pry-test

A small test framework that supports debugging test failures & errors when they happen
Ruby
25
star
25

stimulus_toolbox

Stimulus Toolbox is a catalog of Stimulus projects tracked by popularity and other metrics to help you find the libraries you need to build better applications.
Ruby
22
star
26

credentials_demo

Demo of environment aware Rails encrypted credentials with environment variable override
Ruby
21
star
27

active_storage_svg_sanitizer

Sanitize ActiveStorage SVG uploads
Ruby
20
star
28

perm

Simple authorization/permission management in Ruby
Ruby
15
star
29

stimulus_todomvc

[WIP] An implementation of TodoMVC using Ruby on Rails and StimulusJS
Ruby
14
star
30

coin

An absurdly simple DRb based in-memory cache
Ruby
13
star
31

grumpy_old_man

Asserts for RSpec
Ruby
13
star
32

render_later

Improve the user perceived performance of your Rails app
Ruby
13
star
33

docker-ruby-rbx

Trusted Docker Image for Rubinius Ruby
Shell
11
star
34

trix_embed

Take control over what external links and embedded media is permitted in the Trix editor via copy/paste
JavaScript
10
star
35

ellington

A different take on flow based programming.
Ruby
10
star
36

todomvc

TodoMVC with Rails 7, StimulusReflex, & Import Maps
Ruby
9
star
37

state_jacket

A simple & intuitive state machine
Ruby
9
star
38

dotfiles

Lua
8
star
39

turbo_boost-devtools

Devtools for the Hotwire/Turbo ecosystem (TurboBoost, CableReady, StimulusReflex, etc.)
JavaScript
7
star
40

containers

Ruby
7
star
41

roleup

Simple role management
Ruby
6
star
42

legion

Parallel processing made easy
Ruby
6
star
43

kvn

KVN (Key/Value Notation) converter & parser
Ruby
4
star
44

apex-doc

Oracle Application Express (APEX) Quick Reference
4
star
45

bighorn

A standardized interface for event tracking
JavaScript
4
star
46

docker-images

Shell
4
star
47

private-docker-registry

A project to help you build a private docker registry image.
Shell
4
star
48

todo

WIP: CableReady + StimulusReflex + Web Components todo app demo
Ruby
4
star
49

foreign_key_migrations

Plugin that supports adding and removing foreign key constraints in your migrations.
Ruby
3
star
50

github_search

Ruby
3
star
51

docker-nodejs

Docker image for NodeJS
Shell
2
star
52

footing

An ActiveSupport style utility library that employs delegation instead of monkey patching
Ruby
2
star
53

coin_rack

A REST API for Coin
Ruby
2
star
54

fig

The smart way to manage config settings for Rails and Ruby applications using YAML configuration files.
Ruby
2
star
55

self_renderer

Rails model & object rendering outside the context of web requests
Ruby
1
star
56

docker-ruby-mri

Trusted Docker Image for MRI Ruby
Shell
1
star
57

model_definition_tester

Powerful schema and validations testing.
Ruby
1
star
58

string_extensions

Extensions and monkey patches for String.
Ruby
1
star
59

looker

Hash based enumerated types (ENUMS)
Ruby
1
star
60

cable_ready_todomvc

Rails implementation of TodoMVC using the CableReady GEM instead of a heavy SPA framework
Ruby
1
star
61

safe_migrations

Rails plugin that gracefully handles errors in data migrations and prevents you from getting stuck in between.
Ruby
1
star
62

hopsoft.github.io

Web pages for Hopsoft on Github.
JavaScript
1
star
63

active_record_addons

A small library of helper methods for ActiveRecord
Ruby
1
star
64

docker

Docker images for development and other environments
Dockerfile
1
star
65

hustle

Offload CPU heavy computing to separate processes with Ruby blocks.
Ruby
1
star
66

raml_doc

Generate API documentation from RAML files
HTML
1
star
67

stimulus_reflex_client

WIP: Will eventually replace the JavaScript in the StimulusReflex project
JavaScript
1
star
68

han

Hypermedia API Navigation spec
1
star
69

docker-postgres

Trusted Docker Image for PostgreSQL
Shell
1
star