Module: Apmlens
- Defined in:
- lib/apmlens.rb,
lib/apmlens/client.rb,
lib/apmlens/railtie.rb,
lib/apmlens/version.rb,
lib/apmlens/configuration.rb,
lib/apmlens/query_tracking_middleware.rb
Overview
The Main Entry Point
This file is loaded when user does require 'apmlens'
Defined Under Namespace
Classes: Client, Configuration, QueryTrackingMiddleware, Railtie
Constant Summary collapse
- VERSION =
"1.0.2"
Class Method Summary collapse
-
.capture_error(exception, context = {}) ⇒ Object
Public API: Notify an error.
-
.capture_trace(name, value, tags = {}) ⇒ Object
Public API: Record a metric.
- .configuration ⇒ Apmlens::Configuration
-
.configure {|configuration| ... } ⇒ Object
Configure the gem in an initializer.
-
.start! ⇒ Object
Initialize the background worker.
Class Method Details
.capture_error(exception, context = {}) ⇒ Object
Public API: Notify an error
32 33 34 35 |
# File 'lib/apmlens.rb', line 32 def capture_error(exception, context = {}) return unless configuration.enabled? Client.instance.capture_error(exception, context) end |
.capture_trace(name, value, tags = {}) ⇒ Object
Public API: Record a metric
38 39 40 41 |
# File 'lib/apmlens.rb', line 38 def capture_trace(name, value, = {}) return unless configuration.enabled? Client.instance.capture_trace(name, value, ) end |
.configuration ⇒ Apmlens::Configuration
14 15 16 |
# File 'lib/apmlens.rb', line 14 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Configure the gem in an initializer
19 20 21 22 23 |
# File 'lib/apmlens.rb', line 19 def configure yield(configuration) configuration.enable! start! end |
.start! ⇒ Object
Initialize the background worker
26 27 28 29 |
# File 'lib/apmlens.rb', line 26 def start! return unless configuration.enabled? Client.instance.start! end |