NAME
Sentry::Integration::CGIApplication - Requests of every CGI::Application
SYNOPSIS
# Once per process, e.g. in a mod_perl startup file: every
# CGI::Application subclass is instrumented, no code changes needed
Sentry::SDK->init({ dsn => '...', traces_sample_rate => 0.1 });
DESCRIPTION
A default integration. As soon as CGI::Application is loaded, every application of the process, whether it loads CGI::Application::Plugin::Sentry or not, gets a transaction per request and its exceptions captured, as described in CGI::Application::Plugin::Sentry. Exceptions in cgiapp_init and setup, i.e. while the application object is created, are captured as well.
Without the plugin, the SDK must be initialized before the first request, e.g. at the start of the script or in the startup file of a persistent server. With it, the plugin initializes the SDK from the application's sentry_options, and the applications are instrumented even when this integration is not among the client's integrations.
Run as PSGI application (psgi_app, run_as_psgi) by a server that serves many requests per process, its requests are those of a server: events are sent by a sender process, or in the server's cleanup phase (see "Sending" in CGI::Application::Plugin::Sentry).
Inside a request of another integration (e.g. Sentry::Integration::ModPerl or Plack::Middleware::SentrySDK) the application adopts that request: its transaction is renamed after the class and run mode and no second one is started.
METHODS
instrument_for_plugin
Internal, for CGI::Application::Plugin::Sentry.