Skip to content

ansible role for go-carbon. install and configure a carbon cache writer

License

Notifications You must be signed in to change notification settings

bodsch/ansible-go-carbon

Repository files navigation

Ansible Role: go-carbon

Ansible role to install and configure go-carbon.

Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister

GitHub Workflow Status GitHub issues GitHub release (latest by date)

configure

define your own storage schemas:

go_carbon_storage_schema:
  test:
    pattern: '^test\.'
    retentions: '5m:30d'

define your own storage aggregation:

go_carbon_storage_aggregation:
  count:
    pattern: '\.count$'
    xFilesFactor: 0
    aggregationMethod: sum

You can use also the defaults under vars/main.yml

clean up older whisper data

I use a small (with my modifications) Script from Marianne Spiller / unixe.de

(There you will find more useful tips around the topic of monitoring.

This page is highly recommended, which is what I am doing with it.)

  • You should make sure that a cron-daemon is installed.
  • For RedHat based systems cronie can be used.
  • For Debian based systems cron is available.

You can set the cron-daemon over go_carbon_used_cron_daemon.

Support for systemd is currently not planned.

To active this feature set go_carbon_clean_data_enabled to true

example configuration

go_carbon_whisper_data_directory: /opt/graphite/whisper

go_carbon_storage_schema:
  telegraf:
    # 1 Host and 1 Metric produce: 105.51 Kilobytes
    pattern: '^telegraf\.'
    retentions: '10s:2d,1m:6h,5m:30d'
  grafana:
    # 1 Host and 1 Metric produce: 556.94 Kilobytes
    pattern: '^grafana\.'
    retentions: '1m:15d,5m:30d,15m:120d,1h:240d'
  icinga2:
    # 1 Host and 1 Metric produce: 556.94 Kilobytes
    pattern: '^icinga2\.'
    retentions: '1m:15d,5m:30d,15m:120d,1h:240d'

example playbook

- hosts: monitoring
  gather_facts: true
  become: true
  environment:
    NETRC: ''

  roles:
    - role: go-carbon

tests

You can use a set of test:

default

tox -e py39-ansible29 -- molecule test -s default

letest version from github

tox -e py39-ansible29 -- molecule test -s latest

latest version with automatic clean of older whisper data

tox -e py39-ansible29 -- molecule test -s latest-with-clean-data

named version

tox -e py39-ansible29 -- molecule test -s version-0.14