Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include sample storage-aggregation.conf #472

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/deploying-on-k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ local crng = import 'carbon-relay-ng/crng.libsonnet';

Tanka can generate the resource definitions, the output should yield 4 resources:
* a secret with the base64 encoded api key
* a configmap with the carbon-relay-ng.ini and storage-schemas.conf
* a configmap with the carbon-relay-ng.ini, storage-aggregation.conf and storage-schemas.conf
* a service which forwards to the carbon-relay-ng pod
* a deployment creating the carbon-relay-ng pod

Expand Down
5 changes: 5 additions & 0 deletions examples/k8s/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ data:
[default]
pattern = .*
retentions = 10s:1d
storage-aggregation.conf: |
[default]
pattern = .*
xFilesFactor = 0.5
aggregationMethod = average
kind: ConfigMap
metadata:
name: carbon-relay-ng-config
Expand Down
48 changes: 48 additions & 0 deletions examples/storage-aggregation.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# You only need this file if you want to use the grafanaNet route
# (https://github.com/grafana/carbon-relay-ng/blob/master/docs/grafana-net.md)
# In all other cases you can ignore this file.
# This file describes what aggregation (rollup) methods to use for long term storage.
# This is an example file. To find your actual file, check your existing Graphite installation
# if you have one.
# Format is documented at https://graphite.readthedocs.io/en/latest/config-carbon.html#storage-aggregation-conf
# Entries are scanned in order, and first match wins.
#
# [name]
# pattern = <regex>
# xFilesFactor = <float between 0 and 1>
# aggregationMethod = <average|sum|last|max|min>
#
# name: Arbitrary unique name for the rule
# pattern: Regex pattern to match against the metric name
# xFilesFactor: Ratio of valid data points required for aggregation to the next retention to occur
# aggregationMethod: function to apply to data points for aggregation
#
[min]
pattern = \.lower$
xFilesFactor = 0.1
aggregationMethod = min

[max]
pattern = \.upper(_\d+)?$
xFilesFactor = 0.1
aggregationMethod = max

[sum]
pattern = \.sum$
xFilesFactor = 0
aggregationMethod = sum

[count]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum

[count_legacy]
pattern = ^stats_counts.*
xFilesFactor = 0
aggregationMethod = sum

[default_average]
pattern = .*
xFilesFactor = 0.3
aggregationMethod = average
2 changes: 2 additions & 0 deletions examples/storage-schemas.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# You only need this file if you want to use the grafanaNet or kafkaMdm route
# (https://github.com/grafana/carbon-relay-ng/blob/master/docs/grafana-net.md)
# In all other cases you can ignore this file.
# It is important that these intervals accurately match the interval of the data you're sending
# To find your actual file, check your existing Graphite installation if you have one.

# The format is documented at http://graphite.readthedocs.io/en/latest/config-carbon.html#storage-schemas-conf

Expand Down
2 changes: 2 additions & 0 deletions jsonnet/lib/carbon-relay-ng/crng.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local k = import 'ksonnet-util/kausal.libsonnet';
crng_replicas: 1,
crng_config: importstr 'files/carbon-relay-ng.ini',
storage_schemas: importstr 'files/storage-schemas.conf',
storage_aggregation: importstr 'files/storage-aggregation.conf',
},

local configMap = k.core.v1.configMap,
Expand All @@ -22,6 +23,7 @@ local k = import 'ksonnet-util/kausal.libsonnet';
{
'carbon-relay-ng.ini': $._config.crng_config,
'storage-schemas.conf': $._config.storage_schemas,
'storage-aggregation.conf': $._config.storage_aggregation,
}
),

Expand Down
48 changes: 48 additions & 0 deletions jsonnet/lib/carbon-relay-ng/files/storage-aggregation.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# You only need this file if you want to use the grafanaNet route
# (https://github.com/grafana/carbon-relay-ng/blob/master/docs/grafana-net.md)
# In all other cases you can ignore this file.
# This file describes what aggregation (rollup) methods to use for long term storage.
# This is an example file. To find your actual file, check your existing Graphite installation
# if you have one.
# Format is documented at https://graphite.readthedocs.io/en/latest/config-carbon.html#storage-aggregation-conf
# Entries are scanned in order, and first match wins.
#
# [name]
# pattern = <regex>
# xFilesFactor = <float between 0 and 1>
# aggregationMethod = <average|sum|last|max|min>
#
# name: Arbitrary unique name for the rule
# pattern: Regex pattern to match against the metric name
# xFilesFactor: Ratio of valid data points required for aggregation to the next retention to occur
# aggregationMethod: function to apply to data points for aggregation
#
[min]
pattern = \.lower$
xFilesFactor = 0.1
aggregationMethod = min

[max]
pattern = \.upper(_\d+)?$
xFilesFactor = 0.1
aggregationMethod = max

[sum]
pattern = \.sum$
xFilesFactor = 0
aggregationMethod = sum

[count]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum

[count_legacy]
pattern = ^stats_counts.*
xFilesFactor = 0
aggregationMethod = sum

[default_average]
pattern = .*
xFilesFactor = 0.3
aggregationMethod = average