opentelemetry-helpers-sql-processor 0.5.0 → 0.5.1

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: 25af87a0d0abf1c7ceb6331a6366bd423cb7125eb78218e19f4e20950c4312d7
4
- data.tar.gz: 10772b8265474e6fefa0f2cfe18db768933c417d6c01656cd0026860a616e334
3
+ metadata.gz: d14daa6c6f80a866f3f0fd049a4f0929a70a1a5f710f6a5bd499785647aa7636
4
+ data.tar.gz: 8b7207a2cd5b0f9f9d18464bd3fb6d2887494589d89acc945c3a242edeaf69e8
5
5
  SHA512:
6
- metadata.gz: 3eb81ec23557397fbbd190be415c6bf090548623e10643d22adbcac4dde9e54d88a7b1c62e97fd229d96e648d20cfed34681ad4331ace3bca39c1bb09487c677
7
- data.tar.gz: 6a4101499693d326f9ae521e77c3681e1df466605219c11097535a2d93d8db63423b2a8b3b5f0c0ff5bbc28fe38f0ebb70dcb7e0bee9ccf1dd9d1c0491abe554
6
+ metadata.gz: 23ba24aa831eeb4fd60f65e71b48b8f9b8ee131c5c77469575bdf8c51c36c765645aa5bb2cff7f0ef312d050ba1911426761a9f891bb98b8ddda6c1ea2065bb8
7
+ data.tar.gz: 8f2d90035af50ee34e044aa75b64c635fffad84fd4e4f6cd3e606b9939b88ffb89d2a49861fe5d73c2379d4e633139a484db94edff86b2bf6301e385927e1cc5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-helpers-sql-processor
2
2
 
3
+ ## v0.5.1 / 2026-10-13
4
+
5
+ - FIXED: Encode SQL commenter propagation keys (#2634)
6
+
3
7
  ## v0.5.0 / 2026-04-14
4
8
 
5
9
  - BREAKING CHANGE: Min Ruby Version 3.3 (#2125)
data/README.md CHANGED
@@ -47,20 +47,28 @@ To obfuscate sql in your library:
47
47
  OpenTelemetry::Helpers::SqlProcessor.obfuscate_sql(sql, obfuscation_limit: config[:obfuscation_limit], adapter: :postgres)
48
48
  ```
49
49
 
50
+ ## SQL comment propagation
51
+
52
+ `SqlCommenter` appends the headers produced by `OpenTelemetry.propagation` to SQL queries as a comment. Both header keys and values are URL-encoded before insertion so they cannot terminate the comment.
53
+
54
+ ```ruby
55
+ sql = +'SELECT * FROM users'
56
+ OpenTelemetry::Helpers::SqlProcessor::SqlCommenter.sql_query_propagator.inject(sql)
57
+ ```
58
+
59
+ Queries remain unchanged when frozen or when the current context produces no headers.
60
+
50
61
  ## How can I get involved?
51
62
 
52
63
  The `opentelemetry-helpers-sql-processor` gem source is [on github][repo-github], along with related gems including `opentelemetry-instrumentation-pg` and `opentelemetry-instrumentation-trilogy`.
53
64
 
54
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our [GitHub Discussions][discussions-url], [Slack Channel][slack-channel] 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].
65
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby Special Interest Group (SIG). You can find details on our weekly meeting times, GitHub Discussions, and CNCF Slack channels on the [Ruby SDK SIG page][ruby-sig].
55
66
 
56
67
  ## License
57
68
 
58
69
  The `opentelemetry-helpers-sql-processor` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
59
70
 
60
71
  [new-relic-obfuscation-helpers]: https://github.com/newrelic/newrelic-ruby-agent/blob/96e7aca22c1c873c0f5fe704a2b3bb19652db68e/lib/new_relic/agent/database/obfuscation_helpers.rb
61
- [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
72
+ [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib
62
73
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
63
- [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
64
- [community-meetings]: https://github.com/open-telemetry/community#community-meetings
65
- [slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY
66
- [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
74
+ [ruby-sig]: https://github.com/open-telemetry/community/blob/main/sigs.md#ruby-sdk
@@ -23,7 +23,7 @@ module OpenTelemetry
23
23
  # and appending them to SQL queries according to the SQL Commenter specification.
24
24
  #
25
25
  # Format: /*key='value',key2='value2'*/
26
- # Values are URL-encoded per the SQL Commenter spec
26
+ # Keys and values are URL-encoded per the SQL Commenter spec
27
27
  module SqlQuerySetter
28
28
  extend self
29
29
 
@@ -38,9 +38,10 @@ module OpenTelemetry
38
38
  # Convert headers hash to SQL commenter format
39
39
  # Format: /*key1='value1',key2='value2'*/
40
40
  comment_parts = headers.map do |key, value|
41
- # URL encode values as per SQL Commenter spec (using URI component encoding)
41
+ # URL encode keys and values so they cannot terminate the SQL comment.
42
+ encoded_key = CGI.escapeURIComponent(key.to_s)
42
43
  encoded_value = CGI.escapeURIComponent(value.to_s)
43
- "#{key}='#{encoded_value}'"
44
+ "#{encoded_key}='#{encoded_value}'"
44
45
  end
45
46
 
46
47
  # Append to end of query (spec recommendation)
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Helpers
9
9
  module SqlProcessor
10
- VERSION = '0.5.0'
10
+ VERSION = '0.5.1'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-helpers-sql-processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
@@ -58,10 +58,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
58
58
  licenses:
59
59
  - Apache-2.0
60
60
  metadata:
61
- changelog_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.5.0/file/CHANGELOG.md
62
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-helpers-sql-processor/v0.5.0/helpers/sql-processor
61
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.5.1/file/CHANGELOG.md
62
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-helpers-sql-processor/v0.5.1/helpers/sql-processor
63
63
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
64
- documentation_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.5.0
64
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.5.1
65
65
  post_install_message: ''
66
66
  rdoc_options: []
67
67
  require_paths:
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
- rubygems_version: 4.0.6
80
+ rubygems_version: 4.0.16
81
81
  specification_version: 4
82
82
  summary: SQL Processing Instrumentation Helpers for the OpenTelemetry framework
83
83
  test_files: []