opentelemetry-instrumentation-pg 0.17.1 → 0.19.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 713150c48f2e5b9bbee47cc4f44dd65065468c5e30167edbcb7eae1c03b0d72d
|
4
|
+
data.tar.gz: 6e398fc92bf8c4bf5f7d082ed7fce5ce205e9b709d454b03485db9548ab9d09e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 722eac0ec7fed3069e1d2bdc898fb5f76d0ee50b11a4ac5107ebc75460763dfd10464cef85ee80dcf40b43f9fc5b254d218a3105ce43bc78fe5c373acca5edb8
|
7
|
+
data.tar.gz: bad89f1ece440cf3955b5a5e3378b0e25a592a5633d59e5d690d0a1f91c214ae2a582dce0b92c1faacf7cf0e7292614c60222160e92788e132c09196784a5811
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-pg
|
2
2
|
|
3
|
+
### v0.19.1 / 2021-09-29
|
4
|
+
|
5
|
+
* (No significant changes)
|
6
|
+
|
7
|
+
### v0.19.0 / 2021-08-12
|
8
|
+
|
9
|
+
* ADDED: Add db_statement toggle for postgres
|
10
|
+
* DOCS: Update docs to rely more on environment variable configuration
|
11
|
+
|
12
|
+
### v0.18.1 / 2021-06-23
|
13
|
+
|
14
|
+
* (No significant changes)
|
15
|
+
|
16
|
+
### v0.18.0 / 2021-05-21
|
17
|
+
|
18
|
+
* ADDED: Updated API depedency for 1.0.0.rc1
|
19
|
+
* ADDED: Add option to postgres instrumentation to disable db.statement
|
20
|
+
|
3
21
|
### v0.17.1 / 2021-04-23
|
4
22
|
|
5
23
|
* Initial release.
|
data/README.md
CHANGED
@@ -35,13 +35,14 @@ end
|
|
35
35
|
```ruby
|
36
36
|
OpenTelemetry::SDK.configure do |c|
|
37
37
|
c.use 'OpenTelemetry::Instrumentation::PG', {
|
38
|
-
# The obfuscation of SQL in the db.statement attribute is disabled by default.
|
39
|
-
# To enable, set enable_sql_obfuscation to true.
|
40
|
-
enable_sql_obfuscation: false,
|
41
|
-
|
42
38
|
# You may optionally set a value for 'peer.service', which
|
43
39
|
# will be included on all spans from this instrumentation:
|
44
40
|
peer_service: 'postgres:readonly',
|
41
|
+
|
42
|
+
# By default, this instrumentation includes the executed SQL as the `db.statement`
|
43
|
+
# semantic attribute. Optionally, you may disable the inclusion of this attribute entirely by
|
44
|
+
# setting this option to :omit or sanitize the attribute by setting to :obfuscate
|
45
|
+
db_statement: :include,
|
45
46
|
}
|
46
47
|
end
|
47
48
|
```
|
@@ -11,7 +11,23 @@ module OpenTelemetry
|
|
11
11
|
class Instrumentation < OpenTelemetry::Instrumentation::Base
|
12
12
|
MINIMUM_VERSION = Gem::Version.new('1.1.0')
|
13
13
|
|
14
|
-
install do |
|
14
|
+
install do |config|
|
15
|
+
if config[:enable_sql_obfuscation]
|
16
|
+
config[:db_statement] = :obfuscate
|
17
|
+
OpenTelemetry.logger.warn(
|
18
|
+
'Instrumentation pg configuration option enable_sql_obfuscation has been deprecated,' \
|
19
|
+
'use db_statement option instead'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
unless config[:enable_statement_attribute]
|
24
|
+
config[:db_statement] = :omit
|
25
|
+
OpenTelemetry.logger.warn(
|
26
|
+
'Instrumentation pg configuration option enable_statement_attribute has been deprecated,' \
|
27
|
+
'use db_statement option instead'
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
15
31
|
require_dependencies
|
16
32
|
patch_client
|
17
33
|
end
|
@@ -26,6 +42,8 @@ module OpenTelemetry
|
|
26
42
|
|
27
43
|
option :peer_service, default: nil, validate: :string
|
28
44
|
option :enable_sql_obfuscation, default: false, validate: :boolean
|
45
|
+
option :enable_statement_attribute, default: true, validate: :boolean
|
46
|
+
option :db_statement, default: :include, validate: ->(opt) { %I[omit include obfuscate].include?(opt) }
|
29
47
|
|
30
48
|
private
|
31
49
|
|
@@ -83,7 +83,8 @@ module OpenTelemetry
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
attrs = { 'db.operation' => validated_operation(operation), 'db.
|
86
|
+
attrs = { 'db.operation' => validated_operation(operation), 'db.postgresql.prepared_statement_name' => statement_name }
|
87
|
+
attrs['db.statement'] = sql unless config[:db_statement] == :omit
|
87
88
|
attrs.reject! { |_, v| v.nil? }
|
88
89
|
|
89
90
|
[span_name(operation), client_attributes.merge(attrs)]
|
@@ -103,7 +104,7 @@ module OpenTelemetry
|
|
103
104
|
end
|
104
105
|
|
105
106
|
def obfuscate_sql(sql)
|
106
|
-
return sql unless config[:
|
107
|
+
return sql unless config[:db_statement] == :obfuscate
|
107
108
|
|
108
109
|
# Borrowed from opentelemetry-instrumentation-mysql2
|
109
110
|
return 'SQL query too large to remove sensitive data ...' if sql.size > 2000
|
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.
|
4
|
+
version: 0.19.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: 2021-
|
11
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: opentelemetry-instrumentation-base
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.18.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.18.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: appraisal
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '1.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pg
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,34 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.1.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pry-byebug
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: rubocop
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,10 +215,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
187
215
|
licenses:
|
188
216
|
- Apache-2.0
|
189
217
|
metadata:
|
190
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-pg/v0.
|
218
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-pg/v0.19.1/file.CHANGELOG.html
|
191
219
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/pg
|
192
220
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
193
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-pg/v0.
|
221
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-pg/v0.19.1
|
194
222
|
post_install_message:
|
195
223
|
rdoc_options: []
|
196
224
|
require_paths:
|