From 93445ff303c75179c6e95e26b332b23c66357121 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 29 Sep 2020 13:30:58 +1000 Subject: [PATCH] graphite: copy storage-schemas from puppet-graphite This is the storage-schemas configuration file currently deployed by puppet-graphite. Apply it to the container so we maintain the same retention, etc. Change-Id: Ia733bf4a958a559ce3921094bb3f0875365157ce --- playbooks/roles/graphite/tasks/main.yaml | 5 +++++ .../graphite/templates/docker-compose.yaml.j2 | 1 + .../graphite/templates/storage-schemas.conf.j2 | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 playbooks/roles/graphite/templates/storage-schemas.conf.j2 diff --git a/playbooks/roles/graphite/tasks/main.yaml b/playbooks/roles/graphite/tasks/main.yaml index 852f9a9b00..bcedd75dc4 100644 --- a/playbooks/roles/graphite/tasks/main.yaml +++ b/playbooks/roles/graphite/tasks/main.yaml @@ -8,6 +8,11 @@ src: docker-compose.yaml.j2 dest: /etc/graphite-docker/docker-compose.yaml +- name: Write storage config file + template: + src: storage-schemas.conf.j2 + dest: /etc/graphite-docker/storage-schemas.conf + - name: Write nginx override config template: src: graphite-statsd.conf.j2 diff --git a/playbooks/roles/graphite/templates/docker-compose.yaml.j2 b/playbooks/roles/graphite/templates/docker-compose.yaml.j2 index 02154cdfe0..75e107e83c 100644 --- a/playbooks/roles/graphite/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/graphite/templates/docker-compose.yaml.j2 @@ -10,6 +10,7 @@ services: volumes: - /etc/graphite-docker/graphite-statsd.conf:/etc/nginx/sites-enabled/graphite-statsd.conf - /etc/graphite-docker/statsd.js:/opt/statsd/config/udp.js + - /etc/graphite-docker/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf - /etc/letsencrypt-certs:/etc/letsencrypt-certs - /opt/graphite/storage:/opt/graphite/storage - /var/log/graphite:/var/log/ diff --git a/playbooks/roles/graphite/templates/storage-schemas.conf.j2 b/playbooks/roles/graphite/templates/storage-schemas.conf.j2 new file mode 100644 index 0000000000..af32933d4a --- /dev/null +++ b/playbooks/roles/graphite/templates/storage-schemas.conf.j2 @@ -0,0 +1,18 @@ +# Schema definitions for Whisper files. Entries are scanned in order, +# and first match wins. This file is scanned for changes every 60 seconds. +# +# [name] +# pattern = regex +# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... + +["stats.timers"] +pattern = ^stats.timers.* +retentions = 10s:8h,60s:7d,1h:90d,1d:1y + +["stats"] +pattern = ^stats.* +retentions = 10s:8h,60s:7d,1h:1y,1d:5y + +["default"] +pattern = .* +retentions = 60:90d