opentelemetry-instrumentation-mongo 0.13.0 → 0.18.0

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: cc8fa3af30c56a8d55adebb114179c0166483c6ab0c2469c1fab882a2624d83d
4
- data.tar.gz: 3b1610691cd4e20ad26cc68915eb07f90f80cd25f86ba5ebebc956e49c5fb7fa
3
+ metadata.gz: fed739b4bc4c6475309644c78af588c0fc2be755c98d9fb6ecd686538a347e22
4
+ data.tar.gz: efaaa9ab0b0f3cd40afa45fa04534065092dbc243e9fb55708b7fdd46c3a5974
5
5
  SHA512:
6
- metadata.gz: 5c32c3fd8bf28a131dd670ec7c1769c530fcae6a82ba7a6e1e0f7d1afeb2a3f6e4f2ac6ddff61a59b966df52c4af4acb3bade6b73ac92d2307a7f7dc093b3d80
7
- data.tar.gz: 6eb0d2ef6c789c8dc7435979fd8d345be83aadcce1e98d636da1e5b059e3113e3b87ef93164ea7951616e415cdc014cc621f937fa8679e4c70474f8b70516ac5
6
+ metadata.gz: dc0fa3101397845df031962ba262071249f423abc925f9ec5f6cd9ae794403c6b526c31c0ce088732de1130772355204256e665d661a30731d33d7236794470a
7
+ data.tar.gz: e4ae4d8668fe70ee4dd427178b847efd90a49fc96b7987fb3ae8a55131d28701d061a7cfc83a1c98908942cb358ea465065e0fa868b1fb0802516e54f6dcbc0a
data/CHANGELOG.md CHANGED
@@ -1,8 +1,37 @@
1
1
  # Release History: opentelemetry-instrumentation-mongo
2
2
 
3
+ ### v0.18.0 / 2021-05-21
4
+
5
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
6
+
7
+ * ADDED: Updated API depedency for 1.0.0.rc1
8
+ * FIXED: Replace Time.now with Process.clock_gettime
9
+ * FIXED: Mongodb test asserting error message
10
+
11
+ ### v0.17.0 / 2021-04-22
12
+
13
+ * ADDED: Mongo instrumentation accepts peer service config attribute.
14
+ * FIXED: Fix Mongo instrumentation example.
15
+ * FIXED: Refactor propagators to add #fields
16
+
17
+ ### v0.16.0 / 2021-03-17
18
+
19
+ * FIXED: Example scripts now reference local common lib
20
+ * DOCS: Replace Gitter with GitHub Discussions
21
+
22
+ ### v0.15.0 / 2021-02-18
23
+
24
+ * (No significant changes)
25
+
26
+ ### v0.14.0 / 2021-02-03
27
+
28
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
29
+
30
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
31
+
3
32
  ### v0.13.0 / 2021-01-29
4
33
 
5
- * FIXED: Mongo Instrumenter: Do not send nil attributes
34
+ * FIXED: Mongo Instrumenter: Do not send nil attributes
6
35
 
7
36
  ### v0.12.0 / 2020-12-24
8
37
 
@@ -10,7 +39,7 @@
10
39
 
11
40
  ### v0.11.0 / 2020-12-11
12
41
 
13
- * FIXED: Copyright comments to not reference year
42
+ * FIXED: Copyright comments to not reference year
14
43
 
15
44
  ### v0.10.0 / 2020-12-03
16
45
 
@@ -18,4 +47,4 @@
18
47
 
19
48
  ### v0.9.0 / 2020-11-03
20
49
 
21
- * Initial release of Mongo instrumenter (ported from Datadog)
50
+ * Initial release of Mongo instrumenter (ported from Datadog)
data/README.md CHANGED
@@ -30,15 +30,25 @@ OpenTelemetry::SDK.configure do |c|
30
30
  end
31
31
  ```
32
32
 
33
- ## Examples
33
+ ## Example
34
34
 
35
- Example usage of mongo can be seen in the `./example/mongo.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/mongo/example/mongo.rb)
35
+ To run the example:
36
+
37
+ 1. Start MongoDB using docker-compose
38
+ * `docker-compose up mongo`
39
+ 2. In a separate terminal window, `cd` to the examples directory and install gems
40
+ * `cd example`
41
+ * `bundle install`
42
+ 3. Run the sample client script
43
+ * `ruby mongo.rb`
44
+
45
+ This will run a few MongoDB commands, printing OpenTelemetry traces to the console as it goes.
36
46
 
37
47
  ## How can I get involved?
38
48
 
39
49
  The `opentelemetry-instrumentation-mongo` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
40
50
 
41
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our [gitter channel][ruby-gitter] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
51
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us in [GitHub Discussions][discussions-url] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
42
52
 
43
53
  ## License
44
54
 
@@ -50,4 +60,5 @@ Apache 2.0 license. See [LICENSE][license-github] for more information.
50
60
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
51
61
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
52
62
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
53
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
63
+ [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
64
+
@@ -5,6 +5,7 @@
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  require 'opentelemetry'
8
+ require 'opentelemetry-instrumentation-base'
8
9
 
9
10
  module OpenTelemetry
10
11
  module Instrumentation
@@ -24,6 +24,8 @@ module OpenTelemetry
24
24
  gem_version >= MINIMUM_VERSION
25
25
  end
26
26
 
27
+ option :peer_service, default: nil, validate: :string
28
+
27
29
  private
28
30
 
29
31
  def gem_version
@@ -64,14 +64,18 @@ module OpenTelemetry
64
64
  end
65
65
 
66
66
  def build_attributes(event)
67
- {
67
+ attrs = {
68
68
  'db.system' => 'mongodb',
69
69
  'db.name' => event.database_name,
70
70
  'db.operation' => event.command_name,
71
71
  'db.statement' => CommandSerializer.new(event.command).serialize,
72
72
  'net.peer.name' => event.address.host,
73
73
  'net.peer.port' => event.address.port
74
- }.compact
74
+ }
75
+ config = Mongo::Instrumentation.instance.config
76
+ attrs['peer.service'] = config[:peer_service] if config[:peer_service]
77
+ attrs.compact!
78
+ attrs
75
79
  end
76
80
 
77
81
  def get_collection(command)
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Mongo
10
- VERSION = '0.13.0'
10
+ VERSION = '0.18.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-30 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.13.0
19
+ version: 1.0.0.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.13.0
26
+ version: 1.0.0.rc1
27
+ - !ruby/object:Gem::Dependency
28
+ name: opentelemetry-instrumentation-base
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.18.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.18.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: appraisal
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +100,14 @@ dependencies:
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '0.0'
103
+ version: 1.0.0.rc1
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '0.0'
110
+ version: 1.0.0.rc1
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rspec-mocks
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -200,10 +214,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
200
214
  licenses:
201
215
  - Apache-2.0
202
216
  metadata:
203
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mongo/v0.13.0/file.CHANGELOG.html
217
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mongo/v0.18.0/file.CHANGELOG.html
204
218
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/mongo
205
219
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
206
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mongo/v0.13.0
220
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mongo/v0.18.0
207
221
  post_install_message:
208
222
  rdoc_options: []
209
223
  require_paths:
@@ -219,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
233
  - !ruby/object:Gem::Version
220
234
  version: '0'
221
235
  requirements: []
222
- rubygems_version: 3.1.4
236
+ rubygems_version: 3.1.6
223
237
  signing_key:
224
238
  specification_version: 4
225
239
  summary: Mongo instrumentation for the OpenTelemetry framework