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 +4 -4
- data/CHANGELOG.md +20 -11
- data/README.md +14 -6
- data/lib/opentelemetry/helpers/sql_processor/commenter.rb +4 -3
- data/lib/opentelemetry/helpers/sql_processor/version.rb +1 -1
- metadata +7 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d14daa6c6f80a866f3f0fd049a4f0929a70a1a5f710f6a5bd499785647aa7636
|
|
4
|
+
data.tar.gz: 8b7207a2cd5b0f9f9d18464bd3fb6d2887494589d89acc945c3a242edeaf69e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
3
|
+
## v0.5.1 / 2026-10-13
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- FIXED: Encode SQL commenter propagation keys (#2634)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## v0.5.0 / 2026-04-14
|
|
8
8
|
|
|
9
|
-
|
|
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
|
-
|
|
13
|
+
## v0.4.0 / 2026-01-13
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
- ADDED: Add SQL Comment Propagator
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
## v0.3.1 / 2025-11-11
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
- DOCS: Update example to match new gem namespace (sql-processor)
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
## v0.3.0 / 2025-11-04
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
- ADDED: Refactor SQL processor file structure for clarity
|
|
22
24
|
|
|
23
|
-
|
|
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
|
|
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-
|
|
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
|
-
#
|
|
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
|
|
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
|
-
"#{
|
|
44
|
+
"#{encoded_key}='#{encoded_value}'"
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
# Append to end of query (spec recommendation)
|
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
|
+
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:
|
|
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.
|
|
63
|
-
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/
|
|
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.
|
|
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.
|
|
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:
|
|
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: []
|