Module: Opbeat
- Defined in:
- lib/opbeat.rb,
lib/opbeat/util.rb,
lib/opbeat/error.rb,
lib/opbeat/trace.rb,
lib/opbeat/client.rb,
lib/opbeat/filter.rb,
lib/opbeat/worker.rb,
lib/opbeat/logging.rb,
lib/opbeat/version.rb,
lib/opbeat/injections.rb,
lib/opbeat/line_cache.rb,
lib/opbeat/middleware.rb,
lib/opbeat/subscriber.rb,
lib/opbeat/http_client.rb,
lib/opbeat/normalizers.rb,
lib/opbeat/transaction.rb,
lib/opbeat/configuration.rb,
lib/opbeat/data_builders.rb,
lib/opbeat/error_message.rb,
lib/opbeat/trace_helpers.rb,
lib/opbeat/sql_summarizer.rb,
lib/opbeat/util/inspector.rb,
lib/opbeat/injections/json.rb,
lib/opbeat/injections/redis.rb,
lib/opbeat/util/constantize.rb,
lib/opbeat/injections/sequel.rb,
lib/opbeat/error_message/http.rb,
lib/opbeat/error_message/user.rb,
lib/opbeat/injections/sinatra.rb,
lib/opbeat/data_builders/error.rb,
lib/opbeat/injections/net_http.rb,
lib/opbeat/error_message/exception.rb,
lib/opbeat/normalizers/action_view.rb,
lib/opbeat/error_message/stacktrace.rb,
lib/opbeat/normalizers/active_record.rb,
lib/opbeat/data_builders/transactions.rb,
lib/opbeat/normalizers/action_controller.rb
Defined Under Namespace
Modules: TraceHelpers Classes: BodyProxy, Configuration, ErrorMessage, Middleware, Trace, Transaction
Constant Summary collapse
- VERSION =
"3.0.10"
Class Method Summary collapse
-
.capture(&block) ⇒ Object
Captures any exceptions raised inside the block.
- .flush_transactions ⇒ Object
-
.release(rel, opts = {}) ⇒ Net::HTTPResponse
Notify Opbeat of a release.
-
.report(exception, opts = {}) ⇒ Net::HTTPResponse
Send an exception to Opbeat.
-
.report_message(message, opts = {}) ⇒ Net::HTTPResponse
Send an exception to Opbeat.
-
.set_context(context) ⇒ Object
Sets context for future errors.
-
.start!(conf) ⇒ Object
Start the Opbeat client.
- .started? ⇒ Boolean
-
.stop! ⇒ Object
Stop the Opbeat client.
-
.trace(signature, kind = nil, extra = nil) {|Trace| ... } ⇒ Trace
Starts a new trace under the current Transaction.
-
.transaction(endpoint, kind = nil, result = nil) {|Transaction| ... } ⇒ Transaction
Start a new transaction or return the currently running.
-
.with_context(context) {|Trace| ... } ⇒ Object
Updates context for errors within the block.
Class Method Details
.capture(&block) ⇒ Object
Captures any exceptions raised inside the block
133 134 135 136 137 138 139 140 |
# File 'lib/opbeat.rb', line 133 def self.capture &block unless client return yield if block_given? return nil end client.capture(&block) end |
.flush_transactions ⇒ Object
72 73 74 75 76 77 78 79 |
# File 'lib/opbeat.rb', line 72 def self.flush_transactions unless client return yield if block_given? return nil end client.flush_transactions end |
.release(rel, opts = {}) ⇒ Net::HTTPResponse
Notify Opbeat of a release
148 149 150 151 152 153 154 155 |
# File 'lib/opbeat.rb', line 148 def self.release rel, opts = {} unless client return yield if block_given? return nil end client.release rel, opts end |
.report(exception, opts = {}) ⇒ Net::HTTPResponse
Send an exception to Opbeat
108 109 110 111 112 113 114 115 |
# File 'lib/opbeat.rb', line 108 def self.report exception, opts = {} unless client return yield if block_given? return nil end client.report exception, opts end |
.report_message(message, opts = {}) ⇒ Net::HTTPResponse
Send an exception to Opbeat
122 123 124 125 126 127 128 129 |
# File 'lib/opbeat.rb', line 122 def self. , opts = {} unless client return yield if block_given? return nil end client. , opts end |
.set_context(context) ⇒ Object
Sets context for future errors
84 85 86 87 |
# File 'lib/opbeat.rb', line 84 def self.set_context context return nil unless client client.set_context context end |
.start!(conf) ⇒ Object
Start the Opbeat client
27 28 29 |
# File 'lib/opbeat.rb', line 27 def self.start! conf Client.start! conf end |
.started? ⇒ Boolean
36 37 38 |
# File 'lib/opbeat.rb', line 36 def self.started? !!Client.inst end |
.stop! ⇒ Object
Stop the Opbeat client
32 33 34 |
# File 'lib/opbeat.rb', line 32 def self.stop! Client.stop! end |
.trace(signature, kind = nil, extra = nil) {|Trace| ... } ⇒ Trace
Starts a new trace under the current Transaction
63 64 65 66 67 68 69 70 |
# File 'lib/opbeat.rb', line 63 def self.trace signature, kind = nil, extra = nil, &block unless client return yield if block_given? return nil end client.trace signature, kind, extra, &block end |
.transaction(endpoint, kind = nil, result = nil) {|Transaction| ... } ⇒ Transaction
Start a new transaction or return the currently running
47 48 49 50 51 52 53 54 |
# File 'lib/opbeat.rb', line 47 def self.transaction endpoint, kind = nil, result = nil, &block unless client return yield if block_given? return nil end client.transaction endpoint, kind, result, &block end |
.with_context(context) {|Trace| ... } ⇒ Object
Updates context for errors within the block
93 94 95 96 97 98 99 100 |
# File 'lib/opbeat.rb', line 93 def self.with_context context, &block unless client return yield if block_given? return nil end client.context context, &block end |