opentelemetry-instrumentation-dalli 0.6.0 → 0.11.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: 42889194f8175f062633d899440b58ea0b362b6f4dec479e6dc918441c92001d
4
- data.tar.gz: 2d96d67cf8c442f00d54a90094634fea7b12de1924106d11f75f459f5bb3e078
3
+ metadata.gz: 0c1e6b393e01abad1680a4de749c939d8b5228e1aa76fa9936a95bf5f3e0efa9
4
+ data.tar.gz: 382ec5392b8632542d468279433d35b052f3f98f6d000e9e0679d11bb6b0e565
5
5
  SHA512:
6
- metadata.gz: 6d05f610b5b604de834814b4c164c8ec0b6555eb79bd5e499f96f59dc142cca3b633acdfe2cbfce2832ab938c49e09c163199f0f4d1296fbf0002697e7ddd324
7
- data.tar.gz: ffb428c4ad3a7e6970b43e843a0275ae4bebd6a946adeca6ef735e16fc0f5c12a96fed1e97a3abbffdc8e1574a1fb30bf3d73843cf8c62b40a5dcc13a51412d2
6
+ metadata.gz: cbf8f03e88623049092b6aa331f64fc930bc3053aa3903c7f8b72f2bde63973954f9794f29ad3a06feea741d325cfd82345389c302522e89ff92d9219b6bb433
7
+ data.tar.gz: 931bf3b79f4a4313f58a4ec533fb7f9536218c730947add8dcd059987f3c57ff3d7bc32694b5e9f9af41769d94e449830e1f85ebce64178f74d55378ea4c7309
@@ -0,0 +1,9 @@
1
+ --no-private
2
+ --title=OpenTelemetry Dalli Instrumentation
3
+ --markup=markdown
4
+ --main=README.md
5
+ ./lib/opentelemetry/instrumentation/**/*.rb
6
+ ./lib/opentelemetry/instrumentation.rb
7
+ -
8
+ README.md
9
+ CHANGELOG.md
@@ -1,5 +1,29 @@
1
1
  # Release History: opentelemetry-instrumentation-dalli
2
2
 
3
+ ### v0.11.0 / 2020-12-11
4
+
5
+ * ADDED: Add peer service config to dalli
6
+ * ADDED: Move utf8 encoding to common utils
7
+ * FIXED: Copyright comments to not reference year
8
+
9
+ ### v0.10.0 / 2020-12-03
10
+
11
+ * (No significant changes)
12
+
13
+ ### v0.9.0 / 2020-11-27
14
+
15
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
16
+
17
+ * ADDED: Add timeout for force_flush and shutdown
18
+
19
+ ### v0.8.0 / 2020-10-27
20
+
21
+ * (No significant changes)
22
+
23
+ ### v0.7.0 / 2020-10-07
24
+
25
+ * DOCS: Standardize toplevel docs structure and readme
26
+
3
27
  ### v0.6.0 / 2020-09-10
4
28
 
5
29
  * Initial release.
data/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2020 OpenTelemetry Authors
189
+ Copyright The OpenTelemetry Authors
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -0,0 +1,49 @@
1
+ # OpenTelemetry Dalli Instrumentation
2
+
3
+ The OpenTelemetry Dalli gem is a community maintained instrumentation for the [Dalli][dalli-home] Memcache client.
4
+
5
+ ## How do I get started?
6
+
7
+ Install the gem using:
8
+
9
+ ```
10
+ gem install opentelemetry-instrumentation-dalli
11
+ ```
12
+
13
+ Or, if you use [bundler][bundler-home], include `opentelemetry-instrumentation-dalli` in your `Gemfile`.
14
+
15
+ ## Usage
16
+
17
+ To install the instrumentation, call `use` with the name of the instrumentation.
18
+
19
+ ```ruby
20
+ OpenTelemetry::SDK.configure do |c|
21
+ c.use 'OpenTelemetry::Instrumentation::Dalli'
22
+ end
23
+ ```
24
+
25
+ Alternatively, you can also call `use_all` to install all the available instrumentation.
26
+
27
+ ```ruby
28
+ OpenTelemetry::SDK.configure do |c|
29
+ c.use_all
30
+ end
31
+ ```
32
+
33
+ ## How can I get involved?
34
+
35
+ The `opentelemetry-instrumentation-dalli` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
36
+
37
+ 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].
38
+
39
+ ## License
40
+
41
+ Apache 2.0 license. See [LICENSE][license-github] for more information.
42
+
43
+ [dalli-home]: https://github.com/petergoldstein/dalli
44
+ [bundler-home]: https://bundler.io
45
+ [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
46
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
47
+ [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
48
+ [community-meetings]: https://github.com/open-telemetry/community#community-meetings
49
+ [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,9 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
+ # OpenTelemetry is an open source observability framework, providing a
8
+ # general-purpose API, SDK, and related tools required for the instrumentation
9
+ # of cloud-native software, frameworks, and libraries.
10
+ #
11
+ # The OpenTelemetry module provides global accessors for telemetry objects.
12
+ # See the documentation for the `opentelemetry-api` gem for details.
7
13
  module OpenTelemetry
8
14
  # "Instrumentation" are specified by
9
15
  # https://github.com/open-telemetry/opentelemetry-specification/blob/784635d01d8690c8f5fcd1f55bdbc8a13cf2f4f2/specification/glossary.md#instrumentation-library
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  require 'opentelemetry'
8
+ require 'opentelemetry/common'
8
9
 
9
10
  module OpenTelemetry
10
11
  module Instrumentation
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -18,7 +18,7 @@ module OpenTelemetry
18
18
  'net.peer.name' => hostname,
19
19
  'net.peer.port' => port
20
20
  }
21
-
21
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
22
22
  tracer.in_span(operation, attributes: attributes, kind: :client) do
23
23
  super
24
24
  end
@@ -29,6 +29,10 @@ module OpenTelemetry
29
29
  def tracer
30
30
  Dalli::Instrumentation.instance.tracer
31
31
  end
32
+
33
+ def config
34
+ Dalli::Instrumentation.instance.config
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -47,7 +47,7 @@ module OpenTelemetry
47
47
  def format_command(operation, args)
48
48
  placeholder = "#{operation} BLOB (OMITTED)"
49
49
  command = [operation, *args].join(' ').strip
50
- command = utf8_encode(command, binary: true, placeholder: placeholder)
50
+ command = OpenTelemetry::Common::Utilities.utf8_encode(command, binary: true, placeholder: placeholder)
51
51
  truncate(command, CMD_MAX_LEN)
52
52
  rescue StandardError => e
53
53
  OpenTelemetry.logger.debug("Error sanitizing Dalli operation: #{e}")
@@ -57,24 +57,6 @@ module OpenTelemetry
57
57
  def truncate(string, size)
58
58
  string.size > size ? "#{string[0...size - 3]}..." : string
59
59
  end
60
-
61
- def utf8_encode(str, binary: false, placeholder: STRING_PLACEHOLDER)
62
- str = str.to_s
63
-
64
- if binary
65
- # This option is useful for "gracefully" displaying binary data that
66
- # often contains text such as marshalled objects
67
- str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
68
- elsif str.encoding == ::Encoding::UTF_8
69
- str
70
- else
71
- str.encode(::Encoding::UTF_8)
72
- end
73
- rescue StandardError => e
74
- OpenTelemetry.logger.debug("Error encoding string in UTF-8: #{e}")
75
-
76
- placeholder
77
- end
78
60
  end
79
61
  end
80
62
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Dalli
10
- VERSION = '0.6.0'
10
+ VERSION = '0.11.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-dalli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.11.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-09-11 00:00:00.000000000 Z
11
+ date: 2020-12-11 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.6.0
19
+ version: 0.11.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.6.0
26
+ version: 0.11.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: opentelemetry-common
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.11.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.11.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: appraisal
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -157,8 +171,10 @@ executables: []
157
171
  extensions: []
158
172
  extra_rdoc_files: []
159
173
  files:
174
+ - ".yardopts"
160
175
  - CHANGELOG.md
161
176
  - LICENSE
177
+ - README.md
162
178
  - lib/opentelemetry-instrumentation-dalli.rb
163
179
  - lib/opentelemetry/instrumentation.rb
164
180
  - lib/opentelemetry/instrumentation/dalli.rb
@@ -169,7 +185,11 @@ files:
169
185
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
170
186
  licenses:
171
187
  - Apache-2.0
172
- metadata: {}
188
+ metadata:
189
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-dalli/v0.11.0/file.CHANGELOG.html
190
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/instrumentation/dalli
191
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
192
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-dalli/v0.11.0
173
193
  post_install_message:
174
194
  rdoc_options: []
175
195
  require_paths:
@@ -185,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
205
  - !ruby/object:Gem::Version
186
206
  version: '0'
187
207
  requirements: []
188
- rubygems_version: 3.1.2
208
+ rubygems_version: 3.1.4
189
209
  signing_key:
190
210
  specification_version: 4
191
211
  summary: Dalli instrumentation for the OpenTelemetry framework