rookout 0.1.33 → 0.1.36

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44bfee39e23252d8f32aec49169aef41a7a5bc75aa1b297546d41a8c4c1043ce
4
- data.tar.gz: 6d4208c55a9e45c96a2a59e2d3bbf50ecd468f2a18f7d4b832fe60888e53e36b
3
+ metadata.gz: 40c3d2b4b3e7cf49a817115416ff9ac23fb2078c036744f31cbba5a187dd933f
4
+ data.tar.gz: fc57b64eb454574b754dcbfc6ea4f0fdc7579794f073f4290f4a11b336f76c10
5
5
  SHA512:
6
- metadata.gz: d0fcb676742f9dab45aaabe1da3db6d20e8bc17892b6b63917db99fe8c6563d44cff49f58c8fe0c650a05a4b67eaeb7b346a979987b1bb4001c2ca9a76651544
7
- data.tar.gz: 0ee2ab75597be3d32d37bb8eec698a0ecb196cc0c3eeaf14e7fe868b9c4a807b6db25ecc5c34f9c8adb6f2dc2aae1e0870d8d9042431a5dfa7bec8a42391ee54
6
+ metadata.gz: cfb0aca8f7fb82ccb39adb8c8f03f5b5242c22bb43dc23bf68f80b18d300e06e11eec8a4885edc3d8eddba58d792db254bbcb6070c030ca2d9f675557ad8a98d
7
+ data.tar.gz: fdc04d582ee9a9bc76a7b9e12ffeaa0a04be2e70a6fdfd7a3841d65ae9a088d947f97df3aaf9f65e1cdd26e0f3a4ef111ea992417eb50581dcbddc682c5716bc
@@ -68,6 +68,7 @@ module Rookout
68
68
  end
69
69
 
70
70
  @pending_messages.push envelope_wrapper
71
+ @pending_messages_length += msg_size
71
72
  end
72
73
 
73
74
  def queue_full?
@@ -28,17 +28,17 @@ class Variant2EnvelopeWrapper < EnvelopeWrapperBase
28
28
  report_id: report_id
29
29
  @serializer = Rookout::Processor::NamespaceSerializer2.new
30
30
  @aug_report_message.arguments2 = @serializer.dump arguments
31
- end
32
-
33
- def envelope
34
- return @envelope unless @envelope.nil?
35
31
  @serializer.string_cache.each { |key, value| @aug_report_message.strings_cache[key] = value }
36
32
  @envelope = wrap_in_envelope @aug_report_message
37
33
  @aug_report_message = nil
38
34
  end
39
35
 
36
+ def envelope
37
+ @envelope
38
+ end
39
+
40
40
  def calculate_size
41
- @envelope.length + @serializer.estimated_pending_bytes
41
+ @envelope.length
42
42
  end
43
43
  end
44
44
 
@@ -21,6 +21,8 @@ module Rookout
21
21
  @labels["k8s_namespace"] = k8_namespace
22
22
  end
23
23
 
24
+ collect_serverless_labels
25
+
24
26
  @ip_addr = local_ip
25
27
 
26
28
  @scm_info = create_scm_information
@@ -97,6 +99,47 @@ module Rookout
97
99
 
98
100
  Com::Rookout::SCMInformation.new origin: user_git_origin, commit: user_git_commit
99
101
  end
102
+
103
+ def aws_lambda?
104
+ !ENV["AWS_LAMBDA_FUNCTION_NAME"].nil?
105
+ end
106
+
107
+ def google_cloud_function?
108
+ !ENV["FUNCTION_TARGET"].nil? && !ENV["FUNCTION_SIGNATURE_TYPE"].nil?
109
+ end
110
+
111
+ def cloud_run_or_fire_base?
112
+ !ENV["K_SERVICE"].nil? &&
113
+ !ENV["K_REVISION"].nil? &&
114
+ !ENV["K_CONFIGURATION"].nil? &&
115
+ !ENV["PORT"].nil?
116
+ end
117
+
118
+ def azure_function?
119
+ !ENV["FUNCTIONS_WORKER_RUNTIME"].nil? && !ENV["WEBSITE_SITE_NAME"].nil?
120
+ end
121
+
122
+ def collect_serverless_labels
123
+ if aws_lambda?
124
+ @labels["function_name"] = ENV["AWS_LAMBDA_FUNCTION_NAME"]
125
+ @labels["aws_region"] = ENV["AWS_REGION"]
126
+
127
+ elsif google_cloud_function? || cloud_run_or_fire_base?
128
+ function_name = ENV["FUNCTION_NAME"]
129
+ if function_name.nil?
130
+ function_name = ENV["K_SERVICE"]
131
+ end
132
+ @labels["function_name"] = function_name
133
+
134
+ elsif azure_function?
135
+ @labels["function_name"] = ENV["WEBSITE_SITE_NAME"]
136
+ @labels["azure_region"] = ENV["REGION_NAME"]
137
+ end
138
+
139
+ return unless @labels.key? "function_name"
140
+
141
+ @labels["rookout_serverless"] = "true"
142
+ end
100
143
  end
101
144
  end
102
145
  end
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- COMMIT = "e26a0d04bfa2d0e1bd62c7b84cba85f353c98760".freeze
2
+ COMMIT = "2c51b13711b7b94b1a58728d299d8981dc76e18f".freeze
3
3
  end
@@ -64,10 +64,10 @@ module Rookout
64
64
  def update_config configuration
65
65
  is_config_proto2 = configuration["RUBY_PROTOBUF_VERSION_2"]
66
66
  return if is_config_proto2.nil?
67
- is_env_proto2 = ENV[env_var_name]
67
+ is_env_proto2 = ENV["PROTOBUF_VERSION_2"]
68
68
  if is_env_proto2.nil?
69
- @protobuf_version2 = true if @true_values.includes? is_config_proto2
70
- elsif @true_values.includes? is_env_proto2
69
+ @protobuf_version2 = true if @true_values.include? is_config_proto2
70
+ elsif @true_values.include? is_env_proto2
71
71
  @protobuf_version2 = true
72
72
  end
73
73
  end
@@ -40,7 +40,7 @@ module Rookout
40
40
  @services_started = false
41
41
  end
42
42
 
43
- def connect token: nil, host: nil, port: nil, proxy: nil, labels: [], async_start: false, fork: false,
43
+ def connect token: nil, host: nil, port: nil, proxy: nil, labels: {}, async_start: false, fork: false,
44
44
  throw_errors: false
45
45
  raise Exceptions::RookInterfaceException, "Multiple connection attempts not supported!" unless @agent_com.nil?
46
46
 
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.33".freeze
2
+ VERSION = "0.1.36".freeze
3
3
  end
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.33
4
+ version: 0.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liran Haimovitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller