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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd919364755be5176b14065ad63391a3c174bbc89f4237f9ada6cebdf58708c8
|
4
|
+
data.tar.gz: e881a287f27ff64fa4f11964e8c64ecb400806d6b561d88121b774013d43fa9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ddd454b05a2b5cb7328e71b2abb3a900c8c743b6cbae1ac2ba0f427635bb647e2bef205296f6019d0e3259f613d656a15f5e726fd4c3e347ade9c6640b4c44f
|
7
|
+
data.tar.gz: bbf9d987a30edd479213ce41aa732848b5df4c5ab50d6213d006fa2e0d5f797163cf67f076ef56631b67a29239afeb651f511d9dbb36557db7cfda1d812aa827
|
data/GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.12
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
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
|
-
@
|
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 :
|
49
|
+
attr_reader :operation_name_builder
|
53
50
|
attr_reader :sanitazer
|
54
51
|
|
55
52
|
def build_operation_name(event)
|
56
|
-
|
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)
|