opentelemetry-instrumentation-trilogy 0.55.0 → 0.56.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
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 87f006ee60e9b69302f9d4da5945d7cde5a917ea925498b2fe727e1916b8bbff
         | 
| 4 | 
            +
              data.tar.gz: 938cd875ffd5ae56f97525d01ed4058918dcc3709ae9429546b8132099ef7ec2
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 1d14dddca8b736a90197744d35d0bb7c523767b5a5a4ce93fa445b46dfa570b4463636802a8613ded1cebc7c2be44b41f85ee02525fbeb19d7e847cfa007f2d6
         | 
| 7 | 
            +
              data.tar.gz: cb79931cef883a55c7b356e33fdb7a883a2bedf518edb72cb7179065a9c861383eadc6d0a773971022d28c2aacd78f70560574d4be1be50aeca129aeb4cb1231
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,15 @@ | |
| 1 1 | 
             
            # Release History: opentelemetry-instrumentation-trilogy
         | 
| 2 2 |  | 
| 3 | 
            +
            ### v0.56.0 / 2023-06-02
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            * BREAKING CHANGE: Separate logical MySQL host from connected host 
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            * ADDED: Separate logical MySQL host from connected host 
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            ### v0.55.1 / 2023-06-01
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            * FIXED: Regex non-match with obfuscation limit (issue #486) 
         | 
| 12 | 
            +
             | 
| 3 13 | 
             
            ### v0.55.0 / 2023-05-31
         | 
| 4 14 |  | 
| 5 15 | 
             
            * BREAKING CHANGE: Add database name for trilogy traces 
         | 
| @@ -48,11 +48,6 @@ module OpenTelemetry | |
| 48 48 |  | 
| 49 49 | 
             
                      FULL_SQL_REGEXP = Regexp.union(MYSQL_COMPONENTS.map { |component| COMPONENTS_REGEX_MAP[component] })
         | 
| 50 50 |  | 
| 51 | 
            -
                      def initialize(args)
         | 
| 52 | 
            -
                        @_otel_net_peer_name = args[:host]
         | 
| 53 | 
            -
                        super
         | 
| 54 | 
            -
                      end
         | 
| 55 | 
            -
             | 
| 56 51 | 
             
                      def query(sql)
         | 
| 57 52 | 
             
                        tracer.in_span(
         | 
| 58 53 | 
             
                          database_span_name(sql),
         | 
| @@ -68,11 +63,12 @@ module OpenTelemetry | |
| 68 63 | 
             
                      def client_attributes(sql)
         | 
| 69 64 | 
             
                        attributes = {
         | 
| 70 65 | 
             
                          ::OpenTelemetry::SemanticConventions::Trace::DB_SYSTEM => 'mysql',
         | 
| 71 | 
            -
                          ::OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME =>  | 
| 66 | 
            +
                          ::OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME => connection_options.fetch(:host, 'unknown sock')
         | 
| 72 67 | 
             
                        }
         | 
| 73 68 |  | 
| 74 69 | 
             
                        attributes[::OpenTelemetry::SemanticConventions::Trace::DB_NAME] = database_name if database_name
         | 
| 75 70 | 
             
                        attributes[::OpenTelemetry::SemanticConventions::Trace::PEER_SERVICE] = config[:peer_service] unless config[:peer_service].nil?
         | 
| 71 | 
            +
                        attributes['db.mysql.instance.address'] = @connected_host if defined?(@connected_host)
         | 
| 76 72 |  | 
| 77 73 | 
             
                        case config[:db_statement]
         | 
| 78 74 | 
             
                        when :obfuscate
         | 
| @@ -86,8 +82,12 @@ module OpenTelemetry | |
| 86 82 |  | 
| 87 83 | 
             
                      def obfuscate_sql(sql)
         | 
| 88 84 | 
             
                        if sql.size > config[:obfuscation_limit]
         | 
| 89 | 
            -
                           | 
| 90 | 
            -
                           | 
| 85 | 
            +
                          first_match_index = sql.index(FULL_SQL_REGEXP)
         | 
| 86 | 
            +
                          truncation_message = "SQL truncated (> #{config[:obfuscation_limit]} characters)"
         | 
| 87 | 
            +
                          return truncation_message unless first_match_index
         | 
| 88 | 
            +
             | 
| 89 | 
            +
                          truncated_sql = sql[..first_match_index - 1]
         | 
| 90 | 
            +
                          "#{truncated_sql}...\n#{truncation_message}"
         | 
| 91 91 | 
             
                        else
         | 
| 92 92 | 
             
                          obfuscated = OpenTelemetry::Common::Utilities.utf8_encode(sql, binary: true)
         | 
| 93 93 | 
             
                          obfuscated = obfuscated.gsub(FULL_SQL_REGEXP, '?')
         | 
| @@ -131,16 +131,6 @@ module OpenTelemetry | |
| 131 131 | 
             
                        connection_options[:database]
         | 
| 132 132 | 
             
                      end
         | 
| 133 133 |  | 
| 134 | 
            -
                      def net_peer_name
         | 
| 135 | 
            -
                        if defined?(@connected_host)
         | 
| 136 | 
            -
                          @connected_host
         | 
| 137 | 
            -
                        elsif @_otel_net_peer_name
         | 
| 138 | 
            -
                          @_otel_net_peer_name
         | 
| 139 | 
            -
                        else
         | 
| 140 | 
            -
                          'unknown sock'
         | 
| 141 | 
            -
                        end
         | 
| 142 | 
            -
                      end
         | 
| 143 | 
            -
             | 
| 144 134 | 
             
                      def tracer
         | 
| 145 135 | 
             
                        Trilogy::Instrumentation.instance.tracer
         | 
| 146 136 | 
             
                      end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: opentelemetry-instrumentation-trilogy
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.56.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: 2023- | 
| 11 | 
            +
            date: 2023-06-02 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: opentelemetry-api
         | 
| @@ -275,10 +275,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib | |
| 275 275 | 
             
            licenses:
         | 
| 276 276 | 
             
            - Apache-2.0
         | 
| 277 277 | 
             
            metadata:
         | 
| 278 | 
            -
              changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0. | 
| 278 | 
            +
              changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.56.0/file/CHANGELOG.md
         | 
| 279 279 | 
             
              source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/trilogy
         | 
| 280 280 | 
             
              bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
         | 
| 281 | 
            -
              documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0. | 
| 281 | 
            +
              documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-trilogy/0.56.0
         | 
| 282 282 | 
             
            post_install_message: 
         | 
| 283 283 | 
             
            rdoc_options: []
         | 
| 284 284 | 
             
            require_paths:
         |