| {%- if pillar.influxdb.server is defined %} |
| {%- from "influxdb/map.jinja" import server, monitoring with context %} |
| |
| {%- if server.get('enabled', False) %} |
| server: |
| alert: |
| {%- if server.get('http', {}).get('enabled', False) %} |
| InfluxdbQDown: |
| if: >- |
| influxdb_up != 1 |
| labels: |
| severity: warning |
| service: influxdb |
| annotations: |
| summary: 'InfluxDB service down' |
| {% raw %} |
| description: 'InfluxDB service is down on node {{ $labels.host }}' |
| {% endraw %} |
| InfluxdbHTTPClientError: |
| {%- set influx_http_client_error_threshold = monitoring.http_errors_percentage %} |
| 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 = monitoring.failed_points_percentage %} |
| 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 = monitoring.dropped_points_percentage %} |
| 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 %} |