opentelemetry-instrumentation-mongo 0.12.0 → 0.17.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: 0fc224da259daed05ae7f0df7996991e04eddc0696c28b7875b66e4fbb76493c
4
- data.tar.gz: b1a928ddb8ac1a6c54e196f2ef54852f575f7b3ea6a5d0e3d54a56eeed890f66
3
+ metadata.gz: b30814818cff85acd7f96eb672243a031795bf864b7d5af7198bbfe8601ade57
4
+ data.tar.gz: 99e17a520388944e5d58ecad18c9047eb72e9c36f03994d1cc196513c24a2bd5
5
5
  SHA512:
6
- metadata.gz: 0a36fa2d1d1f1a3750a95cbdcd53d9b4ae205dee7267da978bc2eefa681c44b0738478b19c8e90e6f73dd88fd301923c1ff1a45c802abe49f12c17be1cf8cc88
7
- data.tar.gz: edf2ff9848f3ad1d6ee98776093fa5a5f687098e6517c67f189ae1c7731048d400c52e163a687fb70c3079e4a42f92b72671bae1ca47a2f22825c4315667f4bd
6
+ metadata.gz: 712045008dc942d63f359a2fb7b3841ad7f284bc2739e41743a015af4a87f7ba8f37737a0197d98e9661109dd64f26ef2c55210726ab376c29f3d4687c5987a3
7
+ data.tar.gz: f3427445fbc8bbd10f7a5e923b00d075539ddeb60d8dd6ad2e6a15f708ed05830eed98d6a0eab79a8348637d0f9a3b97cde7df3175b9d9a737d4899f3424f5c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Release History: opentelemetry-instrumentation-mongo
2
2
 
3
+ ### v0.17.0 / 2021-04-22
4
+
5
+ * ADDED: Mongo instrumentation accepts peer service config attribute.
6
+ * FIXED: Fix Mongo instrumentation example.
7
+ * FIXED: Refactor propagators to add #fields
8
+
9
+ ### v0.16.0 / 2021-03-17
10
+
11
+ * FIXED: Example scripts now reference local common lib
12
+ * DOCS: Replace Gitter with GitHub Discussions
13
+
14
+ ### v0.15.0 / 2021-02-18
15
+
16
+ * (No significant changes)
17
+
18
+ ### v0.14.0 / 2021-02-03
19
+
20
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
21
+
22
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
23
+
24
+ ### v0.13.0 / 2021-01-29
25
+
26
+ * FIXED: Mongo Instrumenter: Do not send nil attributes
27
+
3
28
  ### v0.12.0 / 2020-12-24
4
29
 
5
30
  * (No significant changes)
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/master/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
 
@@ -47,7 +57,8 @@ Apache 2.0 license. See [LICENSE][license-github] for more information.
47
57
  [mongo-home]: https://github.com/mongodb/mongo-ruby-driver
48
58
  [bundler-home]: https://bundler.io
49
59
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
50
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
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
@@ -17,9 +17,15 @@ module OpenTelemetry
17
17
  end
18
18
 
19
19
  present do
20
- !defined?(::Mongo::Monitoring::Global).nil? && gem_version >= MINIMUM_VERSION
20
+ !defined?(::Mongo::Monitoring::Global).nil?
21
21
  end
22
22
 
23
+ compatible do
24
+ gem_version >= MINIMUM_VERSION
25
+ end
26
+
27
+ option :peer_service, default: nil, validate: :string
28
+
23
29
  private
24
30
 
25
31
  def gem_version
@@ -64,7 +64,7 @@ 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,
@@ -72,6 +72,10 @@ module OpenTelemetry
72
72
  'net.peer.name' => event.address.host,
73
73
  'net.peer.port' => event.address.port
74
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.12.0'
10
+ VERSION = '0.17.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.12.0
4
+ version: 0.17.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: 2020-12-24 00:00:00.000000000 Z
11
+ date: 2021-04-23 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.12.0
19
+ version: 0.17.0
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.12.0
26
+ version: 0.17.0
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.17.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.17.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: appraisal
29
43
  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.12.0/file.CHANGELOG.html
204
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/instrumentation/mongo
217
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mongo/v0.17.0/file.CHANGELOG.html
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.12.0
220
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mongo/v0.17.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