Merge "Add 'region' field to the InfluxDB tags if present"
diff --git a/heka/map.jinja b/heka/map.jinja
index 0712436..14c5e4e 100644
--- a/heka/map.jinja
+++ b/heka/map.jinja
@@ -33,6 +33,7 @@
{% set default_elasticsearch_port = 9200 %}
{% set default_influxdb_port = 8086 %}
{% set default_influxdb_time_precision = 'ms' %}
+{% set default_influxdb_tag_fields = ['environment_label', 'region', 'tenant_id', 'user_id'] %}
{% set default_influxdb_timeout = 5000 %}
{% set default_aggregator_port = 5565 %}
{% set default_nagios_port = 8001 %}
@@ -63,6 +64,7 @@
'influxdb_port': default_influxdb_port,
'influxdb_time_precision': default_influxdb_time_precision,
'influxdb_timeout': default_influxdb_timeout,
+ 'influxdb_tag_fields': default_influxdb_tag_fields,
'aggregator_port': default_aggregator_port,
'nagios_port': default_nagios_port,
'poolsize': 100,
@@ -82,6 +84,7 @@
'influxdb_port': default_influxdb_port,
'influxdb_time_precision': default_influxdb_time_precision,
'influxdb_timeout': default_influxdb_timeout,
+ 'influxdb_tag_fields': default_influxdb_tag_fields,
'aggregator_port': default_aggregator_port,
'poolsize': 100,
'automatic_starting': default_automatic_starting,
@@ -97,6 +100,7 @@
'influxdb_port': default_influxdb_port,
'influxdb_time_precision': default_influxdb_time_precision,
'influxdb_timeout': default_influxdb_timeout,
+ 'influxdb_tag_fields': default_influxdb_tag_fields,
'nagios_port': default_nagios_port,
'nagios_default_host_alarm_clusters': default_nagios_host_alarm_clusters,
'poolsize': 100,
diff --git a/heka/meta/heka.yml b/heka/meta/heka.yml
index 60ac77e..8555f47 100644
--- a/heka/meta/heka.yml
+++ b/heka/meta/heka.yml
@@ -146,7 +146,7 @@
message_matcher: "Type =~ /metric$/"
ticker_interval: 1
config:
- tag_fields: "deployment_id environment_label tenant_id user_id"
+ tag_fields: "{{ metric_collector.influxdb_tag_fields|join(' ') }}"
time_precision: "{{ metric_collector.influxdb_time_precision }}"
{%- endif %}
{%- endif %}
@@ -287,7 +287,7 @@
message_matcher: "Type =~ /metric$/"
ticker_interval: 1
config:
- tag_fields: "deployment_id environment_label tenant_id user_id"
+ tag_fields: "{{ remote_collector.influxdb_tag_fields|join(' ') }}"
time_precision: "{{ remote_collector.influxdb_time_precision }}"
{%- endif %}
{%- if remote_collector.amqp_host is defined %}
@@ -548,7 +548,7 @@
message_matcher: "Type == 'heka.sandbox.gse_metric' || Type == 'heka.sandbox.metric'"
ticker_interval: 1
config:
- tag_fields: "deployment_id environment_label tenant_id user_id"
+ tag_fields: "{{ aggregator.influxdb_tag_fields|join(' ') }}"
time_precision: "{{ aggregator.influxdb_time_precision }}"
influxdb_annotation:
engine: sandbox