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

[API] Webhook to handle live alerting #21

Closed
Akilditu opened this issue Nov 24, 2020 · 5 comments
Closed

[API] Webhook to handle live alerting #21

Akilditu opened this issue Nov 24, 2020 · 5 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested topic: api Related to api type: enhancement New feature or request
Milestone

Comments

@Akilditu
Copy link
Collaborator

Akilditu commented Nov 24, 2020

Hi API team,

As a follow up to #19 and pyro-api/issues/61, the ideal way to handle live alerts would be a webhook on platform's side receiving requests from pyro-api.

I'm not sure it is 1.0, in between we could :

  1. Query alerts as mentioned in pyro-api/issues/61
  2. Trigger manually the alert for demo-purposes and then wait until the webhook is up and running

Here is an example of building a webhook with FastAPI. I guess this has to be a share task between platform and API, let's discuss what is our best option regarding time consumption and availabilities

cc @frgfm, @fe51, @jeanpasquier75, @florianriche

@Akilditu Akilditu added type: enhancement New feature or request help wanted Extra attention is needed question Further information is requested topic: api Related to api labels Nov 24, 2020
@florianriche
Copy link

In my view we have to do the first step (regular fetch on the API, if done every 5 seconds it keeps the "almost-real time" effect while being very light on the API load).
The webhook could end up being a bit cumbersome to implement. When I suggested it, I had in mind the webhooks used by slack or Zapier but if we do it one ourselves without relying on a 3rd party platform, that will be a bit harder to implement. Basically we will need to create a route reay to receive post requests in the WebApps.

@Akilditu
Copy link
Collaborator Author

Akilditu commented Nov 24, 2020

In my view we have to do the first step (regular fetch on the API, if done every 5 seconds it keeps the "almost-real time" effect while being very light on the API load).

Fetching every 5 seconds could be an answer yes but it requires a 24/7 on Heroku which I think is not doable based on the current plan we have (550 hours/months).
An idea would be to check if app is running before fetching

@florianriche
Copy link

oh I didn't know we had such limitations with Heroku.
Well, we are not going to deploy in real conditions anytime soon right? So for demo purposes I guess it should be enough?
When we will deploy we may have credits to use on Heroku.

@florianriche
Copy link

@Akilditu I just tested that it is possible to send external requests on the pyroplatform becaue Dash is based upon a Flaks server.
I guess we could create a route in the pyro-platform to receive a Post Request to signal an update has been done and that would be enough for our use case :)

@frgfm frgfm added this to the 0.1.2 milestone Dec 24, 2020
@Akilditu
Copy link
Collaborator Author

This issue can be closed because #38 references the remaining task on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested topic: api Related to api type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants