istox 0.1.157.10 → 0.1.157.11.2

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: a5af3e2ac5a41df94c44bcd69906e0f899d65dce0e8ace04047e5608e7fff7a5
4
- data.tar.gz: d3bbc3ca010630857d1e34452b9077bf1756ffb89568166c3137791494928e8f
3
+ metadata.gz: 54ed9bcff5c0cf4fac36db3d932688509800043f0841bb38f60495c923039912
4
+ data.tar.gz: 4a7375a044969a37152bb06e20725dd82ad841e523913a08dc23822c27a64ba2
5
5
  SHA512:
6
- metadata.gz: 8cf2995a32fc10c9bd282f4fe216ad0e3f4f7632d21d581493e103bc73287584390c12061ecbb3ad104124aa2b7330e880fc182ab2e9f6cabec2345250386b58
7
- data.tar.gz: 8b924b2988c1b63884aac20f7853edb28d188461d9e942d0d776abd1c5c76c624de5667ad42addeed8e467d54dc1fdc2cf6b782195cc4651f802ae3faa2f67cc
6
+ metadata.gz: 9c2b012d97b4d5e29ea5516acb70645cf69a998d761cb11dcb15f9f93dcc751ced67f23bf9d9ac8064ee544559488023d83e4f534c3de9c2cc4612939fd4806d
7
+ data.tar.gz: c87a1c4b5a5ed11f7cf1fe3fda3871ff69a09286b79b2523fade5bed4be87ef8d3c332eb2c87cbffad97f2caef727dda94260dc68e6654b2135651f6b020726e
@@ -14,7 +14,7 @@ module Istox
14
14
 
15
15
  message = JSON.generate(message) unless message.is_a? String
16
16
 
17
- sns_client.publish({ topic_arn: topic_arn || ENV.fetch('PUSHER_TOPIC_ARN', ''), message: message })
17
+ sns_client.publish(topic_arn: topic_arn || ENV.fetch('SNS_CLIENT_TOPIC', ''), message: message)
18
18
 
19
19
  log.info('Publish to SNS successfully.')
20
20
  rescue StandardError => e
@@ -28,8 +28,15 @@ module Istox
28
28
  def sns_client
29
29
  return @sns_client if @sns_client.present?
30
30
 
31
- Aws.config.update({ region: ENV.fetch('AWS_REGION', 'ap-southeast-1'),
32
- credentials: Aws::Credentials.new(ENV.fetch('AWS_STS_ACCESS_KEY_ID'), ENV.fetch('AWS_STS_SECRET_ACCESS_KEY')) })
31
+ access_key = ENV.fetch('AWS_STS_ACCESS_KEY_ID', nil)
32
+
33
+ if access_key.present?
34
+ credentials = Aws::Credentials.new(ENV.fetch('AWS_STS_ACCESS_KEY_ID', nil), ENV.fetch('AWS_STS_SECRET_ACCESS_KEY', nil))
35
+ Aws.config.update(region: ENV.fetch('AWS_REGION', 'ap-southeast-1'),
36
+ credentials: credentials)
37
+ else
38
+ Aws.config.update(region: ENV.fetch('AWS_REGION', 'ap-southeast-1'))
39
+ end
33
40
 
34
41
  @sns_client = Aws::SNS::Client.new(region: ENV.fetch('AWS_REGION', 'ap-southeast-1'))
35
42
  end
@@ -22,6 +22,7 @@ module Istox
22
22
 
23
23
  request_context.metadata[:xray_trace_id] = XRay.recorder.current_segment.trace_id
24
24
  request_context.metadata[:xray_parent_id] = XRay.recorder.current_segment.id
25
+ Thread.current[:tracer_id] = XRay.recorder.current_segment.trace_id
25
26
 
26
27
  result = yield
27
28
 
@@ -7,6 +7,7 @@ module Istox
7
7
  meta = request.active_call.metadata
8
8
  trace_id = (meta['xray_trace_id'] if meta.present? && meta.key?('xray_trace_id'))
9
9
  parent_id = (meta['xray_parent_id'] if meta.present? && meta.key?('xray_parent_id'))
10
+ Thread.current[:tracer_id] = trace_id
10
11
 
11
12
  XRay.recorder.begin_segment("#{::Istox::Xray::XrayInitializer.service_name}.grpc.#{request.method_key}",
12
13
  trace_id: trace_id, parent_id: parent_id)
@@ -8,6 +8,7 @@ module Istox
8
8
 
9
9
  trace_id = (payload_hash[:xray_trace_id] if payload_hash.key?(:xray_trace_id))
10
10
  parent_id = (payload_hash[:xray_parent_id] if payload_hash.key?(:xray_parent_id))
11
+ Thread.current[:tracer_id] = trace_id
11
12
 
12
13
  arr = [delivery_info[:exchange]&.downcase, delivery_info[:routing_key]&.downcase, payload_hash[:type]&.downcase].compact
13
14
 
@@ -22,6 +22,7 @@ module Istox
22
22
 
23
23
  message[:xray_trace_id] = XRay.recorder.current_segment.trace_id
24
24
  message[:xray_parent_id] = XRay.recorder.current_segment.id
25
+ Thread.current[:tracer_id] = XRay.recorder.current_segment.trace_id
25
26
 
26
27
  XRay.recorder.end_subsegment
27
28
 
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.157.10'.freeze
2
+ VERSION = '0.1.157.11.2'.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.157.10
4
+ version: 0.1.157.11.2
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-10-28 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -480,14 +480,6 @@ extensions: []
480
480
  extra_rdoc_files: []
481
481
  files:
482
482
  - ".gitignore"
483
- - ".idea/.rakeTasks"
484
- - ".idea/encodings.xml"
485
- - ".idea/inspectionProfiles/Project_Default.xml"
486
- - ".idea/istox-gem.iml"
487
- - ".idea/misc.xml"
488
- - ".idea/modules.xml"
489
- - ".idea/vcs.xml"
490
- - ".idea/workspace.xml"
491
483
  - ".rubocop.yml"
492
484
  - ".solargraph.yml"
493
485
  - CODE_OF_CONDUCT.md
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Settings><!--This file was automatically generated by Ruby plugin.
3
- You are allowed to:
4
- 1. Remove rake task
5
- 2. Add existing rake tasks
6
- To add existing rake tasks automatically delete this file and reload the project.
7
- --><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding" addBOMForNewFiles="with NO BOM" />
4
- </project>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Rubocop" enabled="false" level="WARNING" enabled_by_default="false" />
5
- </profile>
6
- </component>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$" />
8
- <orderEntry type="inheritedJdk" />
9
- <orderEntry type="sourceFolder" forTests="false" />
10
- <orderEntry type="library" scope="PROVIDED" name="bundler (v1.16.6, RVM: ruby-2.5.3 [global]) [gem]" level="application" />
11
- </component>
12
- </module>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptSettings">
4
- <option name="languageLevel" value="ES6" />
5
- </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.5.3 [global]" project-jdk-type="RUBY_SDK" />
7
- </project>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/istox-gem.iml" filepath="$PROJECT_DIR$/.idea/istox-gem.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>