Report Elixir errors to Google Error Reporting.
If available in Hex, the package can be installed
by adding gcp_error_reporting
to your list of dependencies in mix.exs
:
def deps do
[
{:gcp_error_reporting, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/gcp_error_reporting.
GcpErrorReporting
uses goth
to authenticate with Google.
Follow its installation instructions to configure it, and define an app-specific Goth module to use with GcpErrorReporting
.
Example:
version = System.fetch_env!("CI_COMMIT")
%GcpErrorReporting.Reporter{
goth: MyApp.Goth,
project_id: "gcp_project_name",
service: "app_name",
service_version: version,
sources: [
[repository: "https://www.github.com/org/project", revision: version]
]
}
TBD. something like:
# in app outer loop:
begin do
app_outer_loop
rescue e
GcpErrorReporting.report_error(e, __STACKTRACE__, app_reporter)
end