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

Properly configure error logging on Google Cloud #2323

Open
anth-volk opened this issue Jan 24, 2025 · 0 comments
Open

Properly configure error logging on Google Cloud #2323

anth-volk opened this issue Jan 24, 2025 · 0 comments

Comments

@anth-volk
Copy link
Collaborator

At the moment, we use console.error to report errors, as we should, but we do not write to Google Cloud, meaning these errors only ever exist in the user's browser. We should use Google Cloud's reporting function in conjunction with console. error. The below is an example block from Claude, but we don't want to replace console.error, as it recommends, but instead supplement.

import { ErrorReporting } from '@google-cloud/error-reporting';

const errorReporting = new ErrorReporting({
  projectId: 'your-project-id',
  // other config options as needed
});

// Instead of console.error
try {
  // your code
} catch (error) {
  errorReporting.report(error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant