Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements to Alert feature #4132

Open
ranbena opened this issue Sep 10, 2019 · 1 comment

Comments

@ranbena
Copy link
Member

commented Sep 10, 2019

Following #4081 the following feature should be implemented:

  • Disable/Enable alert
    Allow toggling an alert on/off if it gets temporarily irrelevant or noisy.

  • Top value / Any value
    Allow alert condition evaluation, not only on the query result top row, but also on each result row
    Any row Top row

  • Additional condition comparison options

Screen Shot 2019-09-10 at 21 44 30

  • Trigger on save
    Whenever criteria changes are saved:
  1. Show loading indicator on "Save" button.
  2. Trigger a backend alert evaluation (which can result in sending alert notifications).
  3. Stop loading indicator on fresh data.

@support support bot closed this Sep 10, 2019

@ranbena ranbena added Backend and removed Support Question labels Sep 10, 2019

@support support bot reopened this Sep 10, 2019

@ranbena ranbena added the Frontend label Sep 10, 2019

@getredash getredash deleted a comment from support bot Sep 10, 2019

@kravets-levko

This comment has been minimized.

Copy link
Collaborator

commented Sep 10, 2019

Adding more comparison options probably is the easiest one:

def evaluate(self):
data = json_loads(self.query_rel.latest_query_data.data)
if data['rows'] and self.options['column'] in data['rows'][0]:
value = data['rows'][0][self.options['column']]
op = self.options['op']
if op == 'greater than' and value > self.options['value']:
new_state = self.TRIGGERED_STATE
elif op == 'less than' and value < self.options['value']:
new_state = self.TRIGGERED_STATE
elif op == 'equals' and value == self.options['value']:
new_state = self.TRIGGERED_STATE
else:
new_state = self.OK_STATE
else:
new_state = self.UNKNOWN_STATE
return new_state

kravets-levko added a commit that referenced this issue Sep 11, 2019
kravets-levko added a commit that referenced this issue Sep 11, 2019
arikfr added a commit that referenced this issue Sep 11, 2019
Alerts: Add more condition comparison options (#4134)
* #4132 Add more condition comparison options

* Add arguments to fallback lambda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.