Enable alert_query transmission to the backend
- Added `alert_query` to be sent in the create / update request to the backend - Added alert_query to prometheus_alerts table - allow nulls - alerts can be added and updated - added both (!ID) for specifying custom metrics to be alerted on - PrometheusAlert expands (!ID) to the appropriate prometheus query ... added tests for that - AlertParams converts (legend) into (!ID) so that the abbreviated query and full query can be distinquished and sent to the correct place - abbreviated_query has replaces the (!ID) with the legend instead of the query
Showing
- app/models/prometheus_metric.rb 10 additions, 0 deletionsapp/models/prometheus_metric.rb
- db/migrate/20191028133906_add_alert_query_to_prometheus_alert.rb 11 additions, 0 deletions...ate/20191028133906_add_alert_query_to_prometheus_alert.rb
- db/schema.rb 1 addition, 0 deletionsdb/schema.rb
- ee/app/controllers/projects/prometheus/alerts_controller.rb 1 addition, 1 deletionee/app/controllers/projects/prometheus/alerts_controller.rb
- ee/app/models/prometheus_alert.rb 50 additions, 3 deletionsee/app/models/prometheus_alert.rb
- ee/app/serializers/prometheus_alert_entity.rb 1 addition, 0 deletionsee/app/serializers/prometheus_alert_entity.rb
- ee/app/services/projects/prometheus/alerts/alert_params.rb 64 additions, 1 deletionee/app/services/projects/prometheus/alerts/alert_params.rb
- ee/spec/models/prometheus_alert_spec.rb 41 additions, 0 deletionsee/spec/models/prometheus_alert_spec.rb
- ee/spec/services/projects/prometheus/alerts/alert_params_spec.rb 112 additions, 0 deletions.../services/projects/prometheus/alerts/alert_params_spec.rb
Please register or sign in to comment