Class: Bigcommerce::Prometheus::Instrumentors::Web
- Inherits:
-
Object
- Object
- Bigcommerce::Prometheus::Instrumentors::Web
- Includes:
- Loggable
- Defined in:
- lib/bigcommerce/prometheus/instrumentors/web.rb
Overview
Instrumentors for web process
Instance Method Summary collapse
-
#initialize(app:) ⇒ Web
constructor
A new instance of Web.
-
#start ⇒ Object
Start the web instrumentor.
Methods included from Loggable
Constructor Details
#initialize(app:) ⇒ Web
Returns a new instance of Web.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bigcommerce/prometheus/instrumentors/web.rb', line 27 def initialize(app:) @app = app @enabled = Bigcommerce::Prometheus.enabled @server_port = Bigcommerce::Prometheus.server_port @server_timeout = Bigcommerce::Prometheus.server_timeout @server_prefix = Bigcommerce::Prometheus.server_prefix @process_name = Bigcommerce::Prometheus.process_name @collectors = Bigcommerce::Prometheus.web_collectors || [] @type_collectors = Bigcommerce::Prometheus.web_type_collectors || [] end |
Instance Method Details
#start ⇒ Object
Start the web instrumentor
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/bigcommerce/prometheus/instrumentors/web.rb', line 41 def start unless @enabled logger.debug "[bigcommerce-prometheus][#{@process_name}] Prometheus disabled, skipping web start..." return end setup_before_fork setup_after_fork setup_middleware rescue StandardError => e logger.error "[bigcommerce-prometheus][#{@process_name}] Failed to start web instrumentation - #{e.} - #{e.backtrace[0..4].join("\n")}" end |