--- /dev/null
+{%- if pillar.influxdb.server is defined %}
+{%- from "influxdb/map.jinja" import server with context %}
+
+{%- if server.get('enabled', False) %}
+server:
+ alert:
+ ProcstatRunningInfluxdb:
+ if: >-
+ procstat_running{process_name="influxdb"} == 0
+ {% raw %}
+ labels:
+ severity: warning
+ service: influxdb
+ annotations:
+ summary: 'Influxdb service is down'
+ description: 'Influxdb service is down on node {{ $labels.host }}'
+ {% endraw %}
+{%- if server.get('http', {}).get('enabled', False) %}
+ InfluxdbHTTPClientError:
+ {%- set influx_http_client_error_threshold = prometheus_server.get('alert', {}).get('InfluxdbHTTPClientError', {}).get('var', {}).get('threshold', 5) %}
+ if: >-
+ rate(influxdb_httpd_clientError[2m]) / rate(influxdb_httpd_req[2m]) * 100 > {{ influx_http_client_error_threshold }}
+ {% raw %}
+ labels:
+ severity: warning
+ service: influxdb
+ annotations:
+ summary: 'Influxdb number of client errors is high'
+ description: '{{ printf `%.1f` $value }}% of client requests are in error on {{ $labels.host }} (threshold={%- endraw %}{{ influx_http_client_error_threshold }}).'
+ InfluxdbHTTPPointsWrittenFail:
+ {%- set influx_http_points_written_fail_threshold = prometheus_server.get('alert', {}).get('InfluxdbHTTPPointsWrittenFail', {}).get('var', {}).get('threshold', 5) %}
+ if: >-
+ rate(influxdb_httpd_pointsWrittenFail[2m]) / rate(influxdb_httpd_pointsWrittenOK[2m]) * 100 > {{ influx_http_points_written_fail_threshold }}
+ {% raw %}
+ labels:
+ severity: warning
+ service: influxdb
+ annotations:
+ summary: 'Influxdb too many failed writes'
+ description: '{{ printf `%.1f` $value }}% of written points have failed on {{ $labels.host }} (threshold={%- endraw %}{{ influx_http_points_written_fail_threshold }}).'
+ InfluxdbHTTPPointsWrittenDropped:
+ {%- set influx_http_points_written_dropped_threshold = prometheus_server.get('alert', {}).get('InfluxdbHTTPPointsWrittenDropped', {}).get('var', {}).get('threshold', 5) %}
+ if: >-
+ rate(influxdb_httpd_pointsWrittenDropped[2m]) / rate(influxdb_httpd_pointsWrittenOK[2m]) * 100 > {{ influx_http_points_written_dropped_threshold }}
+ {% raw %}
+ labels:
+ severity: warning
+ service: influxdb
+ annotations:
+ summary: 'Influxdb too many dropped writes'
+ description: '{{ printf `%.1f` $value }}% of written points have been dropped on {{ $labels.host }} (threshold={%- endraw %}{{ influx_http_points_written_dropped_threshold }}).'
+{%- endif %}
+{%- endif %}
+{%- endif %}