Module: Pgbus::Integrations::Appsignal::Probe
- Defined in:
- lib/pgbus/integrations/appsignal/probe.rb
Overview
Minutely probe that pushes pgbus-wide gauges into AppSignal.
All readings come from Pgbus::Web::DataSource so the probe doesn’t duplicate query logic. DataSource is built to be resilient — every method rescues StandardError and returns a safe default — but we still wrap each section in our own rescue so a probe iteration never raises out into the AppSignal probe runner.
Defined Under Namespace
Classes: Runner
Class Method Summary collapse
-
.install! ⇒ Object
rubocop:disable Naming/PredicateMethod.
- .installed? ⇒ Boolean
-
.new_probe_instance ⇒ Object
Visible for testing — returns a fresh runnable probe.
- .reset! ⇒ Object
Class Method Details
.install! ⇒ Object
rubocop:disable Naming/PredicateMethod
18 19 20 21 22 23 24 |
# File 'lib/pgbus/integrations/appsignal/probe.rb', line 18 def install! # rubocop:disable Naming/PredicateMethod return false if @installed ::Appsignal::Probes.register :pgbus, new_probe_instance @installed = true true end |
.installed? ⇒ Boolean
26 27 28 |
# File 'lib/pgbus/integrations/appsignal/probe.rb', line 26 def installed? @installed == true end |
.new_probe_instance ⇒ Object
Visible for testing — returns a fresh runnable probe.
37 38 39 |
# File 'lib/pgbus/integrations/appsignal/probe.rb', line 37 def new_probe_instance Runner.new end |
.reset! ⇒ Object
30 31 32 33 34 |
# File 'lib/pgbus/integrations/appsignal/probe.rb', line 30 def reset! ::Appsignal::Probes.unregister(:pgbus) if defined?(::Appsignal::Probes) && ::Appsignal::Probes.respond_to?(:unregister) @installed = false end |