Skip to content

Commit

Permalink
Merge pull request #503 from cfarquhar/TURTLES-785
Browse files Browse the repository at this point in the history
TURTLES-785: Add maas_rally metric/alarm for influxdb failures
  • Loading branch information
tonytan4ever authored May 1, 2018
2 parents 74e7036 + c1a5aae commit 101b2a7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 6 additions & 1 deletion playbooks/files/rax-maas/plugins/rally_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,12 @@ def main():
metric('maas_check_duration', 'double', "{:.2f}".format((end - start) * 1))

if args.influxdb:
send_metrics_to_influxdb(plugin_config, logger)
try:
send_metrics_to_influxdb(plugin_config, logger)
except:
metric('influxdb_success', 'uint32', 0)
else:
metric('influxdb_success', 'uint32', 1)

return

Expand Down
11 changes: 11 additions & 0 deletions playbooks/templates/rax-maas/rally_check.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ alarms :
if (metric["resource_cleanup"] > 0) {
return new AlarmStatus(CRITICAL, "{{ name }} performance test has required stale resource cleanup for {{ resource_cleanup_threshold }} or more intervals.");
}
{% if influxdb %}
rally_{{ name }}_influxdb :
label : rally_{{ name }}_influxdb--{{ inventory_hostname }}
notification_plan_id : "{{ maas_notification_plan_override[label] | default(maas_notification_plan) }}"
disabled : {{ (("rally_{{ name }}_influxdb--{{ inventory_hostname }}") | match(maas_excluded_alarms_regex)) | ternary('true', 'false') }}
criteria : |
:set consecutiveCount={{ alarm_consecutive_count }}
if (metric["influxdb_success"] != 1) {
return new AlarmStatus(CRITICAL, "{{ name }} performance test was unable to write to the configured influxdb endpoint for {{ alarm_consecutive_count }} or more intervals.");
}
{% endif %}
7 changes: 7 additions & 0 deletions releasenotes/notes/influxdb-error-check-3b4b7734f2f876d7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
features:
- If maas_rally is configured to write to an influxdb endpoint, a new metric
(influxdb_success) and alarm will be created to generate alerts if writing
to influxdb fails. A failure to write to influxdb is no longer fatal,
which allows performance metrics to still be reported via the MaaS API even
if the influxdb endpoint is unavailable.

0 comments on commit 101b2a7

Please sign in to comment.