Module: InfluxReporter
- Defined in:
- lib/influx_reporter.rb,
lib/influx_reporter/util.rb,
lib/influx_reporter/error.rb,
lib/influx_reporter/trace.rb,
lib/influx_reporter/client.rb,
lib/influx_reporter/filter.rb,
lib/influx_reporter/worker.rb,
lib/influx_reporter/logging.rb,
lib/influx_reporter/version.rb,
lib/influx_reporter/injections.rb,
lib/influx_reporter/line_cache.rb,
lib/influx_reporter/middleware.rb,
lib/influx_reporter/subscriber.rb,
lib/influx_reporter/normalizers.rb,
lib/influx_reporter/transaction.rb,
lib/influx_reporter/configuration.rb,
lib/influx_reporter/data_builders.rb,
lib/influx_reporter/error_message.rb,
lib/influx_reporter/event_message.rb,
lib/influx_reporter/trace_helpers.rb,
lib/influx_reporter/sql_summarizer.rb,
lib/influx_reporter/util/inspector.rb,
lib/influx_reporter/util/timestamp.rb,
lib/influx_reporter/injections/json.rb,
lib/influx_reporter/influx_db_client.rb,
lib/influx_reporter/injections/redis.rb,
lib/influx_reporter/util/constantize.rb,
lib/influx_reporter/injections/sequel.rb,
lib/influx_reporter/error_message/http.rb,
lib/influx_reporter/error_message/user.rb,
lib/influx_reporter/injections/sinatra.rb,
lib/influx_reporter/data_builders/error.rb,
lib/influx_reporter/data_builders/event.rb,
lib/influx_reporter/injections/net_http.rb,
lib/influx_reporter/error_message/exception.rb,
lib/influx_reporter/normalizers/action_view.rb,
lib/influx_reporter/error_message/stacktrace.rb,
lib/influx_reporter/normalizers/active_record.rb,
lib/influx_reporter/data_builders/transactions.rb,
lib/influx_reporter/normalizers/action_controller.rb
Defined Under Namespace
Modules: TraceHelpers Classes: BodyProxy, Configuration, ErrorMessage, EventMessage, Middleware, Trace, Transaction
Constant Summary collapse
- VERSION =
'1.2.2'
Class Method Summary collapse
-
.capture(&block) ⇒ Object
Captures any exceptions raised inside the block.
- .flush_transactions ⇒ Object
- .flush_transactions_if_needed ⇒ Object
-
.report(exception, opts = {}) ⇒ Net::HTTPResponse
Send an exception to InfluxReporter.
-
.report_event(message, opts = {}) ⇒ Net::HTTPResponse
Send an event to InfluxReporter.
-
.report_message(message, opts = {}) ⇒ Net::HTTPResponse
Send an exception to InfluxReporter.
-
.set_context(context) ⇒ Object
Sets context for future errors.
-
.start!(conf) ⇒ Object
Start the InfluxReporter client.
- .started? ⇒ Boolean
-
.stop! ⇒ Object
Stop the InfluxReporter client.
-
.trace(signature, kind = nil, extra = nil) {|Trace| ... } ⇒ Trace
Starts a new trace under the current Transaction.
-
.transaction(endpoint, kind = nil, result = nil) {|InfluxReporter::Transaction| ... } ⇒ InfluxReporter::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
137 138 139 140 141 142 143 144 |
# File 'lib/influx_reporter.rb', line 137 def self.capture(&block) unless client return yield if block_given? return nil end client.capture(&block) end |
.flush_transactions ⇒ Object
74 75 76 |
# File 'lib/influx_reporter.rb', line 74 def self.flush_transactions client&.flush_transactions end |
.flush_transactions_if_needed ⇒ Object
78 79 80 |
# File 'lib/influx_reporter.rb', line 78 def self.flush_transactions_if_needed client&.flush_transactions_if_needed end |
.report(exception, opts = {}) ⇒ Net::HTTPResponse
Send an exception to InfluxReporter
108 109 110 111 112 113 114 115 |
# File 'lib/influx_reporter.rb', line 108 def self.report(exception, opts = {}) unless client return yield if block_given? return nil end client.report exception, opts end |
.report_event(message, opts = {}) ⇒ Net::HTTPResponse
Send an event to InfluxReporter
131 132 133 |
# File 'lib/influx_reporter.rb', line 131 def self.report_event(, opts = {}) client&.report_event , opts end |
.report_message(message, opts = {}) ⇒ Net::HTTPResponse
Send an exception to InfluxReporter
122 123 124 |
# File 'lib/influx_reporter.rb', line 122 def self.(, opts = {}) client&. , opts end |
.set_context(context) ⇒ Object
Sets context for future errors
85 86 87 |
# File 'lib/influx_reporter.rb', line 85 def self.set_context(context) client&.set_context context end |
.start!(conf) ⇒ Object
Start the InfluxReporter client
29 30 31 |
# File 'lib/influx_reporter.rb', line 29 def self.start!(conf) Client.start! conf end |
.started? ⇒ Boolean
38 39 40 |
# File 'lib/influx_reporter.rb', line 38 def self.started? !!Client.inst end |
.stop! ⇒ Object
Stop the InfluxReporter client
34 35 36 |
# File 'lib/influx_reporter.rb', line 34 def self.stop! Client.stop! end |
.trace(signature, kind = nil, extra = nil) {|Trace| ... } ⇒ Trace
Starts a new trace under the current Transaction
65 66 67 68 69 70 71 72 |
# File 'lib/influx_reporter.rb', line 65 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) {|InfluxReporter::Transaction| ... } ⇒ InfluxReporter::Transaction
Start a new transaction or return the currently running
49 50 51 52 53 54 55 56 |
# File 'lib/influx_reporter.rb', line 49 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/influx_reporter.rb', line 93 def self.with_context(context, &block) unless client return yield if block_given? return nil end client.with_context context, &block end |