opentracing-instrumentation 0.1.11 → 0.1.12

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: 20f3950f2e40465d4758cd48491a59cd3b6bd46371cbd53f4f4b3b2fa6d58ffe
4
- data.tar.gz: d1fce50ac04f282113711fa3dc6658309df23b1f572ecc423bdf64e6b56ff0b6
3
+ metadata.gz: fd919364755be5176b14065ad63391a3c174bbc89f4237f9ada6cebdf58708c8
4
+ data.tar.gz: e881a287f27ff64fa4f11964e8c64ecb400806d6b561d88121b774013d43fa9f
5
5
  SHA512:
6
- metadata.gz: a55c3242806bae23d495ffbe5b90b2f54383214350824a3a059e7d2c0f2eef0960b754c9926ba07c6d5603a4686416404e242c882cd8dfa0cb8671588b14e0f7
7
- data.tar.gz: 0ea4451a818e76213759257778a6ceee3538a08a8b5b2be8cf560eb18cacf6371b124eb8e96edea2b7d889d7b154b0d6a300d8bc36a42ba6ac95ff5255a58717
6
+ metadata.gz: 2ddd454b05a2b5cb7328e71b2abb3a900c8c743b6cbae1ac2ba0f427635bb647e2bef205296f6019d0e3259f613d656a15f5e726fd4c3e347ade9c6640b4c44f
7
+ data.tar.gz: bbf9d987a30edd479213ce41aa732848b5df4c5ab50d6213d006fa2e0d5f797163cf67f076ef56631b67a29239afeb651f511d9dbb36557db7cfda1d812aa827
@@ -1 +1 @@
1
- 0.1.11
1
+ 0.1.12
@@ -18,7 +18,7 @@ GIT
18
18
  PATH
19
19
  remote: .
20
20
  specs:
21
- opentracing-instrumentation (0.1.11)
21
+ opentracing-instrumentation (0.1.12)
22
22
  json
23
23
  opentracing (~> 0.5.0)
24
24
 
@@ -18,6 +18,7 @@ module OpenTracing
18
18
  # @param event [Mongo::Monitoring::Event::CommandStarted]
19
19
  # @return [String] formated command name
20
20
  def build_operation_name(event)
21
+ p '-' * 100
21
22
  format_args = build_format_args(event)
22
23
  format(operation_name_pattern, **format_args)
23
24
  end
@@ -10,19 +10,16 @@ module OpenTracing
10
10
  class TraceSubscriber
11
11
  include Forwardable
12
12
 
13
- DEFAULT_OPERATION_NAME_PATTERN = \
14
- 'mongo(collection=%<database>s.%<collection>s, command=%<command>s)'
15
-
16
13
  def initialize(
17
14
  tracer: OpenTracing.global_tracer,
18
15
  scope_store: {},
19
- operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN,
16
+ operation_name_builder: OperationNameBuilder.new,
20
17
  sanitazer: QuerySanitazer.new
21
18
  )
22
19
  @tracer = tracer
23
20
  @monitor = Monitor.new
24
21
  @scope_store = scope_store
25
- @operation_name_pattern = operation_name_pattern
22
+ @operation_name_builder = operation_name_builder
26
23
  @sanitazer = sanitazer
27
24
  end
28
25
 
@@ -49,18 +46,11 @@ module OpenTracing
49
46
  attr_reader :tracer
50
47
  attr_reader :scope_store
51
48
  attr_reader :monitor
52
- attr_reader :operation_name_pattern
49
+ attr_reader :operation_name_builder
53
50
  attr_reader :sanitazer
54
51
 
55
52
  def build_operation_name(event)
56
- command_name = event.command_name
57
- collection_name = event.command[command_name]
58
- format(
59
- operation_name_pattern,
60
- database: event.database_name,
61
- collection: collection_name,
62
- command: command_name,
63
- )
53
+ operation_name_builder.build_operation_name(event)
64
54
  end
65
55
 
66
56
  def base_tags(event)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentracing-instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fedorenko Dmitrij