Skip to content

RatioPBC/gcp_error_reporting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCP Error Reporting

Report Elixir errors to Google Error Reporting.

Installation

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.

Configure Goth

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.

Define a Reporter

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]
  ]
}

Catch errors and report them

TBD. something like:

# in app outer loop:
begin do
  app_outer_loop
rescue e
  GcpErrorReporting.report_error(e, __STACKTRACE__, app_reporter)
end

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages