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

Connections: Make the "Add new Connection" page work without internet access #75272

Merged
merged 3 commits into from Sep 27, 2023

Conversation

leventebalogh
Copy link
Contributor

@leventebalogh leventebalogh commented Sep 22, 2023

Related issue(s): #74267

What changed?

Made the "Add new Connection" page and the Plugins Catalog work in case Grafana has no access to the internet, or if the internet connection is slow.

The problem

Currently the plugin list used by the frontend is merged from two sources: locally installed plugins (can contain plugins not available in our catalog), and remote plugins (available in our catalog on GCOM).

As the remote plugins are fetched through the internet (hitting https://grafana.com), it can happen that it takes more time, or even that it times out after 30 seconds if the access is blocked. Currently this is causing some of our pages to hang for 30 seconds, even though the instances are only planned to work with locally installed plugins.

The solution

The changes in this PR are trying to solve this in the following way:

  1. Start fetching local and remote plugins
  2. In case they both respond in a reasonable amount of time, render the UI
  3. In case the remote API times out, continue rendering the UI with the local plugins only
  4. When the remote request completes, update the list of plugins with the remote ones

1. Add New Connection - Normal behaviour

New.Connection.-.normal.mp4

2. Add New Connection - Slow remote response

New.Connection.-.slow.remote.mov

3. Add New Connection - Failing remote response

New.Connection.-.remote.error.mov

Fixes #74267.

@leventebalogh leventebalogh self-assigned this Sep 22, 2023
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.2.x milestone Sep 22, 2023
@leventebalogh leventebalogh marked this pull request as ready for review September 22, 2023 11:19
@leventebalogh leventebalogh requested review from academo and removed request for a team September 22, 2023 11:19
@leventebalogh leventebalogh changed the title fix: make the "Add new Connection" page work without internet access Connections: Make the "Add new Connection" page work without internet access Sep 22, 2023
Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

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

Looks great! I added a suggestion (which I have not tested) that should work in the theory 🙈

Copy link
Contributor

@jackw jackw left a comment

Choose a reason for hiding this comment

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

LGTM! Awesome work @leventebalogh 🚀

@leventebalogh leventebalogh merged commit 163b0d1 into main Sep 27, 2023
15 checks passed
@leventebalogh leventebalogh deleted the leventebalogh/make-catalog-work-without-internet branch September 27, 2023 13:04
otilor pushed a commit to otilor/grafana that referenced this pull request Sep 28, 2023
… access (grafana#75272)

* fix: make the "Add new Connection" page work without internet access

* feat: update error message

* fix: update the API url in the error log
rwwiv pushed a commit that referenced this pull request Oct 2, 2023
… access (#75272)

* fix: make the "Add new Connection" page work without internet access

* feat: update error message

* fix: update the API url in the error log
mildwonkey pushed a commit that referenced this pull request Oct 4, 2023
… access (#75272)

* fix: make the "Add new Connection" page work without internet access

* feat: update error message

* fix: update the API url in the error log
@zerok zerok modified the milestones: 10.2.x, 10.2.0 Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Adding new connection on Grafana without access to internet hangs
5 participants