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

Adding error box when target not loaded #7034

Closed
wants to merge 3 commits into from

Conversation

harsh-ps-2003
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Fixes #6876
Added an error box to be shown when the target is loading in Query component.

Verification

Screenshot 2024-01-04 at 11 05 27 PM

Tested in containerised development environment.

Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
@harsh-ps-2003
Copy link
Contributor Author

Hey @GiedriusS!
Can you check this PR please, I dont know how to delay the targets loading, so I tested in extreme scenarios, when targets are non loaded, then the error came and when the targets are loaded, the error was not coming. But I was not able to check when the target is facing delay in loading so it first shows error message and then when the target gets loaded, the error goes away. If the PR logic is fine, I will fix the checks and add changelogs!

@GiedriusS
Copy link
Member

Thanks for this work! I double-checked and it seems like the root problem is that https://github.com/thanos-io/thanos/blob/main/pkg/ui/react-app/src/pages/targets/ScrapePoolList.tsx#L115C42-L115C50 here in case there are any warnings then we don't show them. Prometheus API has no such field "warnings" in the returned response so the component doesn't show that? Here https://github.com/thanos-io/thanos/blob/main/pkg/ui/react-app/src/pages/targets/ScrapePoolList.tsx#L116 we need to capture the warning and then show it in the ScrapePoolListProps.

@harsh-ps-2003
Copy link
Contributor Author

harsh-ps-2003 commented Jan 5, 2024

Thanks for this work! I double-checked and it seems like the root problem is that https://github.com/thanos-io/thanos/blob/main/pkg/ui/react-app/src/pages/targets/ScrapePoolList.tsx#L115C42-L115C50 here in case there are any warnings then we don't show them. Prometheus API has no such field "warnings" in the returned response so the component doesn't show that? Here https://github.com/thanos-io/thanos/blob/main/pkg/ui/react-app/src/pages/targets/ScrapePoolList.tsx#L116 we need to capture the warning and then show it in the ScrapePoolListProps.

So the we need to somehow get hold of the warnings from the response, and present it in the UI in form of error boxes. Okay! I am closing this PR as the changes I did are different. If I am able to solve it, I will open another one! Thanks

@harsh-ps-2003
Copy link
Contributor Author

harsh-ps-2003 commented Jan 9, 2024

Thanks for this work! I double-checked and it seems like the root problem is that https://github.com/thanos-io/thanos/blob/main/pkg/ui/react-app/src/pages/targets/ScrapePoolList.tsx#L115C42-L115C50 here in case there are any warnings then we don't show them. Prometheus API has no such field "warnings" in the returned response so the component doesn't show that? Here https://github.com/thanos-io/thanos/blob/main/pkg/ui/react-app/src/pages/targets/ScrapePoolList.tsx#L116 we need to capture the warning and then show it in the ScrapePoolListProps.

Actually I think there is a warnings field in the response of Prometheus API see. I am working on it!

@harsh-ps-2003 harsh-ps-2003 reopened this Jan 9, 2024
@harsh-ps-2003 harsh-ps-2003 deleted the errortargets branch January 9, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show error if targets page is not fully loaded
2 participants