istox 0.1.153.2 → 0.1.153.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/istox/helpers/xray/xray_initializer.rb +34 -19
- data/lib/istox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b4096f33ed019f3f95ab724e4f4ed7a51e21d6a2f6b07976e0cfa948b72227f
|
4
|
+
data.tar.gz: 1020dbcabba37f7ebc9e0de15483a6eacf6d13431c770575a4c57d16703ed991
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd0b57ba71ed70e918f6f1197894956eff364eb4c9ab7b0ba347148b34ca708a0766cb33ba52b8afd9901f21b122a4dc0837fd6eac9020090fb3c788b3ec221
|
7
|
+
data.tar.gz: 2d31aef7c75c48e664d6dbffe9044c7e97a8ae59bc51d4841f3f26abeec10f67cbb163169ce209ee1bcc0d0ab316d292e377750f7047bdfb61d1a67491ecf881
|
@@ -15,27 +15,42 @@ module Istox
|
|
15
15
|
## input gruf config to enable gruf/grpc tracing, eg. Gruf.configure do |config|
|
16
16
|
## set enable_rabbitmq_trace to enable rabbitmq tracing
|
17
17
|
def init(service_name, gruf_config: nil, enable_rabbitmq_trace: nil)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
18
|
+
if ENV['AWS_XRAY_ENABLE']&.downcase.to_s == 'true'
|
19
|
+
|
20
|
+
Rails.application.config.xray = {
|
21
|
+
# default segment name generated by XRay middleware
|
22
|
+
daemon_address: ENV['AWS_XRAY_DAEMON_ADDRESS'],
|
23
|
+
name: service_name,
|
24
|
+
patch: %I[net_http aws_sdk],
|
25
|
+
# record db transactions as subsegments
|
26
|
+
active_record: true,
|
27
|
+
context_missing: 'LOG_ERROR'
|
28
|
+
}
|
29
|
+
|
30
|
+
@service_name = service_name
|
31
|
+
|
32
|
+
if gruf_config.present?
|
33
|
+
gruf_config.interceptors.use(::Istox::Xray::GrpcServerXrayInterceptor)
|
34
|
+
::Istox::GrpcClient.add_interceptors(::Istox::Xray::GrpcClientXrayInterceptor.new)
|
35
|
+
end
|
34
36
|
|
35
|
-
|
37
|
+
return unless enable_rabbitmq_trace == true
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
+
::Istox::BunnyBoot.add_publisher_interceptor(::Istox::Xray::RabbitmqPublisherInterceptor.new)
|
40
|
+
::Istox::BunnyBoot.add_consumer_interceptor(::Istox::Xray::RabbitmqConsumerInterceptor.new)
|
41
|
+
|
42
|
+
else
|
43
|
+
Rails.application.config.xray = {
|
44
|
+
name: service_name,
|
45
|
+
context_missing: 'LOG_ERROR'
|
46
|
+
}
|
47
|
+
|
48
|
+
config = {
|
49
|
+
sampling: false,
|
50
|
+
name: service_name
|
51
|
+
}
|
52
|
+
XRay.recorder.configure(config)
|
53
|
+
end
|
39
54
|
end
|
40
55
|
end
|
41
56
|
end
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.153.
|
4
|
+
version: 0.1.153.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|