buerokratt / Buerokratt-Chatbot

1 stars 14 forks source link

End User is notified when Bürokratt is not working #43

Open rasmusei opened 1 year ago

rasmusei commented 1 year ago

AS AN End User I WANT TO have a clear understanding if Bürokratt is not working SO THAT I could make contact using other channels

Acceptance Criteria

Business requirements

GUI

Endpoints

Service /healthz/chat

turnerrainer commented 1 year ago

Before there is an active chat session established

After there is an active chat session established

ceirowe commented 1 year ago

@rasmusei a few questions regarding GUI:

  1. Should health checking happen on each initialization or only after an error occured / not OK status code recieved?
  2. Should health checking stop pinging, if the status is OK 200 and restart after an error occurs?
rasmusei commented 1 year ago

@ceirowe

  1. Health check should happen all the time in every 30 sec
  2. In active chat health check should happen in every 10 sec
  3. When Bürokratt stopped working during active chat then in chat message "Bürokratt ei ole hetkel tehnilistel põhjustel saadaval" is displayed same way as an emergency message.
  4. When Bürokratt starts working again in active chat then in chat message "Bürokratt on jälle saadaval!" is displayed same way as an emergency message, previous message ("Bürokratt ei ole hetkel tehnilistel põhjustel saadaval") is not displayed anymore. When Bürokratt has detected activity (mouse movement, keystroke) by End User, then message "Bürokratt on jälle saadaval!" will disappear is 5 sec.
joonasroosalung commented 1 year ago

@turnerrainer Uses existing /healthz endpoint on ruuter?

turnerrainer commented 1 year ago

@turnerrainer Uses existing /healthz endpoint on ruuter?

No, this one needs a lot more attention. Maybe needs an additional grooming?

Just pinging definitely Ruuter won't do.

joonasroosalung commented 1 year ago

Rasa bot should have a /health or /healthcheck endpoint, will double check today/tomorrow

ceirowe commented 1 year ago

@turnerrainer GUI needs a way to test changes against working Ruuter.

joonasroosalung commented 1 year ago

Ruuter components already covered with existing v1 conf:

The existing conf https://github.com/buerokratt/Buerokratt-Chatbot/blob/main/DSL.Ruuter-v1.private/cs-get-components-healthz-status.json, which internally uses https://github.com/buerokratt/Buerokratt-Chatbot/blob/main/DSL.Ruuter-v1.private/cs-get-resql-healthz.json to check resql through an extra step. Don't remember the precise technical reason for that, likely due to http status response codes, Ruuter wants to return 200 almost always.

The existing endpoint responds with

{"data":{"set_healthz_response":{"data":[{"name":"TIM","version":"1.0"},{"name":"RUUTER","version":"1.0"},{"name":"DMAPPER","version":"1.0"},{"name":"RESQL","version":"1.0"}]}},"error":null}

Version will be an empty string "" if any component is down and of course ther will be no response from the endpoint if ruuter itself is down.

turnerrainer commented 1 year ago

@turnerrainer Uses existing /healthz endpoint on ruuter?

No, this one needs a lot more attention. Maybe needs an additional grooming?

Just pinging definitely Ruuter won't do.

@joonasroosalung I'll take it back - the current /healthz endpoint is sufficient in case it's also available for public Ruuter as well.

sergeirudz commented 1 year ago

PR: https://github.com/buerokratt/Chat-Widget/pull/20