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

fix(core): small changes to diagnostics #11563

Merged
merged 4 commits into from
Mar 9, 2022
Merged

fix(core): small changes to diagnostics #11563

merged 4 commits into from
Mar 9, 2022

Conversation

allardy
Copy link
Member

@allardy allardy commented Feb 25, 2022

  1. Sometime the list of redis clients is not displayed, maybe there's a problem with the parsing. This change will still return the raw list so we can see what is the issue
  2. Added a try/catch block around the database tables logic just in case
  3. List the number of messaging nodes listening on redis (useful to debug rogue processes)
  4. Checks the connection between bp and the other processes (studio/messaging/nlu).

If no endpoint is specified, it will try to connect on different hosts:

  • localhost
  • 127.0.0.1
  • the server's hostname
  • external address configured

This could help determine connection issues in various settings (eg: restrictions on a specific hostname, etc).

image

@franklevasseur @samuelmasse @laurentlp Can you check if the logic I use there is correct, and do you think something else can be added to check the overall health of everything?

@samuelmasse
Copy link
Contributor

samuelmasse commented Mar 1, 2022

List the number of messaging nodes listening on redis (useful to debug rogue processes)

Doesn't messaging already do this with Registered foreign node x?

@allardy
Copy link
Member Author

allardy commented Mar 1, 2022

@samuelmasse The diagnostic report takes data from various places to give a clear picture of the client's situation. It's a summary of its installation. And since we don't have messaging logs steamed to the admin, in the log file or in the db, it's necessary to consolidate the information there because we don't often have access to the infra guy who can check the stdout

Copy link
Contributor

@samuelmasse samuelmasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 205 to 207
this.logger.info(`NLU server manually handled at: ${endpoint}`)
process.NLU_ENDPOINT = endpoint
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be added here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be effective the diag must avoid using any of botpress' internals and reflect the true state of the app. The nlu endpoint can come from the module config, or from 2 env variables, so there's no way to be 100% sure of what the effective value is (and I cant use the ghost to read the config in the db)

@samuelmasse
Copy link
Contributor

@allardy can we merge this?

@allardy allardy merged commit a34619a into master Mar 9, 2022
@samuelmasse samuelmasse deleted the ya-diag branch March 16, 2022 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants