opentelemetry-instrumentation-pg 0.25.0 → 0.25.1

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: 708556793d4e7d3dfcfca9d3892b6f6a966baacd5abe1fa358861196fb8794a9
4
- data.tar.gz: fce3c184ff8338d93644b0b5bf8d02bf328887c1b342140e574c6c5b20b454a6
3
+ metadata.gz: d828ad6a0400bd997f99de77aeb6507bfc82d6ae4b0ca9744e166030bd23edee
4
+ data.tar.gz: 37e5eecb2567bfee13896d67e443a4f7f43ad02fc8864ce925f72e694fd3b924
5
5
  SHA512:
6
- metadata.gz: a0ed151255f25b758cb3361599b8b0c7d6b3b66e01d817f76d298b2d791acdf647c8d7f83178995b4dd5e76f2ef8117c491090f23b8d01e79dcd5b4000f3aa8e
7
- data.tar.gz: c1a87ff107bf43d4890c82e6a19669c0d1176db9a8db973f099898958bea1083a16ac0bd3731eceda7644764ce85eb46cf23600235d110102a6cacc764583656
6
+ metadata.gz: 4d9cf4613d90e9afeb0baedf84dc190168384490e8fab4cd36cdc4fbbe9a4754d2494a6f3293217ac7263c6973c277ba35f1b9ef3b629abf4a6709eb06380c4a
7
+ data.tar.gz: 5a2e6d37525c31c24e3868498e238d834bffd6abeeb91816816d82290dbf9d5ef5c2cfd08fe5b49f9a7245f2462b104b0171b7b6a2589e27e15b641063d29f63
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-pg
2
2
 
3
+ ### v0.25.1 / 2023-06-01
4
+
5
+ * FIXED: Regex non-match with obfuscation limit (issue #486)
6
+
3
7
  ### v0.25.0 / 2023-05-25
4
8
 
5
9
  * ADDED: Add config[:obfuscation_limit] to pg and mysql2
@@ -108,8 +108,12 @@ module OpenTelemetry
108
108
  return sql unless config[:db_statement] == :obfuscate
109
109
 
110
110
  if sql.size > config[:obfuscation_limit]
111
- truncated_sql = sql[..sql.index(generated_postgres_regex) - 1]
112
- return truncated_sql + "...\nSQL truncated (> #{config[:obfuscation_limit]} characters)"
111
+ first_match_index = sql.index(generated_postgres_regex)
112
+ truncation_message = "SQL truncated (> #{config[:obfuscation_limit]} characters)"
113
+ return truncation_message unless first_match_index
114
+
115
+ truncated_sql = sql[..first_match_index - 1]
116
+ return "#{truncated_sql}...\n#{truncation_message}"
113
117
  end
114
118
 
115
119
  # From:
@@ -119,6 +123,9 @@ module OpenTelemetry
119
123
  obfuscated = 'Failed to obfuscate SQL query - quote characters remained after obfuscation' if PG::Constants::UNMATCHED_PAIRS_REGEX.match(obfuscated)
120
124
 
121
125
  obfuscated
126
+ rescue StandardError => e
127
+ OpenTelemetry.handle_error(message: 'Failed to obfuscate SQL', exception: e)
128
+ 'OpenTelemetry error: failed to obfuscate sql'
122
129
  end
123
130
 
124
131
  def generated_postgres_regex
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module PG
10
- VERSION = '0.25.0'
10
+ VERSION = '0.25.1'
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-pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.25.1
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-05-25 00:00:00.000000000 Z
11
+ date: 2023-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -243,10 +243,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
243
243
  licenses:
244
244
  - Apache-2.0
245
245
  metadata:
246
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-pg/0.25.0/file/CHANGELOG.md
246
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-pg/0.25.1/file/CHANGELOG.md
247
247
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/pg
248
248
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
249
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-pg/0.25.0
249
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-pg/0.25.1
250
250
  post_install_message:
251
251
  rdoc_options: []
252
252
  require_paths: