brainzlab 0.1.0 → 0.1.2
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/CHANGELOG.md +9 -0
- data/README.md +30 -0
- data/lib/brainzlab/beacon/client.rb +209 -0
- data/lib/brainzlab/beacon/provisioner.rb +44 -0
- data/lib/brainzlab/beacon.rb +215 -0
- data/lib/brainzlab/configuration.rb +341 -3
- data/lib/brainzlab/cortex/cache.rb +59 -0
- data/lib/brainzlab/cortex/client.rb +141 -0
- data/lib/brainzlab/cortex/provisioner.rb +49 -0
- data/lib/brainzlab/cortex.rb +227 -0
- data/lib/brainzlab/dendrite/client.rb +232 -0
- data/lib/brainzlab/dendrite/provisioner.rb +44 -0
- data/lib/brainzlab/dendrite.rb +195 -0
- data/lib/brainzlab/devtools/assets/devtools.css +1106 -0
- data/lib/brainzlab/devtools/assets/devtools.js +322 -0
- data/lib/brainzlab/devtools/assets/logo.svg +6 -0
- data/lib/brainzlab/devtools/assets/templates/debug_panel.html.erb +500 -0
- data/lib/brainzlab/devtools/assets/templates/error_page.html.erb +1086 -0
- data/lib/brainzlab/devtools/data/collector.rb +248 -0
- data/lib/brainzlab/devtools/middleware/asset_server.rb +63 -0
- data/lib/brainzlab/devtools/middleware/database_handler.rb +180 -0
- data/lib/brainzlab/devtools/middleware/debug_panel.rb +126 -0
- data/lib/brainzlab/devtools/middleware/error_page.rb +376 -0
- data/lib/brainzlab/devtools/renderers/debug_panel_renderer.rb +155 -0
- data/lib/brainzlab/devtools/renderers/error_page_renderer.rb +94 -0
- data/lib/brainzlab/devtools.rb +75 -0
- data/lib/brainzlab/flux/buffer.rb +96 -0
- data/lib/brainzlab/flux/client.rb +70 -0
- data/lib/brainzlab/flux/provisioner.rb +57 -0
- data/lib/brainzlab/flux.rb +174 -0
- data/lib/brainzlab/instrumentation/active_record.rb +18 -1
- data/lib/brainzlab/instrumentation/aws.rb +179 -0
- data/lib/brainzlab/instrumentation/dalli.rb +108 -0
- data/lib/brainzlab/instrumentation/excon.rb +152 -0
- data/lib/brainzlab/instrumentation/good_job.rb +102 -0
- data/lib/brainzlab/instrumentation/resque.rb +115 -0
- data/lib/brainzlab/instrumentation/solid_queue.rb +198 -0
- data/lib/brainzlab/instrumentation/stripe.rb +164 -0
- data/lib/brainzlab/instrumentation/typhoeus.rb +104 -0
- data/lib/brainzlab/instrumentation.rb +72 -0
- data/lib/brainzlab/nerve/client.rb +217 -0
- data/lib/brainzlab/nerve/provisioner.rb +44 -0
- data/lib/brainzlab/nerve.rb +219 -0
- data/lib/brainzlab/pulse/instrumentation.rb +35 -2
- data/lib/brainzlab/pulse/propagation.rb +1 -1
- data/lib/brainzlab/pulse/tracer.rb +1 -1
- data/lib/brainzlab/pulse.rb +1 -1
- data/lib/brainzlab/rails/log_subscriber.rb +1 -2
- data/lib/brainzlab/rails/railtie.rb +36 -3
- data/lib/brainzlab/recall/provisioner.rb +17 -0
- data/lib/brainzlab/recall.rb +6 -1
- data/lib/brainzlab/reflex.rb +20 -5
- data/lib/brainzlab/sentinel/client.rb +218 -0
- data/lib/brainzlab/sentinel/provisioner.rb +44 -0
- data/lib/brainzlab/sentinel.rb +165 -0
- data/lib/brainzlab/signal/client.rb +62 -0
- data/lib/brainzlab/signal/provisioner.rb +55 -0
- data/lib/brainzlab/signal.rb +136 -0
- data/lib/brainzlab/synapse/client.rb +290 -0
- data/lib/brainzlab/synapse/provisioner.rb +44 -0
- data/lib/brainzlab/synapse.rb +270 -0
- data/lib/brainzlab/utilities/circuit_breaker.rb +265 -0
- data/lib/brainzlab/utilities/health_check.rb +296 -0
- data/lib/brainzlab/utilities/log_formatter.rb +256 -0
- data/lib/brainzlab/utilities/rate_limiter.rb +230 -0
- data/lib/brainzlab/utilities.rb +17 -0
- data/lib/brainzlab/vault/cache.rb +80 -0
- data/lib/brainzlab/vault/client.rb +198 -0
- data/lib/brainzlab/vault/provisioner.rb +49 -0
- data/lib/brainzlab/vault.rb +268 -0
- data/lib/brainzlab/version.rb +1 -1
- data/lib/brainzlab/vision/client.rb +128 -0
- data/lib/brainzlab/vision/provisioner.rb +136 -0
- data/lib/brainzlab/vision.rb +157 -0
- data/lib/brainzlab.rb +101 -0
- metadata +62 -2
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "uri"
|
|
5
|
+
require "json"
|
|
6
|
+
require "fileutils"
|
|
7
|
+
|
|
8
|
+
module BrainzLab
|
|
9
|
+
module Vision
|
|
10
|
+
class Provisioner
|
|
11
|
+
CACHE_DIR = ENV.fetch("BRAINZLAB_CACHE_DIR") { File.join(Dir.home, ".brainzlab") }
|
|
12
|
+
|
|
13
|
+
def initialize(config)
|
|
14
|
+
@config = config
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def ensure_project!
|
|
18
|
+
return unless should_provision?
|
|
19
|
+
|
|
20
|
+
# Try cached credentials first
|
|
21
|
+
if (cached = load_cached_credentials)
|
|
22
|
+
apply_credentials(cached)
|
|
23
|
+
return cached
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Provision new project
|
|
27
|
+
project = provision_project
|
|
28
|
+
return unless project
|
|
29
|
+
|
|
30
|
+
# Cache and apply credentials
|
|
31
|
+
cache_credentials(project)
|
|
32
|
+
apply_credentials(project)
|
|
33
|
+
|
|
34
|
+
project
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def should_provision?
|
|
40
|
+
if @config.debug
|
|
41
|
+
log_debug("Checking Vision provision conditions:")
|
|
42
|
+
log_debug(" vision_auto_provision: #{@config.vision_auto_provision}")
|
|
43
|
+
log_debug(" app_name: '#{@config.app_name}'")
|
|
44
|
+
log_debug(" vision_api_key set: #{@config.vision_api_key.to_s.strip.length > 0}")
|
|
45
|
+
log_debug(" vision_ingest_key set: #{@config.vision_ingest_key.to_s.strip.length > 0}")
|
|
46
|
+
log_debug(" vision_master_key set: #{@config.vision_master_key.to_s.strip.length > 0}")
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
return false unless @config.vision_auto_provision
|
|
50
|
+
return false unless @config.app_name.to_s.strip.length > 0
|
|
51
|
+
return false if @config.vision_api_key.to_s.strip.length > 0
|
|
52
|
+
return false if @config.vision_ingest_key.to_s.strip.length > 0
|
|
53
|
+
return false unless @config.vision_master_key.to_s.strip.length > 0
|
|
54
|
+
|
|
55
|
+
log_debug("Will provision Vision project") if @config.debug
|
|
56
|
+
true
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def log_debug(message)
|
|
60
|
+
if @config.logger
|
|
61
|
+
@config.logger.info("[BrainzLab::Debug] #{message}")
|
|
62
|
+
else
|
|
63
|
+
puts "[BrainzLab::Debug] #{message}"
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def provision_project
|
|
68
|
+
uri = URI.parse("#{@config.vision_url}/api/v1/projects/provision")
|
|
69
|
+
request = Net::HTTP::Post.new(uri)
|
|
70
|
+
request["Content-Type"] = "application/json"
|
|
71
|
+
request["X-Master-Key"] = @config.vision_master_key
|
|
72
|
+
request["User-Agent"] = "brainzlab-sdk-ruby/#{BrainzLab::VERSION}"
|
|
73
|
+
request.body = JSON.generate({
|
|
74
|
+
name: @config.app_name,
|
|
75
|
+
environment: @config.environment
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
response = execute(uri, request)
|
|
79
|
+
return nil unless response.is_a?(Net::HTTPSuccess)
|
|
80
|
+
|
|
81
|
+
JSON.parse(response.body, symbolize_names: true)
|
|
82
|
+
rescue StandardError => e
|
|
83
|
+
log_error("Failed to provision Vision project: #{e.message}")
|
|
84
|
+
nil
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def load_cached_credentials
|
|
88
|
+
path = cache_file_path
|
|
89
|
+
return nil unless File.exist?(path)
|
|
90
|
+
|
|
91
|
+
data = JSON.parse(File.read(path), symbolize_names: true)
|
|
92
|
+
|
|
93
|
+
# Validate cached data has required keys
|
|
94
|
+
return nil unless data[:ingest_key] || data[:api_key]
|
|
95
|
+
|
|
96
|
+
data
|
|
97
|
+
rescue StandardError => e
|
|
98
|
+
log_error("Failed to load cached Vision credentials: #{e.message}")
|
|
99
|
+
nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def cache_credentials(project)
|
|
103
|
+
FileUtils.mkdir_p(CACHE_DIR)
|
|
104
|
+
File.write(cache_file_path, JSON.generate(project))
|
|
105
|
+
rescue StandardError => e
|
|
106
|
+
log_error("Failed to cache Vision credentials: #{e.message}")
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def cache_file_path
|
|
110
|
+
File.join(CACHE_DIR, "#{@config.app_name}.vision.json")
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def apply_credentials(project)
|
|
114
|
+
@config.vision_ingest_key = project[:ingest_key]
|
|
115
|
+
@config.vision_api_key = project[:api_key]
|
|
116
|
+
|
|
117
|
+
# Also set service name from app_name if not already set
|
|
118
|
+
@config.service ||= @config.app_name
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def execute(uri, request)
|
|
122
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
123
|
+
http.use_ssl = uri.scheme == "https"
|
|
124
|
+
http.open_timeout = 5
|
|
125
|
+
http.read_timeout = 10
|
|
126
|
+
http.request(request)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def log_error(message)
|
|
130
|
+
return unless @config.logger
|
|
131
|
+
|
|
132
|
+
@config.logger.error("[BrainzLab] #{message}")
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "vision/client"
|
|
4
|
+
require_relative "vision/provisioner"
|
|
5
|
+
|
|
6
|
+
module BrainzLab
|
|
7
|
+
module Vision
|
|
8
|
+
class << self
|
|
9
|
+
# Execute an autonomous AI task
|
|
10
|
+
# @param instruction [String] Natural language instruction for the AI
|
|
11
|
+
# @param start_url [String] URL to start from
|
|
12
|
+
# @param model [String] LLM model to use (default: claude-sonnet-4)
|
|
13
|
+
# @param browser_provider [String] Browser provider (default: local)
|
|
14
|
+
# @param max_steps [Integer] Maximum steps to execute (default: 50)
|
|
15
|
+
# @param timeout [Integer] Timeout in seconds (default: 300)
|
|
16
|
+
# @return [Hash] Task result with extracted data
|
|
17
|
+
def execute_task(instruction:, start_url:, model: nil, browser_provider: nil, max_steps: 50, timeout: 300)
|
|
18
|
+
config = BrainzLab.configuration
|
|
19
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
20
|
+
|
|
21
|
+
ensure_provisioned!
|
|
22
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
23
|
+
|
|
24
|
+
client.execute_task(
|
|
25
|
+
instruction: instruction,
|
|
26
|
+
start_url: start_url,
|
|
27
|
+
model: model,
|
|
28
|
+
browser_provider: browser_provider,
|
|
29
|
+
max_steps: max_steps,
|
|
30
|
+
timeout: timeout
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Create a browser session
|
|
35
|
+
# @param url [String] Optional initial URL
|
|
36
|
+
# @param viewport [Hash] Viewport dimensions { width:, height: }
|
|
37
|
+
# @param browser_provider [String] Browser provider to use
|
|
38
|
+
# @return [Hash] Session info with session_id
|
|
39
|
+
def create_session(url: nil, viewport: nil, browser_provider: nil)
|
|
40
|
+
config = BrainzLab.configuration
|
|
41
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
42
|
+
|
|
43
|
+
ensure_provisioned!
|
|
44
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
45
|
+
|
|
46
|
+
client.create_session(
|
|
47
|
+
url: url,
|
|
48
|
+
viewport: viewport,
|
|
49
|
+
browser_provider: browser_provider
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Perform an AI-powered action in a session
|
|
54
|
+
# @param session_id [String] Session ID
|
|
55
|
+
# @param instruction [String] Natural language instruction
|
|
56
|
+
# @param model [String] LLM model to use
|
|
57
|
+
# @return [Hash] Action result
|
|
58
|
+
def ai_action(session_id:, instruction:, model: nil)
|
|
59
|
+
config = BrainzLab.configuration
|
|
60
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
61
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
62
|
+
|
|
63
|
+
client.ai_action(
|
|
64
|
+
session_id: session_id,
|
|
65
|
+
instruction: instruction,
|
|
66
|
+
model: model
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Perform a direct browser action
|
|
71
|
+
# @param session_id [String] Session ID
|
|
72
|
+
# @param action [Symbol] Action type (:click, :type, :scroll, etc.)
|
|
73
|
+
# @param selector [String] Element selector
|
|
74
|
+
# @param value [String] Value for type/fill actions
|
|
75
|
+
# @return [Hash] Action result
|
|
76
|
+
def perform(session_id:, action:, selector: nil, value: nil)
|
|
77
|
+
config = BrainzLab.configuration
|
|
78
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
79
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
80
|
+
|
|
81
|
+
client.perform(
|
|
82
|
+
session_id: session_id,
|
|
83
|
+
action: action,
|
|
84
|
+
selector: selector,
|
|
85
|
+
value: value
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Extract structured data from the page
|
|
90
|
+
# @param session_id [String] Session ID
|
|
91
|
+
# @param schema [Hash] JSON schema for extraction
|
|
92
|
+
# @param instruction [String] Optional instruction for extraction
|
|
93
|
+
# @return [Hash] Extracted data
|
|
94
|
+
def extract(session_id:, schema:, instruction: nil)
|
|
95
|
+
config = BrainzLab.configuration
|
|
96
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
97
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
98
|
+
|
|
99
|
+
client.extract(
|
|
100
|
+
session_id: session_id,
|
|
101
|
+
schema: schema,
|
|
102
|
+
instruction: instruction
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Close a browser session
|
|
107
|
+
# @param session_id [String] Session ID
|
|
108
|
+
# @return [Hash] Close result
|
|
109
|
+
def close_session(session_id:)
|
|
110
|
+
config = BrainzLab.configuration
|
|
111
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
112
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
113
|
+
|
|
114
|
+
client.close_session(session_id: session_id)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Take a screenshot
|
|
118
|
+
# @param session_id [String] Session ID
|
|
119
|
+
# @param full_page [Boolean] Capture full page (default: true)
|
|
120
|
+
# @return [Hash] Screenshot data
|
|
121
|
+
def screenshot(session_id:, full_page: true)
|
|
122
|
+
config = BrainzLab.configuration
|
|
123
|
+
return { error: "Vision is not enabled" } unless config.vision_enabled
|
|
124
|
+
return { error: "Vision credentials not configured" } unless config.vision_valid?
|
|
125
|
+
|
|
126
|
+
client.screenshot(session_id: session_id, full_page: full_page)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Ensure project is auto-provisioned
|
|
130
|
+
def ensure_provisioned!
|
|
131
|
+
config = BrainzLab.configuration
|
|
132
|
+
if config.debug
|
|
133
|
+
puts "[BrainzLab::Debug] Vision.ensure_provisioned! called, @provisioned=#{@provisioned}"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
return if @provisioned
|
|
137
|
+
|
|
138
|
+
@provisioned = true
|
|
139
|
+
provisioner.ensure_project!
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def provisioner
|
|
143
|
+
@provisioner ||= Provisioner.new(BrainzLab.configuration)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def client
|
|
147
|
+
@client ||= Client.new(BrainzLab.configuration)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def reset!
|
|
151
|
+
@client = nil
|
|
152
|
+
@provisioner = nil
|
|
153
|
+
@provisioned = false
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
data/lib/brainzlab.rb
CHANGED
|
@@ -6,7 +6,18 @@ require_relative "brainzlab/context"
|
|
|
6
6
|
require_relative "brainzlab/recall"
|
|
7
7
|
require_relative "brainzlab/reflex"
|
|
8
8
|
require_relative "brainzlab/pulse"
|
|
9
|
+
require_relative "brainzlab/flux"
|
|
10
|
+
require_relative "brainzlab/signal"
|
|
11
|
+
require_relative "brainzlab/vault"
|
|
12
|
+
require_relative "brainzlab/vision"
|
|
13
|
+
require_relative "brainzlab/cortex"
|
|
14
|
+
require_relative "brainzlab/beacon"
|
|
15
|
+
require_relative "brainzlab/nerve"
|
|
16
|
+
require_relative "brainzlab/dendrite"
|
|
17
|
+
require_relative "brainzlab/sentinel"
|
|
18
|
+
require_relative "brainzlab/synapse"
|
|
9
19
|
require_relative "brainzlab/instrumentation"
|
|
20
|
+
require_relative "brainzlab/utilities"
|
|
10
21
|
|
|
11
22
|
module BrainzLab
|
|
12
23
|
class << self
|
|
@@ -24,6 +35,16 @@ module BrainzLab
|
|
|
24
35
|
Recall.reset!
|
|
25
36
|
Reflex.reset!
|
|
26
37
|
Pulse.reset!
|
|
38
|
+
Flux.reset!
|
|
39
|
+
Signal.reset!
|
|
40
|
+
Vault.reset!
|
|
41
|
+
Vision.reset!
|
|
42
|
+
Cortex.reset!
|
|
43
|
+
Beacon.reset!
|
|
44
|
+
Nerve.reset!
|
|
45
|
+
Dendrite.reset!
|
|
46
|
+
Sentinel.reset!
|
|
47
|
+
Synapse.reset!
|
|
27
48
|
end
|
|
28
49
|
|
|
29
50
|
# Context management
|
|
@@ -102,6 +123,86 @@ module BrainzLab
|
|
|
102
123
|
)
|
|
103
124
|
end
|
|
104
125
|
|
|
126
|
+
# Check Flux
|
|
127
|
+
if configuration.flux_enabled
|
|
128
|
+
results[:services][:flux] = check_service_health(
|
|
129
|
+
url: configuration.flux_url,
|
|
130
|
+
name: 'Flux'
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Check Signal
|
|
135
|
+
if configuration.signal_enabled
|
|
136
|
+
results[:services][:signal] = check_service_health(
|
|
137
|
+
url: configuration.signal_url,
|
|
138
|
+
name: 'Signal'
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Check Vault
|
|
143
|
+
if configuration.vault_enabled
|
|
144
|
+
results[:services][:vault] = check_service_health(
|
|
145
|
+
url: configuration.vault_url,
|
|
146
|
+
name: 'Vault'
|
|
147
|
+
)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Check Vision
|
|
151
|
+
if configuration.vision_enabled
|
|
152
|
+
results[:services][:vision] = check_service_health(
|
|
153
|
+
url: configuration.vision_url,
|
|
154
|
+
name: 'Vision'
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Check Cortex
|
|
159
|
+
if configuration.cortex_enabled
|
|
160
|
+
results[:services][:cortex] = check_service_health(
|
|
161
|
+
url: configuration.cortex_url,
|
|
162
|
+
name: 'Cortex'
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Check Beacon
|
|
167
|
+
if configuration.beacon_enabled
|
|
168
|
+
results[:services][:beacon] = check_service_health(
|
|
169
|
+
url: configuration.beacon_url,
|
|
170
|
+
name: 'Beacon'
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Check Nerve
|
|
175
|
+
if configuration.nerve_enabled
|
|
176
|
+
results[:services][:nerve] = check_service_health(
|
|
177
|
+
url: configuration.nerve_url,
|
|
178
|
+
name: 'Nerve'
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Check Dendrite
|
|
183
|
+
if configuration.dendrite_enabled
|
|
184
|
+
results[:services][:dendrite] = check_service_health(
|
|
185
|
+
url: configuration.dendrite_url,
|
|
186
|
+
name: 'Dendrite'
|
|
187
|
+
)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Check Sentinel
|
|
191
|
+
if configuration.sentinel_enabled
|
|
192
|
+
results[:services][:sentinel] = check_service_health(
|
|
193
|
+
url: configuration.sentinel_url,
|
|
194
|
+
name: 'Sentinel'
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Check Synapse
|
|
199
|
+
if configuration.synapse_enabled
|
|
200
|
+
results[:services][:synapse] = check_service_health(
|
|
201
|
+
url: configuration.synapse_url,
|
|
202
|
+
name: 'Synapse'
|
|
203
|
+
)
|
|
204
|
+
end
|
|
205
|
+
|
|
105
206
|
# Overall status
|
|
106
207
|
has_failure = results[:services].values.any? { |s| s[:status] == 'error' }
|
|
107
208
|
results[:status] = has_failure ? 'degraded' : 'ok'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brainzlab
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brainz Lab
|
|
@@ -93,21 +93,59 @@ files:
|
|
|
93
93
|
- README.md
|
|
94
94
|
- lib/brainzlab-sdk.rb
|
|
95
95
|
- lib/brainzlab.rb
|
|
96
|
+
- lib/brainzlab/beacon.rb
|
|
97
|
+
- lib/brainzlab/beacon/client.rb
|
|
98
|
+
- lib/brainzlab/beacon/provisioner.rb
|
|
96
99
|
- lib/brainzlab/configuration.rb
|
|
97
100
|
- lib/brainzlab/context.rb
|
|
101
|
+
- lib/brainzlab/cortex.rb
|
|
102
|
+
- lib/brainzlab/cortex/cache.rb
|
|
103
|
+
- lib/brainzlab/cortex/client.rb
|
|
104
|
+
- lib/brainzlab/cortex/provisioner.rb
|
|
105
|
+
- lib/brainzlab/dendrite.rb
|
|
106
|
+
- lib/brainzlab/dendrite/client.rb
|
|
107
|
+
- lib/brainzlab/dendrite/provisioner.rb
|
|
108
|
+
- lib/brainzlab/devtools.rb
|
|
109
|
+
- lib/brainzlab/devtools/assets/devtools.css
|
|
110
|
+
- lib/brainzlab/devtools/assets/devtools.js
|
|
111
|
+
- lib/brainzlab/devtools/assets/logo.svg
|
|
112
|
+
- lib/brainzlab/devtools/assets/templates/debug_panel.html.erb
|
|
113
|
+
- lib/brainzlab/devtools/assets/templates/error_page.html.erb
|
|
114
|
+
- lib/brainzlab/devtools/data/collector.rb
|
|
115
|
+
- lib/brainzlab/devtools/middleware/asset_server.rb
|
|
116
|
+
- lib/brainzlab/devtools/middleware/database_handler.rb
|
|
117
|
+
- lib/brainzlab/devtools/middleware/debug_panel.rb
|
|
118
|
+
- lib/brainzlab/devtools/middleware/error_page.rb
|
|
119
|
+
- lib/brainzlab/devtools/renderers/debug_panel_renderer.rb
|
|
120
|
+
- lib/brainzlab/devtools/renderers/error_page_renderer.rb
|
|
121
|
+
- lib/brainzlab/flux.rb
|
|
122
|
+
- lib/brainzlab/flux/buffer.rb
|
|
123
|
+
- lib/brainzlab/flux/client.rb
|
|
124
|
+
- lib/brainzlab/flux/provisioner.rb
|
|
98
125
|
- lib/brainzlab/instrumentation.rb
|
|
99
126
|
- lib/brainzlab/instrumentation/action_mailer.rb
|
|
100
127
|
- lib/brainzlab/instrumentation/active_record.rb
|
|
128
|
+
- lib/brainzlab/instrumentation/aws.rb
|
|
129
|
+
- lib/brainzlab/instrumentation/dalli.rb
|
|
101
130
|
- lib/brainzlab/instrumentation/delayed_job.rb
|
|
102
131
|
- lib/brainzlab/instrumentation/elasticsearch.rb
|
|
132
|
+
- lib/brainzlab/instrumentation/excon.rb
|
|
103
133
|
- lib/brainzlab/instrumentation/faraday.rb
|
|
134
|
+
- lib/brainzlab/instrumentation/good_job.rb
|
|
104
135
|
- lib/brainzlab/instrumentation/grape.rb
|
|
105
136
|
- lib/brainzlab/instrumentation/graphql.rb
|
|
106
137
|
- lib/brainzlab/instrumentation/httparty.rb
|
|
107
138
|
- lib/brainzlab/instrumentation/mongodb.rb
|
|
108
139
|
- lib/brainzlab/instrumentation/net_http.rb
|
|
109
140
|
- lib/brainzlab/instrumentation/redis.rb
|
|
141
|
+
- lib/brainzlab/instrumentation/resque.rb
|
|
110
142
|
- lib/brainzlab/instrumentation/sidekiq.rb
|
|
143
|
+
- lib/brainzlab/instrumentation/solid_queue.rb
|
|
144
|
+
- lib/brainzlab/instrumentation/stripe.rb
|
|
145
|
+
- lib/brainzlab/instrumentation/typhoeus.rb
|
|
146
|
+
- lib/brainzlab/nerve.rb
|
|
147
|
+
- lib/brainzlab/nerve/client.rb
|
|
148
|
+
- lib/brainzlab/nerve/provisioner.rb
|
|
111
149
|
- lib/brainzlab/pulse.rb
|
|
112
150
|
- lib/brainzlab/pulse/client.rb
|
|
113
151
|
- lib/brainzlab/pulse/instrumentation.rb
|
|
@@ -126,7 +164,28 @@ files:
|
|
|
126
164
|
- lib/brainzlab/reflex/breadcrumbs.rb
|
|
127
165
|
- lib/brainzlab/reflex/client.rb
|
|
128
166
|
- lib/brainzlab/reflex/provisioner.rb
|
|
167
|
+
- lib/brainzlab/sentinel.rb
|
|
168
|
+
- lib/brainzlab/sentinel/client.rb
|
|
169
|
+
- lib/brainzlab/sentinel/provisioner.rb
|
|
170
|
+
- lib/brainzlab/signal.rb
|
|
171
|
+
- lib/brainzlab/signal/client.rb
|
|
172
|
+
- lib/brainzlab/signal/provisioner.rb
|
|
173
|
+
- lib/brainzlab/synapse.rb
|
|
174
|
+
- lib/brainzlab/synapse/client.rb
|
|
175
|
+
- lib/brainzlab/synapse/provisioner.rb
|
|
176
|
+
- lib/brainzlab/utilities.rb
|
|
177
|
+
- lib/brainzlab/utilities/circuit_breaker.rb
|
|
178
|
+
- lib/brainzlab/utilities/health_check.rb
|
|
179
|
+
- lib/brainzlab/utilities/log_formatter.rb
|
|
180
|
+
- lib/brainzlab/utilities/rate_limiter.rb
|
|
181
|
+
- lib/brainzlab/vault.rb
|
|
182
|
+
- lib/brainzlab/vault/cache.rb
|
|
183
|
+
- lib/brainzlab/vault/client.rb
|
|
184
|
+
- lib/brainzlab/vault/provisioner.rb
|
|
129
185
|
- lib/brainzlab/version.rb
|
|
186
|
+
- lib/brainzlab/vision.rb
|
|
187
|
+
- lib/brainzlab/vision/client.rb
|
|
188
|
+
- lib/brainzlab/vision/provisioner.rb
|
|
130
189
|
- lib/generators/brainzlab/install/install_generator.rb
|
|
131
190
|
- lib/generators/brainzlab/install/templates/brainzlab.rb.tt
|
|
132
191
|
homepage: https://brainzlab.ai
|
|
@@ -138,6 +197,7 @@ metadata:
|
|
|
138
197
|
changelog_uri: https://github.com/brainz-lab/brainzlab-ruby/blob/main/CHANGELOG.md
|
|
139
198
|
documentation_uri: https://docs.brainzlab.ai/sdk/ruby
|
|
140
199
|
rubygems_mfa_required: 'true'
|
|
200
|
+
github_repo: ssh://github.com/brainz-lab/brainzlab-ruby
|
|
141
201
|
rdoc_options: []
|
|
142
202
|
require_paths:
|
|
143
203
|
- lib
|
|
@@ -145,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
145
205
|
requirements:
|
|
146
206
|
- - ">="
|
|
147
207
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: 3.
|
|
208
|
+
version: 3.2.0
|
|
149
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
210
|
requirements:
|
|
151
211
|
- - ">="
|