Merge "Add alerts for influxdb"
diff --git a/README.rst b/README.rst
index e4fab7b..60d3cb8 100644
--- a/README.rst
+++ b/README.rst
@@ -54,6 +54,21 @@
         meta:
           dir: '/opt/influxdb/meta'
 
+InfluxDB server with customized parameters for the data service:
+
+.. code-block:: yaml
+
+    influxdb:
+      server:
+        enabled: true
+        data:
+          max_series_per_database: 20000000
+          cache_max_memory_size: 524288000
+          cache_snapshot_memory_size: 26214400
+          cache_snapshot_write_cold_duration: "5m"
+          compact_full_write_cold_duration: "2h"2h"
+          max_values_per_tag: 5000
+
 Single-node influxdb with an admin user:
 
 .. code-block:: yaml
diff --git a/influxdb/files/influxdb.conf b/influxdb/files/influxdb.conf
index 26477fe..ecddad0 100644
--- a/influxdb/files/influxdb.conf
+++ b/influxdb/files/influxdb.conf
@@ -56,46 +56,16 @@
 [data]
   # Controls if this node holds time series data shards in the cluster
   enabled = true
-
   dir = "{{ server.data.dir }}"
-
-  # These are the WAL settings for the storage engine >= 0.9.3
   wal-dir = "{{ server.data.wal_dir }}"
-  wal-logging-enabled = true
-  data-logging-enabled = true
-
-  # Whether queries should be logged before execution. Very useful for troubleshooting, but will
-  # log any sensitive data contained within a query.
+  trace-logging-enabled = {{ server.data.trace_logging_enabled|default('false')|lower }}
   query-log-enabled = {{ server.data.query_log_enabled | lower }}
-
-  # Settings for the TSM engine
-
-  # CacheMaxMemorySize is the maximum size a shard's cache can
-  # reach before it starts rejecting writes.
-  # cache-max-memory-size = 524288000
-
-  # CacheSnapshotMemorySize is the size at which the engine will
-  # snapshot the cache and write it to a TSM file, freeing up memory
-  # cache-snapshot-memory-size = 26214400
-
-  # CacheSnapshotWriteColdDuration is the length of time at
-  # which the engine will snapshot the cache and write it to
-  # a new TSM file if the shard hasn't received writes or deletes
-  # cache-snapshot-write-cold-duration = "1h"
-
-  # MinCompactionFileCount is the minimum number of TSM files
-  # that need to exist before a compaction cycle will run
-  # compact-min-file-count = 3
-
-  # CompactFullWriteColdDuration is the duration at which the engine
-  # will compact all TSM files in a shard if it hasn't received a
-  # write or delete
-  # compact-full-write-cold-duration = "24h"
-
-  # MaxPointsPerBlock is the maximum number of points in an encoded
-  # block in a TSM file. Larger numbers may yield better compression
-  # but could incur a performance penalty when querying
-  # max-points-per-block = 1000
+  max-series-per-database = {{ server.data.max_series_per_database|default(1000000) }}
+  cache-max-memory-size = {{ server.data.cache_max_memory_size|default(1048576000) }}
+  cache-snapshot-memory-size = {{ server.data.cache_snapshot_memory_size|default(26214400) }}
+  cache-snapshot-write-cold-duration = "{{ server.data.cache_snapshot_write_cold_duration|default('10m') }}"
+  compact-full-write-cold-duration = "{{ server.data.compact_full_write_cold_duration|default('4h') }}"
+  max-values-per-tag = {{ server.data.max_values_per_tag|default(100000) }}
 {%- else %}
 [data]
   enabled = false
@@ -124,7 +94,7 @@
 
 [retention]
   enabled = true
-  check-interval = "30m"
+  check-interval = "{{ server.get('retention', {}).check_interval|default('30m') }}"
 
 ###
 ### [shard-precreation]
@@ -136,8 +106,8 @@
 
 [shard-precreation]
   enabled = true
-  check-interval = "10m"
-  advance-period = "30m"
+  check-interval = "{{ server.get('shard_precreation', {}).check_interval|default('10m') }}"
+  advance-period = "{{ server.get('shard_precreation', {}).advance_period|default('30m') }}"
 
 ###
 ### Controls the system self-monitoring, statistics and diagnostics.