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

Frontend instrumentation #790

Merged
merged 7 commits into from
Sep 20, 2024
Merged

Frontend instrumentation #790

merged 7 commits into from
Sep 20, 2024

Conversation

gtk-grafana
Copy link
Contributor

@gtk-grafana gtk-grafana commented Sep 19, 2024

We noticed our console.errors weren't magically making it into Faro when debugging #788, probably because we weren't sending them 🤦!

This PR attempts to add a runtime safe logging service to replace all console calls that will send frontend telemetry to Faro.

This was done quickly, but we should be asking "is the context in the log enough to adequately debug the problem?" for each log

@gtk-grafana gtk-grafana marked this pull request as ready for review September 19, 2024 18:15
@gtk-grafana gtk-grafana requested a review from a team as a code owner September 19, 2024 18:15
logError(new Error('unknown error'), context);
}
} catch (e) {
console.error('Failed to log faro error!', { err, context });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be overkill, but I didn't want any runtime errors coming from failing to log something

Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

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

LGTM, I just added the plugin id as "default" ctx.

@svennergr svennergr merged commit 8d91054 into main Sep 20, 2024
3 of 4 checks passed
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.

2 participants