stuart.stuart_go_carbon
Ansible Role for go-carbon
This role installs and sets up go-carbon, which is a server implementation of Graphite/Carbon made with Golang.
Requirements
This role focuses on installing the carbon component only. You need to disable the original Carbon program if you have a standard Graphite setup.
Role Variables
The go-carbon configuration is created automatically using three dictionaries:
go_carbon_conf:
common:
user: "carbon"
max-cpu: 4
whisper:
data-dir: "/var/lib/graphite/whisper"
go_carbon_storage_schemas:
default:
pattern: ".*"
retentions: "60s:30d,1h:5y"
go_carbon_storage_aggregation_rules:
default:
pattern: ".*"
xFilesFactor: 0.5
aggregationMethod: "average"
The first level creates a section in the respective configuration file, while the nested key/value pairs become entries in that section.
A special case in go_carbon_conf
is logging
. Since go-carbon allows for multiple loggers, you can define them like this:
go_carbon_conf:
logging:
- logger: ""
file: "/var/log/go-carbon/go-carbon.log"
level: "info"
encoding: "mixed"
encoding-time: "iso8601"
encoding-duration: "seconds"
## You can add more loggers, and they'll be listed as [[logging]] sections
# - logger: ""
# file: "stderr"
# level: "error"
Note: The default values are in vars/main.yml
under go_carbon_conf_defaults
, but you must change them using the go_carbon_conf
dictionary.
Dependencies
There are no additional dependencies.
Example Playbook
This example will install go-carbon and set up its configuration, creating the needed directories:
- hosts: servers
roles:
- { role: stuart.go-carbon,
vars: {
go_carbon_conf:
common:
user: "graphite"
max-cpu: 2
whisper:
data-dir: "/var/local/whisper"
cache:
max-size: 2500000
go_carbon_storage_schemas:
default:
pattern: ".*"
retentions: "60s:30d,1h:5y"
go_carbon_storage_aggregation_rules:
default:
pattern: ".*"
xFilesFactor: 0.5
aggregationMethod: "average"
}
}
License
GPLv3
Author Information
This role was originally created by Davide Ferrari during work with Stuart. If you're interested in what we do, feel free to reach out! We are hiring!
Ansible role to install and configure go-carbon
ansible-galaxy install stuart.stuart_go_carbon