pgbus 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +115 -0
- data/Rakefile +56 -3
- data/app/controllers/pgbus/dead_letter_controller.rb +5 -1
- data/app/helpers/pgbus/application_helper.rb +12 -2
- data/app/views/pgbus/dashboard/_processes_table.html.erb +1 -1
- data/app/views/pgbus/dashboard/_recent_failures.html.erb +1 -1
- data/app/views/pgbus/dashboard/_stats_cards.html.erb +1 -0
- data/app/views/pgbus/dead_letter/_messages_table.html.erb +33 -1
- data/app/views/pgbus/insights/show.html.erb +1 -1
- data/app/views/pgbus/jobs/_failed_table.html.erb +1 -1
- data/app/views/pgbus/processes/_processes_table.html.erb +1 -1
- data/app/views/pgbus/queues/show.html.erb +3 -0
- data/config/locales/da.yml +8 -0
- data/config/locales/de.yml +8 -0
- data/config/locales/en.yml +8 -0
- data/config/locales/es.yml +8 -0
- data/config/locales/fi.yml +8 -0
- data/config/locales/fr.yml +8 -0
- data/config/locales/it.yml +8 -0
- data/config/locales/ja.yml +8 -0
- data/config/locales/nb.yml +8 -0
- data/config/locales/nl.yml +8 -0
- data/config/locales/pt.yml +8 -0
- data/config/locales/sv.yml +8 -0
- data/lib/pgbus/cli.rb +16 -0
- data/lib/pgbus/client.rb +34 -7
- data/lib/pgbus/configuration.rb +17 -1
- data/lib/pgbus/integrations/appsignal/dashboard.json +353 -0
- data/lib/pgbus/integrations/appsignal/dashboards/pgbus_health.json +224 -85
- data/lib/pgbus/integrations/appsignal/dashboards/pgbus_streams.json +154 -63
- data/lib/pgbus/integrations/appsignal/dashboards/pgbus_throughput.json +218 -79
- data/lib/pgbus/integrations/appsignal/probe.rb +17 -2
- data/lib/pgbus/integrations/appsignal.rb +17 -0
- data/lib/pgbus/mcp/base_tool.rb +79 -0
- data/lib/pgbus/mcp/health_analyzer.rb +159 -0
- data/lib/pgbus/mcp/rack_app.rb +97 -0
- data/lib/pgbus/mcp/redactor.rb +72 -0
- data/lib/pgbus/mcp/runner.rb +73 -0
- data/lib/pgbus/mcp/server.rb +62 -0
- data/lib/pgbus/mcp/tools/dlq_detail_tool.rb +72 -0
- data/lib/pgbus/mcp/tools/dlq_tool.rb +48 -0
- data/lib/pgbus/mcp/tools/health_tool.rb +33 -0
- data/lib/pgbus/mcp/tools/job_detail_tool.rb +42 -0
- data/lib/pgbus/mcp/tools/jobs_tool.rb +56 -0
- data/lib/pgbus/mcp/tools/locks_tool.rb +28 -0
- data/lib/pgbus/mcp/tools/processes_tool.rb +32 -0
- data/lib/pgbus/mcp/tools/queue_detail_tool.rb +46 -0
- data/lib/pgbus/mcp/tools/queues_tool.rb +28 -0
- data/lib/pgbus/mcp/tools/recurring_tool.rb +27 -0
- data/lib/pgbus/mcp/tools/stats_tool.rb +40 -0
- data/lib/pgbus/mcp/tools/throughput_tool.rb +35 -0
- data/lib/pgbus/mcp.rb +55 -0
- data/lib/pgbus/process/heartbeat.rb +8 -2
- data/lib/pgbus/process/supervisor.rb +44 -0
- data/lib/pgbus/process/worker.rb +12 -1
- data/lib/pgbus/version.rb +1 -1
- data/lib/pgbus/web/data_source.rb +40 -2
- data/lib/pgbus.rb +15 -1
- metadata +21 -1
data/lib/pgbus.rb
CHANGED
|
@@ -18,6 +18,7 @@ module Pgbus
|
|
|
18
18
|
class ConcurrencyLimitExceeded < Error; end
|
|
19
19
|
class JobNotUnique < Error; end
|
|
20
20
|
class SchemaNotReady < Error; end
|
|
21
|
+
class ReadTimeoutError < Error; end
|
|
21
22
|
|
|
22
23
|
class << self
|
|
23
24
|
# Process-global flag set by Worker#graceful_shutdown so the adapter
|
|
@@ -35,11 +36,19 @@ module Pgbus
|
|
|
35
36
|
"pgbus" => "Pgbus",
|
|
36
37
|
"cli" => "CLI",
|
|
37
38
|
"dsl" => "DSL",
|
|
38
|
-
"capsule_dsl" => "CapsuleDSL"
|
|
39
|
+
"capsule_dsl" => "CapsuleDSL",
|
|
40
|
+
"mcp" => "MCP"
|
|
39
41
|
)
|
|
40
42
|
loader.ignore("#{__dir__}/generators")
|
|
41
43
|
loader.ignore("#{__dir__}/active_job")
|
|
42
44
|
loader.ignore("#{__dir__}/pgbus/testing")
|
|
45
|
+
# The MCP diagnostic server is optional — its tool classes subclass
|
|
46
|
+
# MCP::Tool from the (optional) `mcp` gem. Keeping it out of Zeitwerk
|
|
47
|
+
# means we never reference the gem's constants at autoload time;
|
|
48
|
+
# `Pgbus::MCP.load!` (called by the `pgbus mcp` CLI command) requires
|
|
49
|
+
# the gem and loads the subsystem explicitly.
|
|
50
|
+
loader.ignore("#{__dir__}/pgbus/mcp")
|
|
51
|
+
loader.ignore("#{__dir__}/pgbus/mcp.rb")
|
|
43
52
|
# Vendor integrations are loaded conditionally (when the vendor gem
|
|
44
53
|
# is present) by lib/pgbus/engine.rb. Keeping them out of Zeitwerk
|
|
45
54
|
# means we don't reference vendor constants at autoload time.
|
|
@@ -174,3 +183,8 @@ end
|
|
|
174
183
|
|
|
175
184
|
require "active_job/queue_adapters/pgbus_adapter" if defined?(ActiveJob)
|
|
176
185
|
require "pgbus/engine" if defined?(Rails::Engine)
|
|
186
|
+
|
|
187
|
+
# Define the optional MCP namespace and its `load!` entrypoint. This file is
|
|
188
|
+
# excluded from Zeitwerk (it references the optional `mcp` gem only inside
|
|
189
|
+
# load!), so require it explicitly here. Requiring it does NOT load the gem.
|
|
190
|
+
require "pgbus/mcp"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pgbus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikael Henriksson
|
|
@@ -279,12 +279,32 @@ files:
|
|
|
279
279
|
- lib/pgbus/generators/migration_detector.rb
|
|
280
280
|
- lib/pgbus/instrumentation.rb
|
|
281
281
|
- lib/pgbus/integrations/appsignal.rb
|
|
282
|
+
- lib/pgbus/integrations/appsignal/dashboard.json
|
|
282
283
|
- lib/pgbus/integrations/appsignal/dashboards/pgbus_health.json
|
|
283
284
|
- lib/pgbus/integrations/appsignal/dashboards/pgbus_streams.json
|
|
284
285
|
- lib/pgbus/integrations/appsignal/dashboards/pgbus_throughput.json
|
|
285
286
|
- lib/pgbus/integrations/appsignal/probe.rb
|
|
286
287
|
- lib/pgbus/integrations/appsignal/subscriber.rb
|
|
287
288
|
- lib/pgbus/log_formatter.rb
|
|
289
|
+
- lib/pgbus/mcp.rb
|
|
290
|
+
- lib/pgbus/mcp/base_tool.rb
|
|
291
|
+
- lib/pgbus/mcp/health_analyzer.rb
|
|
292
|
+
- lib/pgbus/mcp/rack_app.rb
|
|
293
|
+
- lib/pgbus/mcp/redactor.rb
|
|
294
|
+
- lib/pgbus/mcp/runner.rb
|
|
295
|
+
- lib/pgbus/mcp/server.rb
|
|
296
|
+
- lib/pgbus/mcp/tools/dlq_detail_tool.rb
|
|
297
|
+
- lib/pgbus/mcp/tools/dlq_tool.rb
|
|
298
|
+
- lib/pgbus/mcp/tools/health_tool.rb
|
|
299
|
+
- lib/pgbus/mcp/tools/job_detail_tool.rb
|
|
300
|
+
- lib/pgbus/mcp/tools/jobs_tool.rb
|
|
301
|
+
- lib/pgbus/mcp/tools/locks_tool.rb
|
|
302
|
+
- lib/pgbus/mcp/tools/processes_tool.rb
|
|
303
|
+
- lib/pgbus/mcp/tools/queue_detail_tool.rb
|
|
304
|
+
- lib/pgbus/mcp/tools/queues_tool.rb
|
|
305
|
+
- lib/pgbus/mcp/tools/recurring_tool.rb
|
|
306
|
+
- lib/pgbus/mcp/tools/stats_tool.rb
|
|
307
|
+
- lib/pgbus/mcp/tools/throughput_tool.rb
|
|
288
308
|
- lib/pgbus/outbox.rb
|
|
289
309
|
- lib/pgbus/outbox/poller.rb
|
|
290
310
|
- lib/pgbus/pgmq_schema.rb
|