opentelemetry-instrumentation-redis 0.10.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/lib/opentelemetry-instrumentation-redis.rb +1 -1
- data/lib/opentelemetry/instrumentation.rb +1 -1
- data/lib/opentelemetry/instrumentation/redis.rb +2 -1
- data/lib/opentelemetry/instrumentation/redis/instrumentation.rb +1 -1
- data/lib/opentelemetry/instrumentation/redis/patches/client.rb +10 -4
- data/lib/opentelemetry/instrumentation/redis/utils.rb +2 -21
- data/lib/opentelemetry/instrumentation/redis/version.rb +2 -2
- metadata +21 -7
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7f0a344dc34f6777df024cd84afa6a05979cd21bf055f66ec544e76b83a5117e
         | 
| 4 | 
            +
              data.tar.gz: '06386792485258022142face04832b22fbdeaa76b2d87d88afd8331d99232b9d'
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 785c71ed34c8af3590d99a9b546f7a3a45e7714a3cf4262eeab37537a90a783e7a6e4ff4f80027cedfa356dda80d0d2139a2abf6531d77be7a769adab00cb754
         | 
| 7 | 
            +
              data.tar.gz: '054488c01e124f57e4b00a10f3ea51a4920aeea33f6b9b00a3d378be9910b372b9ad74ea3fca4fcd49f296ce7c2c656c8a1427a139b839f3527df0d793d6920b'
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,27 @@ | |
| 1 1 | 
             
            # Release History: opentelemetry-instrumentation-redis
         | 
| 2 2 |  | 
| 3 | 
            +
            ### v0.14.0 / 2021-02-03
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            * (No significant changes)
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            ### v0.13.0 / 2021-01-29
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            * (No significant changes)
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            ### v0.12.0 / 2020-12-24
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            * (No significant changes)
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            ### v0.11.0 / 2020-12-11
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            * ADDED: Accept config for redis peer service attribute 
         | 
| 18 | 
            +
            * ADDED: Move utf8 encoding to common utils 
         | 
| 19 | 
            +
            * FIXED: Copyright comments to not reference year 
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            ### v0.10.1 / 2020-12-09
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            * FIXED: Semantic conventions db.type -> db.system 
         | 
| 24 | 
            +
             | 
| 3 25 | 
             
            ### v0.10.0 / 2020-12-03
         | 
| 4 26 |  | 
| 5 27 | 
             
            * (No significant changes)
         | 
    
        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  | 
| 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.
         | 
    
        data/README.md
    CHANGED
    
    | @@ -43,7 +43,7 @@ end | |
| 43 43 |  | 
| 44 44 | 
             
            ## Example
         | 
| 45 45 |  | 
| 46 | 
            -
            An example of usage can be seen in [`example/redis.rb`](https://github.com/open-telemetry/opentelemetry-ruby/blob/ | 
| 46 | 
            +
            An example of usage can be seen in [`example/redis.rb`](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/redis/example/redis.rb).
         | 
| 47 47 |  | 
| 48 48 | 
             
            ## How can I get involved?
         | 
| 49 49 |  | 
| @@ -58,7 +58,7 @@ Apache 2.0 license. See [LICENSE][license-github] for more information. | |
| 58 58 | 
             
            [redis-home]: https://redis.io
         | 
| 59 59 | 
             
            [bundler-home]: https://bundler.io
         | 
| 60 60 | 
             
            [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
         | 
| 61 | 
            -
            [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/ | 
| 61 | 
            +
            [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
         | 
| 62 62 | 
             
            [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
         | 
| 63 63 | 
             
            [community-meetings]: https://github.com/open-telemetry/community#community-meetings
         | 
| 64 64 | 
             
            [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
         | 
| @@ -1,10 +1,11 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
            # Copyright  | 
| 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  | 
| 3 | 
            +
            # Copyright The OpenTelemetry Authors
         | 
| 4 4 | 
             
            #
         | 
| 5 5 | 
             
            # SPDX-License-Identifier: Apache-2.0
         | 
| 6 6 |  | 
| @@ -48,18 +48,24 @@ module OpenTelemetry | |
| 48 48 | 
             
                        host = options[:host]
         | 
| 49 49 | 
             
                        port = options[:port]
         | 
| 50 50 |  | 
| 51 | 
            -
                         | 
| 52 | 
            -
                          'db. | 
| 51 | 
            +
                        attributes = {
         | 
| 52 | 
            +
                          'db.system' => 'redis',
         | 
| 53 53 | 
             
                          'db.instance' => options[:db].to_s,
         | 
| 54 54 | 
             
                          'db.url' => "redis://#{host}:#{port}",
         | 
| 55 55 | 
             
                          'net.peer.name' => host,
         | 
| 56 56 | 
             
                          'net.peer.port' => port
         | 
| 57 | 
            -
                         | 
| 57 | 
            +
                        }
         | 
| 58 | 
            +
                        attributes['peer.service'] = config[:peer_service] if config[:peer_service]
         | 
| 59 | 
            +
                        attributes.merge(OpenTelemetry::Instrumentation::Redis.attributes)
         | 
| 58 60 | 
             
                      end
         | 
| 59 61 |  | 
| 60 62 | 
             
                      def tracer
         | 
| 61 63 | 
             
                        Redis::Instrumentation.instance.tracer
         | 
| 62 64 | 
             
                      end
         | 
| 65 | 
            +
             | 
| 66 | 
            +
                      def config
         | 
| 67 | 
            +
                        Redis::Instrumentation.instance.config
         | 
| 68 | 
            +
                      end
         | 
| 63 69 | 
             
                    end
         | 
| 64 70 | 
             
                  end
         | 
| 65 71 | 
             
                end
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
            # Copyright  | 
| 3 | 
            +
            # Copyright The OpenTelemetry Authors
         | 
| 4 4 | 
             
            #
         | 
| 5 5 | 
             
            # SPDX-License-Identifier: Apache-2.0
         | 
| 6 6 |  | 
| @@ -11,7 +11,6 @@ module OpenTelemetry | |
| 11 11 | 
             
                  module Utils
         | 
| 12 12 | 
             
                    extend self
         | 
| 13 13 |  | 
| 14 | 
            -
                    STRING_PLACEHOLDER = ''.encode(::Encoding::UTF_8).freeze
         | 
| 15 14 | 
             
                    PLACEHOLDER = '?'
         | 
| 16 15 | 
             
                    VALUE_MAX_LEN = 50
         | 
| 17 16 | 
             
                    CMD_MAX_LEN = 500
         | 
| @@ -36,7 +35,7 @@ module OpenTelemetry | |
| 36 35 |  | 
| 37 36 | 
             
                    def format_arg(arg)
         | 
| 38 37 | 
             
                      str = arg.is_a?(Symbol) ? arg.to_s.upcase : arg.to_s
         | 
| 39 | 
            -
                      str = utf8_encode(str, binary: true | 
| 38 | 
            +
                      str = OpenTelemetry::Common::Utilities.utf8_encode(str, binary: true)
         | 
| 40 39 | 
             
                      truncate(str, VALUE_MAX_LEN)
         | 
| 41 40 | 
             
                    rescue StandardError => e
         | 
| 42 41 | 
             
                      OpenTelemetry.logger.debug("non formattable Redis arg #{str}: #{e}")
         | 
| @@ -60,24 +59,6 @@ module OpenTelemetry | |
| 60 59 | 
             
                    def truncate(string, size)
         | 
| 61 60 | 
             
                      string.size > size ? "#{string[0...size - 3]}..." : string
         | 
| 62 61 | 
             
                    end
         | 
| 63 | 
            -
             | 
| 64 | 
            -
                    def utf8_encode(str, options = {})
         | 
| 65 | 
            -
                      str = str.to_s
         | 
| 66 | 
            -
             | 
| 67 | 
            -
                      if options[:binary]
         | 
| 68 | 
            -
                        # This option is useful for "gracefully" displaying binary data that
         | 
| 69 | 
            -
                        # often contains text such as marshalled objects
         | 
| 70 | 
            -
                        str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
         | 
| 71 | 
            -
                      elsif str.encoding == ::Encoding::UTF_8
         | 
| 72 | 
            -
                        str
         | 
| 73 | 
            -
                      else
         | 
| 74 | 
            -
                        str.encode(::Encoding::UTF_8)
         | 
| 75 | 
            -
                      end
         | 
| 76 | 
            -
                    rescue StandardError => e
         | 
| 77 | 
            -
                      OpenTelemetry.logger.debug("Error encoding string in UTF-8: #{e}")
         | 
| 78 | 
            -
             | 
| 79 | 
            -
                      options.fetch(:placeholder, STRING_PLACEHOLDER)
         | 
| 80 | 
            -
                    end
         | 
| 81 62 | 
             
                  end
         | 
| 82 63 | 
             
                end
         | 
| 83 64 | 
             
              end
         | 
| @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
            # Copyright  | 
| 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 Redis
         | 
| 10 | 
            -
                  VERSION = '0. | 
| 10 | 
            +
                  VERSION = '0.14.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-redis
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.14.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:  | 
| 11 | 
            +
            date: 2021-02-03 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. | 
| 19 | 
            +
                    version: 0.14.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. | 
| 26 | 
            +
                    version: 0.14.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.14.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.14.0
         | 
| 27 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 42 | 
             
              name: appraisal
         | 
| 29 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -186,10 +200,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby | |
| 186 200 | 
             
            licenses:
         | 
| 187 201 | 
             
            - Apache-2.0
         | 
| 188 202 | 
             
            metadata:
         | 
| 189 | 
            -
              changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-redis/v0. | 
| 190 | 
            -
              source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/ | 
| 203 | 
            +
              changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-redis/v0.14.0/file.CHANGELOG.html
         | 
| 204 | 
            +
              source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/redis
         | 
| 191 205 | 
             
              bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
         | 
| 192 | 
            -
              documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-redis/v0. | 
| 206 | 
            +
              documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-redis/v0.14.0
         | 
| 193 207 | 
             
            post_install_message: 
         | 
| 194 208 | 
             
            rdoc_options: []
         | 
| 195 209 | 
             
            require_paths:
         |