ddtrace 0.21.1 → 0.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +4 -4
- data/CHANGELOG.md +14 -3
- data/docker-compose.yml +6 -18
- data/docs/GettingStarted.md +1 -1
- data/lib/ddtrace/contrib/mongodb/instrumentation.rb +41 -50
- data/lib/ddtrace/contrib/mongodb/patcher.rb +2 -1
- data/lib/ddtrace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61acb994baa0c01a709084beac147a5c6052e92d
|
4
|
+
data.tar.gz: bd4846e16ff33ddd1e6b8a88b080ed79c0958190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a55674e8f2d82acd24ee34458af85d3555948854439cb84ab85d3f4c496235e28d14809aa10925fecc9af91e484d7b996f6d6de684351c22d4ef4f1be2e3ed5d
|
7
|
+
data.tar.gz: 90a143ebed788d5c90902866d126a40d2f5ba8f640eb98b66a2efa79e1eee1571c974d62aefd38192024c7836324de972a89b0bf90136125ef0e8c0ab6f6e358
|
data/Appraisals
CHANGED
@@ -401,10 +401,10 @@ elsif Gem::Version.new('2.2.0') <= Gem::Version.new(RUBY_VERSION) \
|
|
401
401
|
gem 'elasticsearch-transport'
|
402
402
|
gem 'excon'
|
403
403
|
gem 'grape'
|
404
|
-
gem 'graphql'
|
404
|
+
gem 'graphql', '< 1.9.4'
|
405
405
|
gem 'grpc'
|
406
406
|
gem 'hiredis'
|
407
|
-
gem 'mongo', '
|
407
|
+
gem 'mongo', '>= 2.8.0'
|
408
408
|
gem 'mysql2', '< 0.5', platform: :ruby
|
409
409
|
gem 'racecar', '>= 0.3.5'
|
410
410
|
gem 'rack'
|
@@ -543,7 +543,7 @@ elsif Gem::Version.new('2.3.0') <= Gem::Version.new(RUBY_VERSION) \
|
|
543
543
|
gem 'graphql'
|
544
544
|
gem 'grpc'
|
545
545
|
gem 'hiredis'
|
546
|
-
gem 'mongo', '
|
546
|
+
gem 'mongo', '>= 2.8.0'
|
547
547
|
gem 'mysql2', '< 0.5', platform: :ruby
|
548
548
|
gem 'racecar', '>= 0.3.5'
|
549
549
|
gem 'rack'
|
@@ -576,7 +576,7 @@ elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION)
|
|
576
576
|
gem 'graphql'
|
577
577
|
gem 'grpc'
|
578
578
|
gem 'hiredis'
|
579
|
-
gem 'mongo', '
|
579
|
+
gem 'mongo', '>= 2.8.0'
|
580
580
|
gem 'mysql2', '< 0.5', platform: :ruby
|
581
581
|
gem 'racecar', '>= 0.3.5'
|
582
582
|
gem 'rack'
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,16 @@
|
|
4
4
|
|
5
5
|
## [Unreleased (beta)]
|
6
6
|
|
7
|
+
## [0.21.2] - 2019-04-10
|
8
|
+
|
9
|
+
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.21.2
|
10
|
+
|
11
|
+
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.21.1...v0.21.2
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
|
15
|
+
- Support Mongo gem 2.5+ (#729, #731) (@ricbartm)
|
16
|
+
|
7
17
|
## [0.21.1] - 2019-03-26
|
8
18
|
|
9
19
|
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.21.1
|
@@ -741,9 +751,10 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
741
751
|
|
742
752
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
743
753
|
|
744
|
-
[Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.21.
|
745
|
-
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.21.
|
746
|
-
[0.21.
|
754
|
+
[Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.21.2...master
|
755
|
+
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.21.2...0.22-dev
|
756
|
+
[0.21.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.21.1...v0.21.2
|
757
|
+
[0.21.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.21.0...v0.21.1
|
747
758
|
[0.21.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.20.0...v0.21.0
|
748
759
|
[0.20.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.19.1...v0.20.0
|
749
760
|
[0.19.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.19.0...v0.19.1
|
data/docker-compose.yml
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
version: '3.2'
|
2
2
|
services:
|
3
3
|
tracer-1.9:
|
4
|
-
|
5
|
-
context: ./.circleci/images/primary
|
6
|
-
dockerfile: Dockerfile-1.9.3
|
4
|
+
image: datadog/docker-library:ddtrace_rb_1_9_3
|
7
5
|
command: /bin/bash
|
8
6
|
depends_on:
|
9
7
|
- ddagent
|
@@ -31,9 +29,7 @@ services:
|
|
31
29
|
- bundle-1.9:/usr/local/bundle
|
32
30
|
- gemfiles-1.9:/app/gemfiles
|
33
31
|
tracer-2.0:
|
34
|
-
|
35
|
-
context: ./.circleci/images/primary
|
36
|
-
dockerfile: Dockerfile-2.0.0
|
32
|
+
image: datadog/docker-library:ddtrace_rb_2_0_0
|
37
33
|
command: /bin/bash
|
38
34
|
depends_on:
|
39
35
|
- ddagent
|
@@ -61,9 +57,7 @@ services:
|
|
61
57
|
- bundle-2.0:/usr/local/bundle
|
62
58
|
- gemfiles-2.0:/app/gemfiles
|
63
59
|
tracer-2.1:
|
64
|
-
|
65
|
-
context: ./.circleci/images/primary
|
66
|
-
dockerfile: Dockerfile-2.1.10
|
60
|
+
image: datadog/docker-library:ddtrace_rb_2_1_10
|
67
61
|
command: /bin/bash
|
68
62
|
depends_on:
|
69
63
|
- ddagent
|
@@ -91,9 +85,7 @@ services:
|
|
91
85
|
- bundle-2.1:/usr/local/bundle
|
92
86
|
- gemfiles-2.1:/app/gemfiles
|
93
87
|
tracer-2.2:
|
94
|
-
|
95
|
-
context: ./.circleci/images/primary
|
96
|
-
dockerfile: Dockerfile-2.2.10
|
88
|
+
image: datadog/docker-library:ddtrace_rb_2_2_10
|
97
89
|
command: /bin/bash
|
98
90
|
depends_on:
|
99
91
|
- ddagent
|
@@ -121,9 +113,7 @@ services:
|
|
121
113
|
- bundle-2.2:/usr/local/bundle
|
122
114
|
- gemfiles-2.2:/app/gemfiles
|
123
115
|
tracer-2.3:
|
124
|
-
|
125
|
-
context: ./.circleci/images/primary
|
126
|
-
dockerfile: Dockerfile-2.3.7
|
116
|
+
image: datadog/docker-library:ddtrace_rb_2_3_7
|
127
117
|
command: /bin/bash
|
128
118
|
depends_on:
|
129
119
|
- ddagent
|
@@ -151,9 +141,7 @@ services:
|
|
151
141
|
- bundle-2.3:/usr/local/bundle
|
152
142
|
- gemfiles-2.3:/app/gemfiles
|
153
143
|
tracer-2.4:
|
154
|
-
|
155
|
-
context: ./.circleci/images/primary
|
156
|
-
dockerfile: Dockerfile-2.4.4
|
144
|
+
image: datadog/docker-library:ddtrace_rb_2_4_4
|
157
145
|
command: /bin/bash
|
158
146
|
depends_on:
|
159
147
|
- ddagent
|
data/docs/GettingStarted.md
CHANGED
@@ -321,7 +321,7 @@ For a list of available integrations, and their configuration options, please re
|
|
321
321
|
| Grape | `grape` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
|
322
322
|
| GraphQL | `graphql` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
|
323
323
|
| gRPC | `grpc` | `>= 1.10` | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
|
324
|
-
| MongoDB | `mongo` | `>= 2.0
|
324
|
+
| MongoDB | `mongo` | `>= 2.0` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
|
325
325
|
| MySQL2 | `mysql2` | `>= 0.3.21` | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
|
326
326
|
| Net/HTTP | `http` | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
|
327
327
|
| Racecar | `racecar` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
|
@@ -8,67 +8,58 @@ require 'ddtrace/contrib/mongodb/subscribers'
|
|
8
8
|
module Datadog
|
9
9
|
module Contrib
|
10
10
|
module MongoDB
|
11
|
-
# Instrumentation for Mongo
|
11
|
+
# Instrumentation for Mongo integration
|
12
12
|
module Instrumentation
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
include InstanceMethodsCompatibility
|
18
|
-
include InstanceMethods
|
19
|
-
end
|
20
|
-
else
|
21
|
-
base.send(:prepend, InstanceMethods)
|
13
|
+
# Instrumentation for Mongo::Client
|
14
|
+
module Client
|
15
|
+
def self.included(base)
|
16
|
+
base.send(:include, InstanceMethods)
|
22
17
|
end
|
23
|
-
end
|
24
18
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
# Instance methods for Mongo::Client
|
20
|
+
module InstanceMethods
|
21
|
+
def datadog_pin
|
22
|
+
# safe-navigation to avoid crashes during each query
|
23
|
+
return unless respond_to? :cluster
|
24
|
+
return unless cluster.respond_to? :addresses
|
25
|
+
return unless cluster.addresses.respond_to? :first
|
26
|
+
Datadog::Pin.get_from(cluster.addresses.first)
|
31
27
|
end
|
32
|
-
end
|
33
28
|
|
34
|
-
|
35
|
-
|
29
|
+
def datadog_pin=(pin)
|
30
|
+
# safe-navigation to avoid crashes during each query
|
31
|
+
return unless respond_to? :cluster
|
32
|
+
return unless cluster.respond_to? :addresses
|
33
|
+
return unless cluster.addresses.respond_to? :each
|
34
|
+
# attach the PIN to all cluster addresses. One of them is used
|
35
|
+
# when executing a Command and it is attached to the Monitoring
|
36
|
+
# Event instance.
|
37
|
+
cluster.addresses.each { |x| pin.onto(x) }
|
38
|
+
end
|
36
39
|
end
|
37
40
|
end
|
38
41
|
|
39
|
-
#
|
40
|
-
module
|
41
|
-
def
|
42
|
-
|
43
|
-
super(*args, &blk)
|
44
|
-
tracer = Datadog.configuration[:mongo][:tracer]
|
45
|
-
service = Datadog.configuration[:mongo][:service_name]
|
46
|
-
pin = Datadog::Pin.new(
|
47
|
-
service,
|
48
|
-
app: Datadog::Contrib::MongoDB::Ext::APP,
|
49
|
-
app_type: Datadog::Ext::AppTypes::DB,
|
50
|
-
tracer: tracer
|
51
|
-
)
|
52
|
-
pin.onto(self)
|
42
|
+
# Instrumentation for Mongo::Address
|
43
|
+
module Address
|
44
|
+
def self.included(base)
|
45
|
+
base.send(:include, InstanceMethods)
|
53
46
|
end
|
54
47
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
48
|
+
# Instance methods for Mongo::Address
|
49
|
+
module InstanceMethods
|
50
|
+
def datadog_pin
|
51
|
+
@datadog_pin ||= begin
|
52
|
+
tracer = Datadog.configuration[:mongo][:tracer]
|
53
|
+
service = Datadog.configuration[:mongo][:service_name]
|
62
54
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
cluster.addresses.each { |x| pin.onto(x) }
|
55
|
+
Datadog::Pin.new(
|
56
|
+
service,
|
57
|
+
app: Datadog::Contrib::MongoDB::Ext::APP,
|
58
|
+
app_type: Datadog::Ext::AppTypes::DB,
|
59
|
+
tracer: tracer
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
72
63
|
end
|
73
64
|
end
|
74
65
|
end
|
@@ -18,7 +18,8 @@ module Datadog
|
|
18
18
|
def patch
|
19
19
|
do_once(:mongo) do
|
20
20
|
begin
|
21
|
-
::Mongo::
|
21
|
+
::Mongo::Address.send(:include, Instrumentation::Address)
|
22
|
+
::Mongo::Client.send(:include, Instrumentation::Client)
|
22
23
|
add_mongo_monitoring
|
23
24
|
rescue StandardError => e
|
24
25
|
Datadog::Tracer.log.error("Unable to apply MongoDB integration: #{e}")
|
data/lib/ddtrace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddtrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|