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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de3a514a1be536304d24a596ac394a1f145fa0a1a95a3d1de38b3628557c1202
4
- data.tar.gz: '0943b18ab8dbb3fe00f0192c0acfe30d9f9a677b30b2f06e23c594695f8ddec3'
3
+ metadata.gz: 9b4096f33ed019f3f95ab724e4f4ed7a51e21d6a2f6b07976e0cfa948b72227f
4
+ data.tar.gz: 1020dbcabba37f7ebc9e0de15483a6eacf6d13431c770575a4c57d16703ed991
5
5
  SHA512:
6
- metadata.gz: b50d89dbeefbf57af9e188d8e90e86ef35af182afaea97786f756abd2bb1470998ed2c3818fa70868224e692e96441d140ada7eafced1d70bbdb176dd473d9b5
7
- data.tar.gz: 14c4aa870fb121d4634d52214c6ab4433f25222097fea7c4b552e8e5fb3b1355acbfeec1a7df469be2e3a27d69a205f326e172f44c9359e63bc9cea38167dad8
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
- Rails.application.config.xray = {
19
- # default segment name generated by XRay middleware
20
- daemon_address: ENV['AWS_XRAY_DAEMON_ADDRESS'],
21
- name: service_name,
22
- patch: %I[net_http aws_sdk],
23
- # record db transactions as subsegments
24
- active_record: true,
25
- context_missing: 'LOG_ERROR'
26
- }
27
-
28
- @service_name = service_name
29
-
30
- if gruf_config.present?
31
- gruf_config.interceptors.use(::Istox::Xray::GrpcServerXrayInterceptor)
32
- ::Istox::GrpcClient.add_interceptors(::Istox::Xray::GrpcClientXrayInterceptor.new)
33
- end
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
- return unless enable_rabbitmq_trace == true
37
+ return unless enable_rabbitmq_trace == true
36
38
 
37
- ::Istox::BunnyBoot.add_publisher_interceptor(::Istox::Xray::RabbitmqPublisherInterceptor.new)
38
- ::Istox::BunnyBoot.add_consumer_interceptor(::Istox::Xray::RabbitmqConsumerInterceptor.new)
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
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.153.2'.freeze
2
+ VERSION = '0.1.153.3'.freeze
3
3
  end
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.2
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-22 00:00:00.000000000 Z
11
+ date: 2020-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print