├── hosts ├── roles ├── java │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ └── java.yml ├── python │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ └── python.yml ├── nginx │ ├── tasks │ │ ├── main.yml │ │ └── nginx.yml │ ├── handlers │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── templates │ │ └── nginx.conf.j2 ├── uwsgi │ ├── tasks │ │ ├── main.yml │ │ └── uwsgi.yml │ ├── handlers │ │ └── main.yml │ └── defaults │ │ └── main.yml ├── carbon │ ├── tasks │ │ ├── main.yml │ │ └── carbon.yml │ ├── handlers │ │ └── main.yml │ ├── templates │ │ ├── graphite-carbon.j2 │ │ ├── storage-schemas.conf.j2 │ │ ├── storage-aggregation.conf.j2 │ │ └── carbon.conf.j2 │ └── defaults │ │ └── main.yml ├── grafana │ ├── tasks │ │ ├── main.yml │ │ └── grafana.yml │ ├── templates │ │ ├── nginx-grafana.conf.j2 │ │ └── config.js.j2 │ └── defaults │ │ └── main.yml ├── riemann │ ├── tasks │ │ ├── main.yml │ │ └── riemann.yml │ ├── handlers │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── templates │ │ ├── influxdb.clj.j2 │ │ └── riemann.config.j2 ├── influxdb │ ├── tasks │ │ ├── main.yml │ │ └── influxdb.yml │ ├── handlers │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── templates │ │ └── config.toml.j2 └── graphite-api │ ├── tasks │ ├── main.yml │ ├── influxdb.yml │ ├── whisper.yml │ ├── uwsgi.yml │ ├── nginx.yml │ └── graphite-api.yml │ ├── templates │ ├── uwsgi-graphite-api.ini.j2 │ ├── nginx-graphite-api.conf.j2 │ └── config.yml.j2 │ └── defaults │ └── main.yml ├── site.yml └── defaults └── main.yml /hosts: -------------------------------------------------------------------------------- 1 | [servers] 2 | localhost ansible_connection=local 3 | -------------------------------------------------------------------------------- /roles/java/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | java_enabled: no 4 | -------------------------------------------------------------------------------- /roles/python/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | python_enabled: no 4 | -------------------------------------------------------------------------------- /roles/java/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: java.yml 4 | when: java_enabled 5 | tags: [java] 6 | -------------------------------------------------------------------------------- /roles/nginx/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: nginx.yml 4 | when: nginx_enabled 5 | tags: [nginx] 6 | -------------------------------------------------------------------------------- /roles/uwsgi/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: uwsgi.yml 4 | when: uwsgi_enabled 5 | tags: [uwsgi] 6 | -------------------------------------------------------------------------------- /roles/carbon/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: carbon.yml 4 | when: carbon_enabled 5 | tags: [carbon] 6 | -------------------------------------------------------------------------------- /roles/grafana/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: grafana.yml 4 | when: grafana_enabled 5 | tags: [grafana] 6 | -------------------------------------------------------------------------------- /roles/python/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: python.yml 4 | when: python_enabled 5 | tags: [python] 6 | -------------------------------------------------------------------------------- /roles/riemann/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: riemann.yml 4 | when: riemann_enabled 5 | tags: [riemann] 6 | -------------------------------------------------------------------------------- /roles/carbon/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: carbon restart 4 | service: name=carbon-cache state=restarted 5 | -------------------------------------------------------------------------------- /roles/influxdb/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: influxdb.yml 4 | when: influxdb_enabled 5 | tags: [influxdb] 6 | -------------------------------------------------------------------------------- /roles/graphite-api/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: graphite-api.yml 4 | when: graphite_api_enabled 5 | tags: [graphite-api] 6 | -------------------------------------------------------------------------------- /roles/nginx/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: nginx restart 4 | service: name=nginx state=restarted 5 | 6 | - name: nginx reload 7 | service: name=nginx state=reloaded 8 | -------------------------------------------------------------------------------- /roles/uwsgi/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: uwsgi restart 4 | service: name=uwsgi state=restarted 5 | 6 | - name: uwsgi reload 7 | service: name=uwsgi state=reloaded 8 | -------------------------------------------------------------------------------- /roles/uwsgi/tasks/uwsgi.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install uwsgi 4 | apt: pkg={{item}} update_cache=yes cache_valid_time=60 5 | with_items: 6 | - uwsgi-plugin-python 7 | - uwsgi 8 | -------------------------------------------------------------------------------- /roles/riemann/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: riemann restart 4 | service: name=riemann state=restarted 5 | 6 | - name: riemann reload 7 | service: name=riemann state=reloaded 8 | -------------------------------------------------------------------------------- /roles/influxdb/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: influxdb restart 4 | service: name=influxdb state=restarted 5 | 6 | - name: influxdb reload 7 | service: name=influxdb state=reloaded 8 | -------------------------------------------------------------------------------- /roles/uwsgi/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | uwsgi_enabled: no 4 | uwsgi_dir: /etc/uwsgi 5 | uwsgi_apps_enabled: "{{uwsgi_dir}}/apps-enabled" 6 | uwsgi_apps_available: "{{uwsgi_dir}}/apps-available" 7 | -------------------------------------------------------------------------------- /roles/carbon/templates/graphite-carbon.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ansible_fqdn}} 2 | # Do NOT modify this file by hand! 3 | 4 | CARBON_CACHE_ENABLED={{'true' if carbon_enabled else 'false'}} 5 | -------------------------------------------------------------------------------- /roles/java/tasks/java.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install java 4 | apt: pkg={{item}} update_cache=yes cache_valid_time=60 5 | with_items: 6 | - openjdk-7-jre 7 | - openjdk-7-jre-lib 8 | - openjdk-7-jre-headless 9 | -------------------------------------------------------------------------------- /site.yml: -------------------------------------------------------------------------------- 1 | - hosts: all 2 | sudo: yes 3 | roles: 4 | - java 5 | - python 6 | - nginx 7 | - uwsgi 8 | - carbon 9 | - riemann 10 | - influxdb 11 | - graphite-api 12 | - grafana 13 | vars_files: 14 | - defaults/main.yml 15 | -------------------------------------------------------------------------------- /roles/python/tasks/python.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install python 4 | apt: pkg={{item}} update_cache=yes cache_valid_time=60 5 | with_items: 6 | - python 7 | - python-dev 8 | - python-pip 9 | - python-setuptools 10 | - python-virtualenv 11 | -------------------------------------------------------------------------------- /roles/graphite-api/tasks/influxdb.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install influxdb 4 | pip: name={{item}} executable={{graphite_api_dir}}/env/bin/pip 5 | sudo: yes 6 | sudo_user: "{{graphite_api_user}}" 7 | with_items: 8 | - influxdb 9 | - graphite-influxdb 10 | -------------------------------------------------------------------------------- /roles/nginx/tasks/nginx.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install nignx 4 | apt: pkg=nginx default_release=wheezy-backports update_cache=yes cache_valid_time=60 5 | 6 | - name: Configure nginx 7 | template: src=nginx.conf.j2 dest={{nginx_dir}}/nginx.conf 8 | notify: 9 | - nginx reload 10 | -------------------------------------------------------------------------------- /roles/graphite-api/templates/uwsgi-graphite-api.ini.j2: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | processes = 4 3 | socket = {{graphite_api_uwsgi_host}}:{{graphite_api_uwsgi_port}} 4 | buffer-size = 8192 5 | plugins = python27 6 | home = {{graphite_api_dir}}/env 7 | module = graphite_api.app:app 8 | env = GRAPHITE_API_CONFIG={{graphite_api_dir}}/config.yml 9 | -------------------------------------------------------------------------------- /roles/influxdb/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | influxdb_enabled: no 4 | influxdb_ver: 0.8.9_amd64 5 | influxdb_dir: /opt/influxdb 6 | influxdb_log_dir: /var/log/influxdb 7 | influxdb_host: "{{inventory_hostname}}" 8 | influxdb_port: 8086 9 | influxdb_bind_addr: 0.0.0.0 10 | influxdb_admin_port: 8083 11 | influxdb_raft_port: 8090 12 | -------------------------------------------------------------------------------- /roles/grafana/templates/nginx-grafana.conf.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ ansible_fqdn }} 2 | # Do NOT modify this file by hand! 3 | 4 | server { 5 | listen {{grafana_nginx_port}}; 6 | server_name {{grafana_nginx_host}}; 7 | 8 | location / { 9 | root {{grafana_dir}}/grafana; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /roles/graphite-api/tasks/whisper.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install whisper 4 | pip: name=whisper executable={{graphite_api_dir}}/env/bin/pip 5 | sudo: yes 6 | sudo_user: "{{graphite_api_user}}" 7 | 8 | - name: Touch index file 9 | file: state=touch path={{graphite_api_search_index}} owner={{graphite_api_user}} group={{graphite_api_group}} 10 | changed_when: False 11 | -------------------------------------------------------------------------------- /roles/riemann/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | riemann_enabled: no 4 | riemann_ver: 0.2.6_all 5 | riemann_dir: /etc/riemann 6 | riemann_log: /var/log/riemann/riemann.log 7 | 8 | riemann_influxdb: no 9 | riemann_influxdb_host: "{{inventory_hostname}}" 10 | riemann_influxdb_port: 8086 11 | riemann_influxdb_user: metrics 12 | riemann_influxdb_pass: metrics 13 | riemann_influxdb_db: metrics 14 | 15 | -------------------------------------------------------------------------------- /roles/graphite-api/tasks/uwsgi.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Configure uswgi graphite-api app 4 | template: src=uwsgi-graphite-api.ini.j2 dest={{uwsgi_apps_available}}/graphite-api.ini 5 | notify: [uwsgi reload] 6 | 7 | - name: Enable uwsgi graphite-api app 8 | file: src={{uwsgi_apps_available}}/graphite-api.ini dest={{uwsgi_apps_enabled}}/graphite-api.ini state=link 9 | notify: [uwsgi reload] 10 | -------------------------------------------------------------------------------- /roles/graphite-api/tasks/nginx.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Configure nginx graphite-api site 4 | template: src=nginx-graphite-api.conf.j2 dest={{nginx_sites_available}}/graphite-api.conf 5 | notify: [nginx reload] 6 | 7 | - name: Enable nginx graphite-api site 8 | file: src={{nginx_sites_available}}/graphite-api.conf dest={{nginx_sites_enabled}}/graphite-api.conf state=link 9 | notify: [nginx reload] 10 | -------------------------------------------------------------------------------- /roles/carbon/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | carbon_enabled: no 4 | carbon_dir: /etc/carbon 5 | carbon_log_dir: /var/log/carbon 6 | carbon_max_updates_per_second: 10000 7 | carbon_max_creates_per_second: 1000 8 | 9 | carbon_udp_enabled: false 10 | carbon_udp_bind_addr: 0.0.0.0 11 | carbon_udp_port: 2003 12 | 13 | carbon_storage_schemas: 14 | - name: carbon 15 | pattern: ^carbon\..* 16 | retentions: "60s:90d" 17 | - name: default_1min_for_1day 18 | pattern: ".*" 19 | retentions: "1m:1d,10m:7d" 20 | -------------------------------------------------------------------------------- /roles/grafana/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | grafana_enabled: no 4 | grafana_ver: 1.9.0 5 | grafana_dir: /opt/grafana 6 | 7 | grafana_nginx_enabled: yes 8 | grafana_nginx_host: "{{inventory_hostname}}" 9 | grafana_nginx_port: 81 10 | 11 | graphite_host: "{{inventory_hostname}}" 12 | graphite_port: 80 13 | 14 | nginx_enabled: yes 15 | nginx_user: www-data 16 | nginx_group: "{{nginx_user}}" 17 | nginx_dir: /etc/nginx 18 | nginx_sites_enabled: "{{nginx_dir}}/sites-enabled" 19 | nginx_sites_available: "{{nginx_dir}}/sites-available" 20 | -------------------------------------------------------------------------------- /roles/riemann/tasks/riemann.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Download riemann 4 | get_url: url=http://aphyr.com/riemann/riemann_{{riemann_ver}}.deb dest=/tmp/riemann-{{riemann_ver}}.deb 5 | 6 | - name: Install riemann 7 | apt: deb=/tmp/riemann-{{riemann_ver}}.deb 8 | 9 | - name: Configure riemann 10 | template: src=riemann.config.j2 dest={{riemann_dir}}/riemann.config 11 | notify: [riemann reload] 12 | 13 | - name: Configure riemann (influxdb) 14 | template: src=influxdb.clj.j2 dest={{riemann_dir}}/influxdb.clj 15 | notify: [riemann reload] 16 | -------------------------------------------------------------------------------- /roles/influxdb/tasks/influxdb.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Download influxdb 4 | get_url: url=http://s3.amazonaws.com/influxdb/influxdb_{{influxdb_ver}}.deb dest=/tmp/influxdb_{{influxdb_ver}}.deb 5 | 6 | - name: Install influxdb 7 | command: dpkg -i /tmp/influxdb_{{influxdb_ver}}.deb 8 | 9 | - name: Create influxdb log dir 10 | file: path={{influxdb_log_dir}} owner=influxdb group=influxdb state=directory 11 | 12 | - name: Configure influxdb 13 | template: src=config.toml.j2 dest={{influxdb_dir}}/shared/config.toml 14 | notify: 15 | - influxdb reload 16 | -------------------------------------------------------------------------------- /roles/nginx/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | nginx_enabled: no 4 | nginx_user: www-data 5 | nginx_dir: /etc/nginx 6 | nginx_sites_enabled: "{{nginx_dir}}/sites-enabled" 7 | nginx_sites_available: "{{nginx_dir}}/sites-available" 8 | nginx_multi_accept: yes 9 | nginx_worker_processes: auto 10 | nginx_worker_connections: 1024 11 | nginx_sendfile: yes 12 | nginx_tcp_nodelay: yes 13 | nginx_tcp_nopush: yes 14 | nginx_keepalive_timeout: 65 15 | nginx_keepalive_requests: 100 16 | nginx_gzip: yes 17 | nginx_access_log: /var/log/nginx/access.log 18 | nginx_error_log: /var/log/nginx/error.log 19 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | java_enabled: yes 4 | python_enabled: yes 5 | 6 | nginx_enabled: yes 7 | uwsgi_enabled: yes 8 | 9 | # the follow options are mutually exclusive, 10 | # use pair carbon - whisper, or only riemann - influxdb 11 | carbon_enabled: no 12 | riemann_enabled: yes 13 | influxdb_enabled: yes 14 | 15 | graphite_api_enabled: yes 16 | graphite_api_nginx: yes 17 | graphite_api_uwsgi: yes 18 | 19 | # the follow options are mutually exclusive, 20 | # use pair carbon - whisper, or only riemann - influxdb 21 | graphite_api_whisper: no 22 | graphite_api_influxdb: yes 23 | riemann_influxdb: yes 24 | 25 | grafana_enabled: yes 26 | -------------------------------------------------------------------------------- /roles/carbon/templates/storage-schemas.conf.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ansible_fqdn}} 2 | # Do NOT modify this file by hand! 3 | 4 | # Schema definitions for Whisper files. Entries are scanned in order, 5 | # and first match wins. This file is scanned for changes every 60 seconds. 6 | # 7 | # [name] 8 | # pattern = regex 9 | # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... 10 | {% for schema in carbon_storage_schemas %} 11 | [{{schema['name']}}] 12 | {% for name, value in schema.items() %} 13 | {% if name != 'name' %} 14 | {{name}} = {{value}} 15 | {% endif %} 16 | {% endfor %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /roles/carbon/tasks/carbon.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install carbon 4 | apt: pkg=graphite-carbon update_cache=yes cache_valid_time=60 5 | 6 | - name: Enable carbon 7 | template: src=graphite-carbon.j2 dest=/etc/default/graphite-carbon 8 | 9 | - name: Configure carbon 10 | template: src=carbon.conf.j2 dest={{carbon_dir}}/carbon.conf 11 | notify: 12 | - carbon restart 13 | 14 | - name: Configure carbon storage schemas 15 | template: src=storage-schemas.conf.j2 dest={{carbon_dir}}/storage-schemas.conf 16 | notify: 17 | - carbon restart 18 | 19 | - name: Configure carbon storage aggregation 20 | template: src=storage-aggregation.conf.j2 dest={{carbon_dir}}/storage-aggregation.conf 21 | notify: 22 | - carbon restart 23 | -------------------------------------------------------------------------------- /roles/riemann/templates/influxdb.clj.j2: -------------------------------------------------------------------------------- 1 | ; -*- mode: clojure; -*- 2 | ; vim: filetype=clojure 3 | 4 | ;; Base InfluxDB library 5 | (require '[capacitor.core :as influx]) 6 | ;; Async API 7 | (require '[capacitor.async :as influx-async]) 8 | 9 | ;; Create an asynchronous InfluxDB client using the capacitor library 10 | (defn async-influxdb [opts] 11 | (let [client (influx/make-client opts) 12 | 13 | ;; Make a channel to buffer influxdb events 14 | events-in (influx-async/make-chan) 15 | 16 | ;; Make a channel to collect influxdb responses (ignored, really) 17 | resp-out (influx-async/make-chan)] 18 | 19 | ;; Start the run loop with a batch size of max 100 events and max 5 seconds 20 | (influx-async/run! events-in resp-out client 100 5000) 21 | (fn [series payload] 22 | (let [p (merge payload {:series series})] 23 | (influx-async/enqueue events-in p))))) 24 | -------------------------------------------------------------------------------- /roles/graphite-api/templates/nginx-graphite-api.conf.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ ansible_fqdn }} 2 | # Do NOT modify this file by hand! 3 | 4 | server { 5 | listen {{graphite_api_nginx_port}}; 6 | server_name {{graphite_api_nginx_host}}; 7 | 8 | location / { 9 | include uwsgi_params; 10 | uwsgi_pass {{graphite_api_uwsgi_host}}:{{graphite_api_uwsgi_port}}; 11 | 12 | {% if graphite_api_nginx_allow_origin != "" %} 13 | add_header "Access-Control-Allow-Origin" "{{graphite_api_nginx_allow_origin}}"; 14 | add_header "Access-Control-Allow-Credentials" "true"; 15 | add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS"; 16 | add_header "Access-Control-Allow-Headers" "Authorization, origin, accept"; 17 | {% endif %} 18 | 19 | if ($request_method = 'OPTIONS' ) { 20 | # if request method is options we immediately return with 200 OK. 21 | return 200; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /roles/graphite-api/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | graphite_api_enabled: no 4 | graphite_api_dir: /opt/graphite 5 | graphite_api_user: graphite 6 | graphite_api_group: "{{graphite_api_user}}" 7 | graphite_api_timezone: UTC 8 | graphite_api_search_index: "{{graphite_api_dir}}/index" 9 | 10 | graphite_api_nginx: no 11 | graphite_api_nginx_host: "{{inventory_hostname}}" 12 | graphite_api_nginx_port: 80 13 | graphite_api_nginx_allow_origin: '$http_origin' 14 | 15 | graphite_api_uwsgi: no 16 | graphite_api_uwsgi_host: "{{inventory_hostname}}" 17 | graphite_api_uwsgi_port: 8080 18 | 19 | graphite_api_influxdb: no 20 | graphite_api_influxdb_host: "{{inventory_hostname}}" 21 | graphite_api_influxdb_port: 8086 22 | graphite_api_influxdb_user: metrics 23 | graphite_api_influxdb_pass: metrics 24 | graphite_api_influxdb_db: metrics 25 | 26 | graphite_api_whisper: no 27 | graphite_api_whisper_directory: "{{graphite_api_dir}}/storage/whisper" 28 | graphite_api_whisper_directories: 29 | - "{{graphite_api_whisper_directory}}" 30 | -------------------------------------------------------------------------------- /roles/carbon/templates/storage-aggregation.conf.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ansible_fqdn}} 2 | # Do NOT modify this file by hand! 3 | 4 | # Aggregation methods for whisper files. Entries are scanned in order, 5 | # and first match wins. This file is scanned for changes every 60 seconds 6 | # 7 | # [name] 8 | # pattern = 9 | # xFilesFactor = 10 | # aggregationMethod = 11 | # 12 | # name: Arbitrary unique name for the rule 13 | # pattern: Regex pattern to match against the metric name 14 | # xFilesFactor: Ratio of valid data points required for aggregation to the next retention to occur 15 | # aggregationMethod: function to apply to data points for aggregation 16 | # 17 | [min] 18 | pattern = \.min$ 19 | xFilesFactor = 0.1 20 | aggregationMethod = min 21 | 22 | [max] 23 | pattern = \.max$ 24 | xFilesFactor = 0.1 25 | aggregationMethod = max 26 | 27 | [sum] 28 | pattern = \.count$ 29 | xFilesFactor = 0 30 | aggregationMethod = sum 31 | 32 | [default_average] 33 | pattern = .* 34 | xFilesFactor = 0.5 35 | aggregationMethod = average 36 | -------------------------------------------------------------------------------- /roles/riemann/templates/riemann.config.j2: -------------------------------------------------------------------------------- 1 | ; -*- mode: clojure; -*- 2 | ; vim: filetype=clojure 3 | 4 | (logging/init {:file "{{riemann_log}}"}) 5 | 6 | (load-plugins) 7 | 8 | {% if riemann_influxdb %} 9 | (include "influxdb.clj") 10 | {% endif %} 11 | 12 | (graphite-server :host "0.0.0.0" 13 | :port 2003) 14 | 15 | {% if riemann_influxdb %} 16 | (def main-influxdb (async-influxdb {:host "{{riemann_influxdb_host}}" 17 | :port {{riemann_influxdb_port}} 18 | :username "{{riemann_influxdb_user}}" 19 | :password "{{riemann_influxdb_pass}}" 20 | :db "{{riemann_influxdb_db}}"})) 21 | {% endif %} 22 | 23 | (let [index (index)] 24 | (streams 25 | prn 26 | 27 | {% if riemann_influxdb %} 28 | (where (not (service #"^riemann")) 29 | #(main-influxdb (:service %) {:host (:host %) 30 | :time (:time %) 31 | :value (:metric %) 32 | :name (:service %)})) 33 | {% endif %} 34 | )) 35 | -------------------------------------------------------------------------------- /roles/graphite-api/templates/config.yml.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ansible_fqdn}} 2 | # Do NOT modify this file by hand! 3 | 4 | search_index: {{graphite_api_search_index}} 5 | finders: 6 | {% if graphite_api_whisper %} 7 | - graphite_api.finders.whisper.WhisperFinder 8 | {% endif %} 9 | {% if graphite_api_influxdb %} 10 | - graphite_influxdb.InfluxdbFinder 11 | {% endif %} 12 | functions: 13 | - graphite_api.functions.SeriesFunctions 14 | - graphite_api.functions.PieFunctions 15 | {% if graphite_api_whisper %} 16 | whisper: 17 | directories: 18 | {% for dir in graphite_api_whisper_directories %} 19 | - {{dir}} 20 | {% endfor %} 21 | {% endif %} 22 | {% if graphite_api_influxdb %} 23 | influxdb: 24 | host: {{graphite_api_influxdb_host}} 25 | port: {{graphite_api_influxdb_port}} 26 | user: {{graphite_api_influxdb_user}} 27 | pass: {{graphite_api_influxdb_pass}} 28 | db: {{graphite_api_influxdb_db}} 29 | schema: 30 | - ['', 30] 31 | - ['high-res-metrics', 10] 32 | cache: 33 | type: 'filesystem' 34 | dir: '/tmp/graphite-api-cache' 35 | {% endif %} 36 | time_zone: {{graphite_api_timezone}} 37 | -------------------------------------------------------------------------------- /roles/nginx/templates/nginx.conf.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ ansible_fqdn }} 2 | # Do NOT modify this file by hand! 3 | 4 | user {{nginx_user}}; 5 | worker_processes {{nginx_worker_processes}}; 6 | 7 | events { 8 | multi_accept {{'on' if nginx_multi_accept else 'off'}}; 9 | worker_connections {{nginx_worker_connections}}; 10 | } 11 | 12 | http { 13 | include mime.types; 14 | default_type application/octet-stream; 15 | 16 | server_tokens off; 17 | 18 | sendfile {{'on' if nginx_sendfile else 'off'}}; 19 | 20 | tcp_nodelay {{'on' if nginx_tcp_nodelay else 'off'}}; 21 | tcp_nopush {{'on' if nginx_tcp_nopush else 'off'}}; 22 | 23 | keepalive_timeout {{nginx_keepalive_timeout}}; 24 | keepalive_requests {{nginx_keepalive_requests}}; 25 | 26 | {% if nginx_gzip %} 27 | gzip on; 28 | gzip_disable "msie6"; 29 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; 30 | {% endif %} 31 | 32 | access_log {{nginx_access_log}}; 33 | error_log {{nginx_error_log}}; 34 | 35 | include {{nginx_dir}}/conf.d/*.conf; 36 | include {{nginx_sites_enabled}}/*; 37 | } 38 | -------------------------------------------------------------------------------- /roles/grafana/tasks/grafana.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Download grafana 4 | get_url: url=http://grafanarel.s3.amazonaws.com/grafana-{{grafana_ver}}.tar.gz dest=/tmp/grafana-{{grafana_ver}}.tar.gz 5 | 6 | - name: Create grafana dir 7 | file: path={{grafana_dir}} owner={{nginx_user}} group={{nginx_group}} state=directory 8 | 9 | - name: Install grafana 10 | unarchive: src=/tmp/grafana-{{grafana_ver}}.tar.gz dest={{grafana_dir}} copy=no owner={{nginx_user}} group={{nginx_group}} 11 | 12 | - name: Link installed grafana with default 13 | file: src={{grafana_dir}}/grafana-{{grafana_ver}} dest={{grafana_dir}}/grafana state=link 14 | 15 | - name: Configure grafana 16 | template: src=config.js.j2 dest={{grafana_dir}}/grafana/config.js 17 | 18 | - name: Setup grafana dir permissions 19 | file: path={{grafana_dir}} owner={{nginx_user}} group={{nginx_group}} recurse=yes 20 | 21 | - name: Configure nginx grafana site 22 | template: src=nginx-grafana.conf.j2 dest={{nginx_sites_available}}/grafana.conf 23 | notify: [nginx reload] 24 | when: nginx_enabled and grafana_nginx_enabled 25 | 26 | - name: Enable nginx grafana site 27 | file: src={{nginx_sites_available}}/grafana.conf dest={{nginx_sites_enabled}}/grafana.conf state=link 28 | notify: [nginx reload] 29 | when: nginx_enabled and grafana_nginx_enabled 30 | -------------------------------------------------------------------------------- /roles/graphite-api/tasks/graphite-api.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install graphite-api dependencies 4 | apt: pkg={{item}} update_cache=yes cache_valid_time=60 5 | with_items: 6 | - libcairo2 7 | - libcairo-dev 8 | - libffi5 9 | - libffi-dev 10 | - libyaml-dev 11 | 12 | - name: Create graphite-api user 13 | user: name={{graphite_api_user}} home={{graphite_api_dir}} 14 | 15 | - name: Setup virtualenv for graphite-api 16 | shell: virtualenv {{graphite_api_dir}}/env --python=python creates={{graphite_api_dir}}/env/bin/pip 17 | sudo: yes 18 | sudo_user: "{{graphite_api_user}}" 19 | 20 | - name: Install graphite-api 21 | pip: name={{item}} executable={{graphite_api_dir}}/env/bin/pip 22 | sudo: yes 23 | sudo_user: "{{graphite_api_user}}" 24 | with_items: 25 | - flask 26 | - flask-cache 27 | - https://github.com/Dieterbe/graphite-api/tarball/support-templates2 28 | # - graphite-api use instead patched version ^ 29 | 30 | - name: Configure graphite-api 31 | template: src=config.yml.j2 dest={{graphite_api_dir}}/config.yml owner={{graphite_api_user}} group={{graphite_api_group}} 32 | 33 | - include: whisper.yml 34 | tags: [graphite-api, graphite-api-whisper] 35 | when: graphite_api_whisper 36 | 37 | - include: influxdb.yml 38 | tags: [graphite-api, graphite-api-influxdb] 39 | when: influxdb_enabled and graphite_api_influxdb 40 | 41 | - include: nginx.yml 42 | tags: [graphite-api, graphite-api-nginx] 43 | when: nginx_enabled and graphite_api_nginx 44 | 45 | - include: uwsgi.yml 46 | tags: [graphite-api, graphite-api-uwsgi] 47 | when: uwsgi_enabled and graphite_api_uwsgi 48 | -------------------------------------------------------------------------------- /roles/grafana/templates/config.js.j2: -------------------------------------------------------------------------------- 1 | // This file was generated by Ansible for {{ ansible_fqdn }} 2 | // Do NOT modify this file by hand! 3 | 4 | // == Configuration 5 | // config.js is where you will find the core Grafana configuration. This file contains parameter that 6 | // must be set before Grafana is run for the first time. 7 | 8 | define(['settings'], function(Settings) { 9 | 10 | 11 | return new Settings({ 12 | 13 | /* Data sources 14 | * ======================================================== 15 | * Datasources are used to fetch metrics, annotations, and serve as dashboard storage 16 | * - You can have multiple of the same type. 17 | * - grafanaDB: true marks it for use for dashboard storage 18 | * - default: true marks the datasource as the default metric source (if you have multiple) 19 | * - basic authentication: use url syntax http://username:password@domain:port 20 | */ 21 | 22 | datasources: { 23 | graphite: { 24 | type: 'graphite', 25 | url: "http://{{graphite_host}}:{{graphite_port}}", 26 | }, 27 | influxdb: { 28 | type: 'influxdb', 29 | url: "http://{{influxdb_host}}:{{influxdb_port}}/db/grafana-dashboards", 30 | username: 'grafana-dashboards', 31 | password: 'grafana-dashboards', 32 | grafanaDB: true 33 | } 34 | }, 35 | 36 | // InfluxDB example setup (the InfluxDB databases specified need to exist) 37 | /* 38 | datasources: { 39 | influxdb: { 40 | type: 'influxdb', 41 | url: "http://my_influxdb_server:8086/db/database_name", 42 | username: 'admin', 43 | password: 'admin', 44 | }, 45 | grafana: { 46 | type: 'influxdb', 47 | url: "http://my_influxdb_server:8086/db/grafana", 48 | username: 'admin', 49 | password: 'admin', 50 | grafanaDB: true, 51 | } 52 | }, 53 | */ 54 | 55 | // Graphite & Elasticsearch example setup 56 | /* 57 | datasources: { 58 | graphite: { 59 | type: 'graphite', 60 | url: "http://my.graphite.server.com:8080", 61 | }, 62 | elasticsearch: { 63 | type: 'elasticsearch', 64 | url: "http://my.elastic.server.com:9200", 65 | index: 'grafana-dash', 66 | grafanaDB: true, 67 | } 68 | }, 69 | */ 70 | 71 | // OpenTSDB & Elasticsearch example setup 72 | /* 73 | datasources: { 74 | opentsdb: { 75 | type: 'opentsdb', 76 | url: "http://opentsdb.server:4242", 77 | }, 78 | elasticsearch: { 79 | type: 'elasticsearch', 80 | url: "http://my.elastic.server.com:9200", 81 | index: 'grafana-dash', 82 | grafanaDB: true, 83 | } 84 | }, 85 | */ 86 | 87 | /* Global configuration options 88 | * ======================================================== 89 | */ 90 | 91 | // specify the limit for dashboard search results 92 | search: { 93 | max_results: 100 94 | }, 95 | 96 | // default home dashboard 97 | default_route: '/dashboard/file/default.json', 98 | 99 | // set to false to disable unsaved changes warning 100 | unsaved_changes_warning: true, 101 | 102 | // set the default timespan for the playlist feature 103 | // Example: "1m", "1h" 104 | playlist_timespan: "1m", 105 | 106 | // If you want to specify password before saving, please specify it below 107 | // The purpose of this password is not security, but to stop some users from accidentally changing dashboards 108 | admin: { 109 | password: '' 110 | }, 111 | 112 | // Change window title prefix from 'Grafana - ' 113 | window_title_prefix: 'Grafana - ', 114 | 115 | // Add your own custom panels 116 | plugins: { 117 | // list of plugin panels 118 | panels: [], 119 | // requirejs modules in plugins folder that should be loaded 120 | // for example custom datasources 121 | dependencies: [], 122 | } 123 | 124 | }); 125 | }); 126 | -------------------------------------------------------------------------------- /roles/influxdb/templates/config.toml.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ ansible_fqdn }} 2 | # Do NOT modify this file by hand! 3 | 4 | # Welcome to the InfluxDB configuration file. 5 | 6 | # If hostname (on the OS) doesn't return a name that can be resolved by the other 7 | # systems in the cluster, you'll have to set the hostname to an IP or something 8 | # that can be resolved here. 9 | hostname = "{{influxdb_host}}" 10 | 11 | bind-address = "{{influxdb_bind_addr}}" 12 | 13 | # Once every 24 hours InfluxDB will report anonymous data to m.influxdb.com 14 | # The data includes raft name (random 8 bytes), os, arch and version 15 | # We don't track ip addresses of servers reporting. This is only used 16 | # to track the number of instances running and the versions which 17 | # is very helpful for us. 18 | # Change this option to true to disable reporting. 19 | reporting-disabled = false 20 | 21 | [logging] 22 | # logging level can be one of "fine", "debug", "info", "warn" or "error" 23 | level = "info" 24 | file = "{{influxdb_log_dir}}/log.txt" # stdout to log to standard out, or syslog facility 25 | 26 | # Configure the admin server 27 | [admin] 28 | port = {{influxdb_admin_port}} # binding is disabled if the port isn't set 29 | 30 | # Configure the http api 31 | [api] 32 | port = {{influxdb_port}} # binding is disabled if the port isn't set 33 | # ssl-port = 8084 # ssl support is enabled if you set a port and cert 34 | # ssl-cert = /path/to/cert.pem 35 | 36 | # connections will timeout after this amount of time. Ensures that clients that misbehave 37 | # and keep alive connections they don't use won't end up connection a million times. 38 | # However, if a request is taking longer than this to complete, could be a problem. 39 | read-timeout = "5s" 40 | 41 | [input_plugins] 42 | 43 | # Configure the graphite api 44 | [input_plugins.graphite] 45 | enabled = false 46 | # address = "0.0.0.0" # If not set, is actually set to bind-address. 47 | # port = 2003 48 | # database = "" # store graphite data in this database 49 | # udp_enabled = true # enable udp interface on the same port as the tcp interface 50 | 51 | # Configure the collectd api 52 | [input_plugins.collectd] 53 | enabled = false 54 | # address = "0.0.0.0" # If not set, is actually set to bind-address. 55 | # port = 25826 56 | # database = "" 57 | # types.db can be found in a collectd installation or on github: 58 | # https://github.com/collectd/collectd/blob/master/src/types.db 59 | # typesdb = "/usr/share/collectd/types.db" # The path to the collectd types.db file 60 | 61 | # Configure the udp api 62 | [input_plugins.udp] 63 | enabled = false 64 | # port = 4444 65 | # database = "" 66 | 67 | # Configure multiple udp apis each can write to separate db. Just 68 | # repeat the following section to enable multiple udp apis on 69 | # different ports. 70 | [[input_plugins.udp_servers]] # array of tables 71 | enabled = false 72 | # port = 5551 73 | # database = "db1" 74 | 75 | # Raft configuration 76 | [raft] 77 | # The raft port should be open between all servers in a cluster. 78 | # However, this port shouldn't be accessible from the internet. 79 | 80 | port = {{influxdb_raft_port}} 81 | 82 | # Where the raft logs are stored. The user running InfluxDB will need read/write access. 83 | dir = "/opt/influxdb/shared/data/raft" 84 | 85 | debug = false 86 | 87 | # election-timeout = "1s" 88 | 89 | [storage] 90 | 91 | dir = "/opt/influxdb/shared/data/db" 92 | # How many requests to potentially buffer in memory. If the buffer gets filled then writes 93 | # will still be logged and once the local storage has caught up (or compacted) the writes 94 | # will be replayed from the WAL 95 | write-buffer-size = 10000 96 | 97 | # the engine to use for new shards, old shards will continue to use the same engine 98 | default-engine = "rocksdb" 99 | 100 | # The default setting on this is 0, which means unlimited. Set this to something if you want to 101 | # limit the max number of open files. max-open-files is per shard so this * that will be max. 102 | max-open-shards = 0 103 | 104 | # The default setting is 100. This option tells how many points will be fetched from LevelDb before 105 | # they get flushed into backend. 106 | point-batch-size = 100 107 | 108 | # The number of points to batch in memory before writing them to leveldb. Lowering this number will 109 | # reduce the memory usage, but will result in slower writes. 110 | write-batch-size = 5000000 111 | 112 | # The server will check this often for shards that have expired that should be cleared. 113 | retention-sweep-period = "10m" 114 | 115 | [storage.engines.leveldb] 116 | 117 | # Maximum mmap open files, this will affect the virtual memory used by 118 | # the process 119 | max-open-files = 1000 120 | 121 | # LRU cache size, LRU is used by leveldb to store contents of the 122 | # uncompressed sstables. You can use `m` or `g` prefix for megabytes 123 | # and gigabytes, respectively. 124 | lru-cache-size = "200m" 125 | 126 | [storage.engines.rocksdb] 127 | 128 | # Maximum mmap open files, this will affect the virtual memory used by 129 | # the process 130 | max-open-files = 1000 131 | 132 | # LRU cache size, LRU is used by rocksdb to store contents of the 133 | # uncompressed sstables. You can use `m` or `g` prefix for megabytes 134 | # and gigabytes, respectively. 135 | lru-cache-size = "200m" 136 | 137 | [storage.engines.hyperleveldb] 138 | 139 | # Maximum mmap open files, this will affect the virtual memory used by 140 | # the process 141 | max-open-files = 1000 142 | 143 | # LRU cache size, LRU is used by rocksdb to store contents of the 144 | # uncompressed sstables. You can use `m` or `g` prefix for megabytes 145 | # and gigabytes, respectively. 146 | lru-cache-size = "200m" 147 | 148 | [storage.engines.lmdb] 149 | 150 | map-size = "100g" 151 | 152 | [cluster] 153 | # A comma separated list of servers to seed 154 | # this server. this is only relevant when the 155 | # server is joining a new cluster. Otherwise 156 | # the server will use the list of known servers 157 | # prior to shutting down. Any server can be pointed to 158 | # as a seed. It will find the Raft leader automatically. 159 | 160 | # Here's an example. Note that the port on the host is the same as the raft port. 161 | # seed-servers = ["hosta:8090","hostb:8090"] 162 | 163 | # Replication happens over a TCP connection with a Protobuf protocol. 164 | # This port should be reachable between all servers in a cluster. 165 | # However, this port shouldn't be accessible from the internet. 166 | 167 | protobuf_port = 8099 168 | protobuf_timeout = "2s" # the write timeout on the protobuf conn any duration parseable by time.ParseDuration 169 | protobuf_heartbeat = "200ms" # the heartbeat interval between the servers. must be parseable by time.ParseDuration 170 | protobuf_min_backoff = "1s" # the minimum backoff after a failed heartbeat attempt 171 | protobuf_max_backoff = "10s" # the maxmimum backoff after a failed heartbeat attempt 172 | 173 | # How many write requests to potentially buffer in memory per server. If the buffer gets filled then writes 174 | # will still be logged and once the server has caught up (or come back online) the writes 175 | # will be replayed from the WAL 176 | write-buffer-size = 1000 177 | 178 | # the maximum number of responses to buffer from remote nodes, if the 179 | # expected number of responses exceed this number then querying will 180 | # happen sequentially and the buffer size will be limited to this 181 | # number 182 | max-response-buffer-size = 100 183 | 184 | # When queries get distributed out to shards, they go in parallel. This means that results can get buffered 185 | # in memory since results will come in any order, but have to be processed in the correct time order. 186 | # Setting this higher will give better performance, but you'll need more memory. Setting this to 1 will ensure 187 | # that you don't need to buffer in memory, but you won't get the best performance. 188 | concurrent-shard-query-limit = 10 189 | 190 | [wal] 191 | 192 | dir = "/opt/influxdb/shared/data/wal" 193 | flush-after = 1000 # the number of writes after which wal will be flushed, 0 for flushing on every write 194 | bookmark-after = 1000 # the number of writes after which a bookmark will be created 195 | 196 | # the number of writes after which an index entry is created pointing 197 | # to the offset of the first request, default to 1k 198 | index-after = 1000 199 | 200 | # the number of requests per one log file, if new requests came in a 201 | # new log file will be created 202 | requests-per-logfile = 10000 203 | -------------------------------------------------------------------------------- /roles/carbon/templates/carbon.conf.j2: -------------------------------------------------------------------------------- 1 | # This file was generated by Ansible for {{ansible_fqdn}} 2 | # Do NOT modify this file by hand! 3 | 4 | [cache] 5 | # Configure carbon directories. 6 | # 7 | # OS environment variables can be used to tell carbon where graphite is 8 | # installed, where to read configuration from and where to write data. 9 | # 10 | # GRAPHITE_ROOT - Root directory of the graphite installation. 11 | # Defaults to ../ 12 | # GRAPHITE_CONF_DIR - Configuration directory (where this file lives). 13 | # Defaults to $GRAPHITE_ROOT/conf/ 14 | # GRAPHITE_STORAGE_DIR - Storage directory for whipser/rrd/log/pid files. 15 | # Defaults to $GRAPHITE_ROOT/storage/ 16 | # 17 | # To change other directory paths, add settings to this file. The following 18 | # configuration variables are available with these default values: 19 | # 20 | STORAGE_DIR = {{graphite_api_dir}} 21 | CONF_DIR = {{carbon_dir}} 22 | LOG_DIR = {{carbon_log_dir}} 23 | PID_DIR = /var/run/ 24 | 25 | LOCAL_DATA_DIR = {{graphite_api_whisper_directory}} 26 | 27 | # Specify the user to drop privileges to 28 | # If this is blank carbon runs as the user that invokes it 29 | # This user must have write access to the local data directory 30 | USER = {{graphite_api_user}} 31 | 32 | # Limit the size of the cache to avoid swapping or becoming CPU bound. 33 | # Sorts and serving cache queries gets more expensive as the cache grows. 34 | # Use the value "inf" (infinity) for an unlimited cache size. 35 | MAX_CACHE_SIZE = inf 36 | 37 | # Limits the number of whisper update_many() calls per second, which effectively 38 | # means the number of write requests sent to the disk. This is intended to 39 | # prevent over-utilizing the disk and thus starving the rest of the system. 40 | # When the rate of required updates exceeds this, then carbon's caching will 41 | # take effect and increase the overall throughput accordingly. 42 | MAX_UPDATES_PER_SECOND = {{carbon_max_updates_per_second}} 43 | 44 | # Softly limits the number of whisper files that get created each minute. 45 | # Setting this value low (like at 50) is a good way to ensure your graphite 46 | # system will not be adversely impacted when a bunch of new metrics are 47 | # sent to it. The trade off is that it will take much longer for those metrics' 48 | # database files to all get created and thus longer until the data becomes usable. 49 | # Setting this value high (like "inf" for infinity) will cause graphite to create 50 | # the files quickly but at the risk of slowing I/O down considerably for a while. 51 | MAX_CREATES_PER_MINUTE = {{carbon_max_creates_per_second}} 52 | 53 | LINE_RECEIVER_INTERFACE = 0.0.0.0 54 | LINE_RECEIVER_PORT = 2003 55 | 56 | # Set this to True to enable the UDP listener. By default this is off 57 | # because it is very common to run multiple carbon daemons and managing 58 | # another (rarely used) port for every carbon instance is not fun. 59 | ENABLE_UDP_LISTENER = {{True if carbon_udp_enabled else False}} 60 | UDP_RECEIVER_INTERFACE = {{carbon_udp_bind_addr}} 61 | UDP_RECEIVER_PORT = {{carbon_udp_port}} 62 | 63 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 64 | PICKLE_RECEIVER_PORT = 2004 65 | 66 | # Per security concerns outlined in Bug #817247 the pickle receiver 67 | # will use a more secure and slightly less efficient unpickler. 68 | # Set this to True to revert to the old-fashioned insecure unpickler. 69 | USE_INSECURE_UNPICKLER = False 70 | 71 | CACHE_QUERY_INTERFACE = 0.0.0.0 72 | CACHE_QUERY_PORT = 7002 73 | 74 | # Set this to False to drop datapoints received after the cache 75 | # reaches MAX_CACHE_SIZE. If this is True (the default) then sockets 76 | # over which metrics are received will temporarily stop accepting 77 | # data until the cache size falls below 95% MAX_CACHE_SIZE. 78 | USE_FLOW_CONTROL = True 79 | 80 | # By default, carbon-cache will log every whisper update. This can be excessive and 81 | # degrade performance if logging on the same volume as the whisper data is stored. 82 | LOG_UPDATES = False 83 | 84 | # On some systems it is desirable for whisper to write synchronously. 85 | # Set this option to True if you'd like to try this. Basically it will 86 | # shift the onus of buffering writes from the kernel into carbon's cache. 87 | WHISPER_AUTOFLUSH = False 88 | 89 | # By default new Whisper files are created pre-allocated with the data region 90 | # filled with zeros to prevent fragmentation and speed up contiguous reads and 91 | # writes (which are common). Enabling this option will cause Whisper to create 92 | # the file sparsely instead. Enabling this option may allow a large increase of 93 | # MAX_CREATES_PER_MINUTE but may have longer term performance implications 94 | # depending on the underlying storage configuration. 95 | # WHISPER_SPARSE_CREATE = False 96 | 97 | # Enabling this option will cause Whisper to lock each Whisper file it writes 98 | # to with an exclusive lock (LOCK_EX, see: man 2 flock). This is useful when 99 | # multiple carbon-cache daemons are writing to the same files 100 | # WHISPER_LOCK_WRITES = False 101 | 102 | # Set this to True to enable whitelisting and blacklisting of metrics in 103 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 104 | # empty, all metrics will pass through 105 | # USE_WHITELIST = False 106 | 107 | # By default, carbon itself will log statistics (such as a count, 108 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 109 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 110 | # CARBON_METRIC_PREFIX = carbon 111 | # CARBON_METRIC_INTERVAL = 60 112 | 113 | # Enable AMQP if you want to receve metrics using an amqp broker 114 | # ENABLE_AMQP = False 115 | 116 | # Verbose means a line will be logged for every metric received 117 | # useful for testing 118 | # AMQP_VERBOSE = False 119 | 120 | # AMQP_HOST = localhost 121 | # AMQP_PORT = 5672 122 | # AMQP_VHOST = / 123 | # AMQP_USER = guest 124 | # AMQP_PASSWORD = guest 125 | # AMQP_EXCHANGE = graphite 126 | # AMQP_METRIC_NAME_IN_BODY = False 127 | 128 | # The manhole interface allows you to SSH into the carbon daemon 129 | # and get a python interpreter. BE CAREFUL WITH THIS! If you do 130 | # something like time.sleep() in the interpreter, the whole process 131 | # will sleep! This is *extremely* helpful in debugging, assuming 132 | # you are familiar with the code. If you are not, please don't 133 | # mess with this, you are asking for trouble :) 134 | # 135 | # ENABLE_MANHOLE = False 136 | # MANHOLE_INTERFACE = 127.0.0.1 137 | # MANHOLE_PORT = 7222 138 | # MANHOLE_USER = admin 139 | # MANHOLE_PUBLIC_KEY = ssh-rsa AAAAB3NzaC1yc2EAAAABiwAaAIEAoxN0sv/e4eZCPpi3N3KYvyzRaBaMeS2RsOQ/cDuKv11dlNzVeiyc3RFmCv5Rjwn/lQ79y0zyHxw67qLyhQ/kDzINc4cY41ivuQXm2tPmgvexdrBv5nsfEpjs3gLZfJnyvlcVyWK/lId8WUvEWSWHTzsbtmXAF2raJMdgLTbQ8wE= 140 | 141 | # Patterns for all of the metrics this machine will store. Read more at 142 | # http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Bindings 143 | # 144 | # Example: store all sales, linux servers, and utilization metrics 145 | # BIND_PATTERNS = sales.#, servers.linux.#, #.utilization 146 | # 147 | # Example: store everything 148 | # BIND_PATTERNS = # 149 | 150 | # To configure special settings for the carbon-cache instance 'b', uncomment this: 151 | #[cache:b] 152 | #LINE_RECEIVER_PORT = 2103 153 | #PICKLE_RECEIVER_PORT = 2104 154 | #CACHE_QUERY_PORT = 7102 155 | # and any other settings you want to customize, defaults are inherited 156 | # from [carbon] section. 157 | # You can then specify the --instance=b option to manage this instance 158 | 159 | 160 | 161 | [relay] 162 | LINE_RECEIVER_INTERFACE = 0.0.0.0 163 | LINE_RECEIVER_PORT = 2013 164 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 165 | PICKLE_RECEIVER_PORT = 2014 166 | 167 | # To use consistent hashing instead of the user defined relay-rules.conf, 168 | # change this to: 169 | # RELAY_METHOD = consistent-hashing 170 | RELAY_METHOD = rules 171 | 172 | # If you use consistent-hashing you may want to add redundancy 173 | # of your data by replicating every datapoint to more than 174 | # one machine. 175 | REPLICATION_FACTOR = 1 176 | 177 | # This is a list of carbon daemons we will send any relayed or 178 | # generated metrics to. The default provided would send to a single 179 | # carbon-cache instance on the default port. However if you 180 | # use multiple carbon-cache instances then it would look like this: 181 | # 182 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 183 | # 184 | # The general form is IP:PORT:INSTANCE where the :INSTANCE part is 185 | # optional and refers to the "None" instance if omitted. 186 | # 187 | # Note that if the destinations are all carbon-caches then this should 188 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 189 | # instances listed (order matters!). 190 | # 191 | # If using RELAY_METHOD = rules, all destinations used in relay-rules.conf 192 | # must be defined in this list 193 | DESTINATIONS = 127.0.0.1:2004 194 | 195 | # This defines the maximum "message size" between carbon daemons. 196 | # You shouldn't need to tune this unless you really know what you're doing. 197 | MAX_DATAPOINTS_PER_MESSAGE = 500 198 | MAX_QUEUE_SIZE = 10000 199 | 200 | # Set this to False to drop datapoints when any send queue (sending datapoints 201 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 202 | # default) then sockets over which metrics are received will temporarily stop accepting 203 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 204 | USE_FLOW_CONTROL = True 205 | 206 | # Set this to True to enable whitelisting and blacklisting of metrics in 207 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 208 | # empty, all metrics will pass through 209 | # USE_WHITELIST = False 210 | 211 | # By default, carbon itself will log statistics (such as a count, 212 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 213 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 214 | # CARBON_METRIC_PREFIX = carbon 215 | # CARBON_METRIC_INTERVAL = 60 216 | 217 | 218 | [aggregator] 219 | LINE_RECEIVER_INTERFACE = 0.0.0.0 220 | LINE_RECEIVER_PORT = 2023 221 | 222 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 223 | PICKLE_RECEIVER_PORT = 2024 224 | 225 | # This is a list of carbon daemons we will send any relayed or 226 | # generated metrics to. The default provided would send to a single 227 | # carbon-cache instance on the default port. However if you 228 | # use multiple carbon-cache instances then it would look like this: 229 | # 230 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 231 | # 232 | # The format is comma-delimited IP:PORT:INSTANCE where the :INSTANCE part is 233 | # optional and refers to the "None" instance if omitted. 234 | # 235 | # Note that if the destinations are all carbon-caches then this should 236 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 237 | # instances listed (order matters!). 238 | DESTINATIONS = 127.0.0.1:2004 239 | 240 | # If you want to add redundancy to your data by replicating every 241 | # datapoint to more than one machine, increase this. 242 | REPLICATION_FACTOR = 1 243 | 244 | # This is the maximum number of datapoints that can be queued up 245 | # for a single destination. Once this limit is hit, we will 246 | # stop accepting new data if USE_FLOW_CONTROL is True, otherwise 247 | # we will drop any subsequently received datapoints. 248 | MAX_QUEUE_SIZE = 10000 249 | 250 | # Set this to False to drop datapoints when any send queue (sending datapoints 251 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 252 | # default) then sockets over which metrics are received will temporarily stop accepting 253 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 254 | USE_FLOW_CONTROL = True 255 | 256 | # This defines the maximum "message size" between carbon daemons. 257 | # You shouldn't need to tune this unless you really know what you're doing. 258 | MAX_DATAPOINTS_PER_MESSAGE = 500 259 | 260 | # This defines how many datapoints the aggregator remembers for 261 | # each metric. Aggregation only happens for datapoints that fall in 262 | # the past MAX_AGGREGATION_INTERVALS * intervalSize seconds. 263 | MAX_AGGREGATION_INTERVALS = 5 264 | 265 | # Set this to True to enable whitelisting and blacklisting of metrics in 266 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 267 | # empty, all metrics will pass through 268 | # USE_WHITELIST = False 269 | 270 | # By default, carbon itself will log statistics (such as a count, 271 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 272 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 273 | # CARBON_METRIC_PREFIX = carbon 274 | # CARBON_METRIC_INTERVAL = 60, 275 | --------------------------------------------------------------------------------