opentelemetry-helpers-sql-processor 0.4.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: 93190bba5f90cc331db3cb1bf1ca6f881aa84c2ca372fe36fef411406536e91f
4
- data.tar.gz: 6d9223214f3c3d2976a98ac38728f09a877beba95ab1e048fead10c41747eb67
3
+ metadata.gz: d14daa6c6f80a866f3f0fd049a4f0929a70a1a5f710f6a5bd499785647aa7636
4
+ data.tar.gz: 8b7207a2cd5b0f9f9d18464bd3fb6d2887494589d89acc945c3a242edeaf69e8
5
5
  SHA512:
6
- metadata.gz: 11ba72f0edb34309d4d7302b57f18461857e140b8a8060e76cdfceaf3a002864f801747728f7e7207ec4362a94a17d58bf45db70bec604bc4f20a9f6c00994a2
7
- data.tar.gz: 2f82c82e9a1eed0e4aa3be7a7d3d9d34ea53fe048a87c66d6d315c093788012f3d0f26e3fe84d22f14711df4e4367657c088e32a66c8f4d38b7213c80d4af249
6
+ metadata.gz: 23ba24aa831eeb4fd60f65e71b48b8f9b8ee131c5c77469575bdf8c51c36c765645aa5bb2cff7f0ef312d050ba1911426761a9f891bb98b8ddda6c1ea2065bb8
7
+ data.tar.gz: 8f2d90035af50ee34e044aa75b64c635fffad84fd4e4f6cd3e606b9939b88ffb89d2a49861fe5d73c2379d4e633139a484db94edff86b2bf6301e385927e1cc5
data/CHANGELOG.md CHANGED
@@ -1,23 +1,32 @@
1
1
  # Release History: opentelemetry-helpers-sql-processor
2
2
 
3
- ### v0.4.0 / 2026-01-13
3
+ ## v0.5.1 / 2026-10-13
4
4
 
5
- * ADDED: Add SQL Comment Propagator
5
+ - FIXED: Encode SQL commenter propagation keys (#2634)
6
6
 
7
- ### v0.3.1 / 2025-11-11
7
+ ## v0.5.0 / 2026-04-14
8
8
 
9
- * DOCS: Update example to match new gem namespace (sql-processor)
9
+ - BREAKING CHANGE: Min Ruby Version 3.3 (#2125)
10
+ - ADDED: Min Ruby Version 3.3 (#2125)
11
+ - ADDED: Add release tag into source code url of gem metadata (#1984)
10
12
 
11
- ### v0.3.0 / 2025-11-04
13
+ ## v0.4.0 / 2026-01-13
12
14
 
13
- * ADDED: Refactor SQL processor file structure for clarity
15
+ - ADDED: Add SQL Comment Propagator
14
16
 
15
- ### v0.2.0 / 2025-10-22
17
+ ## v0.3.1 / 2025-11-11
16
18
 
17
- * BREAKING CHANGE: Min Ruby Version 3.2
19
+ - DOCS: Update example to match new gem namespace (sql-processor)
18
20
 
19
- * ADDED: Min Ruby Version 3.2
21
+ ## v0.3.0 / 2025-11-04
20
22
 
21
- ### v0.1.0 / 2025-10-08
23
+ - ADDED: Refactor SQL processor file structure for clarity
22
24
 
23
- Initial release.
25
+ ## v0.2.0 / 2025-10-22
26
+
27
+ - BREAKING CHANGE: Min Ruby Version 3.2
28
+ - ADDED: Min Ruby Version 3.2
29
+
30
+ ## v0.1.0 / 2025-10-08
31
+
32
+ - Initial release.
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.4.0'
10
+ VERSION = '0.5.1'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-helpers-sql-processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-01-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: opentelemetry-api
@@ -59,10 +58,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
59
58
  licenses:
60
59
  - Apache-2.0
61
60
  metadata:
62
- changelog_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.4.0/file/CHANGELOG.md
63
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/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
64
63
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
65
- documentation_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.4.0
64
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-helpers-sql-processor/0.5.1
66
65
  post_install_message: ''
67
66
  rdoc_options: []
68
67
  require_paths:
@@ -71,15 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
70
  requirements:
72
71
  - - ">="
73
72
  - !ruby/object:Gem::Version
74
- version: '3.2'
73
+ version: '3.3'
75
74
  required_rubygems_version: !ruby/object:Gem::Requirement
76
75
  requirements:
77
76
  - - ">="
78
77
  - !ruby/object:Gem::Version
79
78
  version: '0'
80
79
  requirements: []
81
- rubygems_version: 3.4.19
82
- signing_key:
80
+ rubygems_version: 4.0.16
83
81
  specification_version: 4
84
82
  summary: SQL Processing Instrumentation Helpers for the OpenTelemetry framework
85
83
  test_files: []