rookout 0.1.35 → 0.1.36

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd31c0f01c107b7021219e64446be074d1a8094109409898083a180391b23d46
4
- data.tar.gz: 7d8aa024f5578c422d5e2cc339b6f28b29a52b26ac1aa5bfdaf2e18c8582246f
3
+ metadata.gz: 40c3d2b4b3e7cf49a817115416ff9ac23fb2078c036744f31cbba5a187dd933f
4
+ data.tar.gz: fc57b64eb454574b754dcbfc6ea4f0fdc7579794f073f4290f4a11b336f76c10
5
5
  SHA512:
6
- metadata.gz: 1523b333105dddf6bed502509ce9f772156040f2aa6cc80cd2ab759547470a1aca42d379d653cb23dcedd5182b54b4ec11db947c6050f464605fc9c6e6c92ffb
7
- data.tar.gz: 0a764fb7ada3a92345c0effe38115d129db972c6fe7b1eda6c2da3157aa528f0abcec2219c0038d55a3e6c77624dcbcbab5fba2bca5005f22ba1d26140925ac3
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 = "3d8b5f2d4b28b5d191fa303cf7a6f5f0da50405b".freeze
2
+ COMMIT = "2c51b13711b7b94b1a58728d299d8981dc76e18f".freeze
3
3
  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.35".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.35
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-15 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