rookout 0.1.19 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rookout/augs/aug.rb +5 -0
- data/lib/rookout/augs/aug_factory.rb +2 -2
- data/lib/rookout/com_ws/agent_com_ws.rb +6 -0
- data/lib/rookout/com_ws/information.rb +19 -2
- data/lib/rookout/com_ws/output.rb +4 -0
- data/lib/rookout/com_ws/pinger.rb +1 -1
- data/lib/rookout/com_ws/websocket_client.rb +1 -1
- data/lib/rookout/commit.rb +1 -1
- data/lib/rookout/exceptions.rb +18 -0
- data/lib/rookout/processor/namespaces/ruby_object_serializer.rb +2 -2
- data/lib/rookout/services/tracer.rb +1 -1
- data/lib/rookout/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b41a3be6ece6ef09531502db594ac06453723797d3c9c0f33e61ffe15a67587
|
4
|
+
data.tar.gz: a772b70e1fd6df14a51f1bf74e4938a576ef9b7989692eaf09d658c190789ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b81e9fb7362fdf9abb57988d9dc2eb0acc099c5149243b1bf4d787c4e05d5aa4f3bc3602214eba23742ba152ac90fc18342a6abd5b872189b53626f007cea71
|
7
|
+
data.tar.gz: 012b9eb8d6a15ba2f267190bc1edd1adea15472bc288e78d936cb592a2726b9bac66ba06067ab111e3757fc3562b8df95d69b013e38a2567f0b4c47385900106
|
data/lib/rookout/augs/aug.rb
CHANGED
@@ -28,6 +28,11 @@ module Rookout
|
|
28
28
|
def execute frame, extracted, output
|
29
29
|
return unless @enabled
|
30
30
|
|
31
|
+
if output.user_messages_queue_full?
|
32
|
+
Logger.instance.warning "Skipping aug-\t#{id} execution because the queue is full"
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
31
36
|
namespace = create_namespaces frame, extracted
|
32
37
|
return if @condition && !@condition.evaluate(namespace)
|
33
38
|
|
@@ -45,7 +45,7 @@ module Rookout
|
|
45
45
|
|
46
46
|
def create_location configuration, aug
|
47
47
|
name = configuration["name"]
|
48
|
-
raise Exceptions
|
48
|
+
raise Exceptions::RookObjectNameMissing if name.nil?
|
49
49
|
|
50
50
|
case name
|
51
51
|
when "file_line"
|
@@ -53,7 +53,7 @@ module Rookout
|
|
53
53
|
when "exception_handler"
|
54
54
|
return Locations::LocationExceptionHandler.new configuration, @output, aug
|
55
55
|
else
|
56
|
-
raise Exceptions
|
56
|
+
raise Exceptions::RookUnsupportedLocation if name != "file_line"
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -23,6 +23,8 @@ module Rookout
|
|
23
23
|
class AgentComWs
|
24
24
|
include EventEmitter
|
25
25
|
|
26
|
+
attr_reader :pending_messages
|
27
|
+
|
26
28
|
def initialize output, agent_host, agent_port, proxy, token, labels
|
27
29
|
agent_host_with_protocl = agent_host.include?("://") ? agent_host : "ws://#{agent_host}"
|
28
30
|
@uri = "#{agent_host_with_protocl}:#{agent_port}/v1"
|
@@ -62,6 +64,10 @@ module Rookout
|
|
62
64
|
@pending_messages.push buffer if @pending_messages.length < Config.agent_com_max_queued_messages
|
63
65
|
end
|
64
66
|
|
67
|
+
def queue_full?
|
68
|
+
@pending_messages.length >= Config.agent_com_max_queued_messages
|
69
|
+
end
|
70
|
+
|
65
71
|
def connect
|
66
72
|
@running = true
|
67
73
|
|
@@ -11,11 +11,16 @@ module Rookout
|
|
11
11
|
require_relative "git"
|
12
12
|
include Git
|
13
13
|
|
14
|
-
def initialize labels
|
14
|
+
def initialize labels, k8s_file_path = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
|
15
15
|
@agent_id = nil
|
16
16
|
@labels = labels.clone
|
17
17
|
@labels["rookout_debug"] = "on" if Config.debug
|
18
18
|
|
19
|
+
k8_namespace = create_cluster_namespace k8s_file_path
|
20
|
+
unless k8_namespace == ""
|
21
|
+
@labels["k8s_namespace"] = k8_namespace
|
22
|
+
end
|
23
|
+
|
19
24
|
@ip_addr = local_ip
|
20
25
|
|
21
26
|
@scm_info = create_scm_information
|
@@ -49,7 +54,7 @@ module Rookout
|
|
49
54
|
scm: @scm_info
|
50
55
|
end
|
51
56
|
|
52
|
-
attr_accessor :agent_id
|
57
|
+
attr_accessor :agent_id, :labels
|
53
58
|
|
54
59
|
private
|
55
60
|
|
@@ -65,6 +70,18 @@ module Rookout
|
|
65
70
|
end
|
66
71
|
# rubocop:enable Style/ParallelAssignment
|
67
72
|
|
73
|
+
def create_cluster_namespace k8s_file_path
|
74
|
+
return_value = ""
|
75
|
+
|
76
|
+
# No Kubernetes is valid
|
77
|
+
if File.file? k8s_file_path
|
78
|
+
# Read the file contents and return it as result
|
79
|
+
return_value = File.read k8s_file_path
|
80
|
+
end
|
81
|
+
|
82
|
+
return_value
|
83
|
+
end
|
84
|
+
|
68
85
|
def create_scm_information
|
69
86
|
user_git_origin = Config.user_git_origin || ENV["ROOKOUT_REMOTE_ORIGIN"]
|
70
87
|
user_git_commit = Config.user_git_commit || ENV["ROOKOUT_COMMIT"]
|
@@ -49,6 +49,10 @@ module Rookout
|
|
49
49
|
Logger.instance.remove_output self
|
50
50
|
end
|
51
51
|
|
52
|
+
def user_messages_queue_full?
|
53
|
+
@user_message_bucket.exhausted? || (!@agent_com.nil? && @agent_com.queue_full?)
|
54
|
+
end
|
55
|
+
|
52
56
|
def send_warning rule_id, error
|
53
57
|
send_rule_status rule_id, :Warning, error
|
54
58
|
end
|
data/lib/rookout/commit.rb
CHANGED
data/lib/rookout/exceptions.rb
CHANGED
@@ -201,5 +201,23 @@ module Rookout
|
|
201
201
|
super "Bad protobuf platform: #{platform}"
|
202
202
|
end
|
203
203
|
end
|
204
|
+
|
205
|
+
class RookObjectNameMissing < ToolException
|
206
|
+
def initialize configuration
|
207
|
+
super "Failed to find object name",
|
208
|
+
{
|
209
|
+
"configuration" => configuration
|
210
|
+
}
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
class RookUnsupportedLocation < ToolException
|
215
|
+
def initialize location
|
216
|
+
super "Unsupported aug location was specified: #{location}",
|
217
|
+
{
|
218
|
+
"location" => location
|
219
|
+
}
|
220
|
+
end
|
221
|
+
end
|
204
222
|
end
|
205
223
|
end
|
@@ -35,9 +35,9 @@ module Rookout
|
|
35
35
|
dump_string obj, variant, config
|
36
36
|
elsif obj.is_a? Time
|
37
37
|
dump_time obj, variant
|
38
|
-
elsif obj.
|
38
|
+
elsif obj.class == Array
|
39
39
|
dump_array obj, variant, current_depth, config, log_object_errors
|
40
|
-
elsif obj.
|
40
|
+
elsif obj.class == Hash
|
41
41
|
dump_hash obj, variant, current_depth, config, log_object_errors
|
42
42
|
elsif obj.is_a? Exception
|
43
43
|
dump_exception obj, variant, current_depth, config, log_object_errors
|
data/lib/rookout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rookout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liran Haimovitch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
name: google-style
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.24.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.24.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -253,7 +253,7 @@ licenses:
|
|
253
253
|
- Proprietary
|
254
254
|
metadata:
|
255
255
|
homepage_uri: https://rookout.com
|
256
|
-
post_install_message:
|
256
|
+
post_install_message:
|
257
257
|
rdoc_options: []
|
258
258
|
require_paths:
|
259
259
|
- lib
|
@@ -268,8 +268,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
- !ruby/object:Gem::Version
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
|
-
rubygems_version: 3.1.
|
272
|
-
signing_key:
|
271
|
+
rubygems_version: 3.1.6
|
272
|
+
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: rookout is the Ruby SDK for the Rookout Debugging Platform
|
275
275
|
test_files: []
|