Conch API

Logo

Datacenter build and management service

View the Project on GitHub joyent/conch-api

Conch::Plugin::Rollbar

SOURCE

https://github.com/joyent/conch-api/blob/master/lib/Conch/Plugin/Rollbar.pm

DESCRIPTION

Mojo plugin to send messages and exceptions to Rollbar.

Also support sending various errors to Rollbar, depending on matching criteria.

METHODS

register

Sets up the hooks.

HOOKS

before_render

Sends exceptions to Rollbar.

LISTENERS

Send fatal log message

Sends fatal log messages to Rollbar.

EVENTS

dispatch_message_payload

Listens to the dispatch_message_payload event (which is sent by the dispatch logger in Conch::Plugin::Logging). When an error response is generated (any 4xx response code other than 401 or 404), and a request header matches a key in the rollbar config error_match_header, and the header value matches the corresponding regular expression, a message is sent to Rollbar.

HELPERS

These methods are made available on the $c object (the invocant of all controller methods, and therefore other helpers).

send_exception_to_rollbar

Asynchronously send exception details to Rollbar (if the rollbar access_token is configured). Returns a unique uuid suitable for logging, to correlate with the Rollbar entry thus created.

send_message_to_rollbar

Asynchronously send a message to Rollbar (if the rollbar access_token is configured). Returns a unique uuid suitable for logging, to correlate with the Rollbar entry thus created.

Requires a message string. A hashref of additional data is optional. A string or data structure of fingerprint data for grouping occurrences is optional.

LICENSING

Copyright Joyent, Inc.

This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.