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

refactor(Tracking): Better error logging for Scenes variables #290

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

grafakus
Copy link
Contributor

@grafakus grafakus commented Nov 20, 2024

✨ Description

Related issue(s): -

When a Scene variable encounters an error, the Scenes library only sets the error message in the variable state. This PR ensures we log an error with Faro, and not only the message.

Additionally, there's a of behaviour for the "Labels" view: we prevent the labels data source to fail when fetching label values fail.

📖 Summary of the changes

The logger calls are moved to the data sources instead of the React components. See diff tab for specific comments.

🧪 How to test?

-

@grafakus grafakus requested a review from ifrost November 20, 2024 17:59
@grafakus grafakus self-assigned this Nov 20, 2024
Copy link
Contributor

github-actions bot commented Nov 20, 2024

Unit test coverage

Lines Statements Branches Functions
Coverage: 13%
13.59% (543/3994) 10.3% (147/1426) 9.88% (125/1265)

logger.error(error as Error, {
info: 'Error while loading Pyroscope label values!',
variableName: variableName || '',
});
Copy link
Contributor Author

@grafakus grafakus Nov 20, 2024

Choose a reason for hiding this comment

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

Here we don't rethrow, we degrade gracefully so the UI can render something (hopefully) useful for the user.

Once @bryanhuhta can continue on grafana/pyroscope#3563, we can remove all this logic.

@grafakus grafakus merged commit ef1fcc5 into main Nov 21, 2024
4 of 5 checks passed
@grafakus grafakus deleted the refactor/various-improvements branch November 21, 2024 15:15
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.

1 participant