diff --git a/graphite/data/conf/aggregation-rules.conf b/graphite/data/conf/aggregation-rules.conf new file mode 100644 index 0000000..a5e55d5 --- /dev/null +++ b/graphite/data/conf/aggregation-rules.conf @@ -0,0 +1,43 @@ +# The form of each line in this file should be as follows: +# +# output_template (frequency) = method input_pattern +# +# This will capture any received metrics that match 'input_pattern' +# for calculating an aggregate metric. The calculation will occur +# every 'frequency' seconds and the 'method' can specify 'sum' or +# 'avg'. The name of the aggregate metric will be derived from +# 'output_template' filling in any captured fields from 'input_pattern'. +# +# For example, if you're metric naming scheme is: +# +# .applications... +# +# You could configure some aggregations like so: +# +# .applications..all.requests (60) = sum .applications..*.requests +# .applications..all.latency (60) = avg .applications..*.latency +# +# As an example, if the following metrics are received: +# +# prod.applications.apache.www01.requests +# prod.applications.apache.www01.requests +# +# They would all go into the same aggregation buffer and after 60 seconds the +# aggregate metric 'prod.applications.apache.all.requests' would be calculated +# by summing their values. +# +# Template components such as will match everything up to the next dot. +# To match metric multiple components including the dots, use <> in the +# input template: +# +# .applications..all. (60) = sum .applications..*.<> +# +# It is also possible to use regular expressions. Following the example above +# when using: +# +# .applications...requests (60) = sum .applications..\d{2}.requests +# +# You will end up with 'prod.applications.apache.www.requests' instead of +# 'prod.applications.apache.all.requests'. +# +# Note that any time this file is modified, it will be re-read automatically. diff --git a/graphite/data/conf/carbon.conf b/graphite/data/conf/carbon.conf index 24105ec..25eff50 100644 --- a/graphite/data/conf/carbon.conf +++ b/graphite/data/conf/carbon.conf @@ -505,13 +505,13 @@ PICKLE_RECEIVER_PORT = 2024 # If set true, metric received will be forwarded to DESTINATIONS in addition to # the output of the aggregation rules. If set false the carbon-aggregator will # only ever send the output of aggregation. -FORWARD_ALL = True +FORWARD_ALL = False # Filenames of the configuration files to use for this instance of aggregator. # Filenames are relative to CONF_DIR. -# -# AGGREGATION_RULES = aggregation-rules.conf -# REWRITE_RULES = rewrite-rules.conf + +AGGREGATION_RULES = aggregation-rules.conf +REWRITE_RULES = rewrite-rules.conf # This is a list of carbon daemons we will send any relayed or # generated metrics to. The default provided would send to a single diff --git a/graphite/data/conf/rewrite-rules.conf b/graphite/data/conf/rewrite-rules.conf new file mode 100644 index 0000000..f7bd4d1 --- /dev/null +++ b/graphite/data/conf/rewrite-rules.conf @@ -0,0 +1,18 @@ +# This file defines regular expression patterns that can be used to +# rewrite metric names in a search & replace fashion. It consists of two +# sections, [pre] and [post]. The rules in the pre section are applied to +# metric names as soon as they are received. The post rules are applied +# after aggregation has taken place. +# +# The general form of each rule is as follows: +# +# regex-pattern = replacement-text +# +# For example: +# +# [post] +# _sum$ = +# _avg$ = +# +# These rules would strip off a suffix of _sum or _avg from any metric names +# after aggregation. diff --git a/graphite/docker-compose.yml b/graphite/docker-compose.yml index 1250ca3..4fc9bec 100644 --- a/graphite/docker-compose.yml +++ b/graphite/docker-compose.yml @@ -4,6 +4,8 @@ graphite: - "2003:2003" - "2003:2003/udp" - "2004:2004" + - "2023:2023" + - "2024:2024" - "7002:7002" - "8080:8080" - "9001:9001" diff --git a/graphite/supervisord.conf b/graphite/supervisord.conf index db63e8e..df18535 100644 --- a/graphite/supervisord.conf +++ b/graphite/supervisord.conf @@ -15,6 +15,11 @@ command = carbon-cache.py --debug start redirect_stderr = true autorestart = true +[program:carbon-aggregator] +command = carbon-aggregator.py --debug start +redirect_stderr = true +autorestart = true + [program:graphite-webapp] command = gunicorn -b :8080 graphite.wsgi:application directory = /opt/graphite/webapp