opentelemetry-instrumentation-pg 0.18.1 → 0.19.0
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: 92d131df358f791a704781a41f2b4dccf138d92129ba6835179d33c01fb72c5a
|
4
|
+
data.tar.gz: 47bfd3067f55772f6f616c25d9d733b88734183248ddb6afa6cbfe462aa89560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00cf026c0ad5bde5beb1881ea80311209b9eb44e763d59e453335a798681e71895beb197061ac60989e55f4404f1366cf2bc4d21105af47726782a56c34b32b
|
7
|
+
data.tar.gz: 2ea850c452a38d8fe4051f867a23d33f620a81e7e60ffbe26175fec9e5006a1993cd4b016a761fe98e5c98203cbd3aeaec2a316ba24695636c3433687721591d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-pg
|
2
2
|
|
3
|
+
### v0.19.0 / 2021-08-12
|
4
|
+
|
5
|
+
* ADDED: Add db_statement toggle for postgres
|
6
|
+
* DOCS: Update docs to rely more on environment variable configuration
|
7
|
+
|
3
8
|
### v0.18.1 / 2021-06-23
|
4
9
|
|
5
10
|
* (No significant changes)
|
data/README.md
CHANGED
@@ -35,19 +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',
|
45
41
|
|
46
42
|
# By default, this instrumentation includes the executed SQL as the `db.statement`
|
47
|
-
# semantic attribute
|
48
|
-
#
|
49
|
-
|
50
|
-
enable_statement_attribute: true,
|
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,
|
51
46
|
}
|
52
47
|
end
|
53
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
|
@@ -27,6 +43,7 @@ module OpenTelemetry
|
|
27
43
|
option :peer_service, default: nil, validate: :string
|
28
44
|
option :enable_sql_obfuscation, default: false, validate: :boolean
|
29
45
|
option :enable_statement_attribute, default: true, validate: :boolean
|
46
|
+
option :db_statement, default: :include, validate: ->(opt) { %I[omit include obfuscate].include?(opt) }
|
30
47
|
|
31
48
|
private
|
32
49
|
|
@@ -84,7 +84,7 @@ module OpenTelemetry
|
|
84
84
|
end
|
85
85
|
|
86
86
|
attrs = { 'db.operation' => validated_operation(operation), 'db.postgresql.prepared_statement_name' => statement_name }
|
87
|
-
attrs['db.statement'] = sql
|
87
|
+
attrs['db.statement'] = sql unless config[:db_statement] == :omit
|
88
88
|
attrs.reject! { |_, v| v.nil? }
|
89
89
|
|
90
90
|
[span_name(operation), client_attributes.merge(attrs)]
|
@@ -104,7 +104,7 @@ module OpenTelemetry
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def obfuscate_sql(sql)
|
107
|
-
return sql unless config[:
|
107
|
+
return sql unless config[:db_statement] == :obfuscate
|
108
108
|
|
109
109
|
# Borrowed from opentelemetry-instrumentation-mysql2
|
110
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.0
|
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-08-16 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: 1.0.0.
|
19
|
+
version: 1.0.0.rc3
|
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: 1.0.0.
|
26
|
+
version: 1.0.0.rc3
|
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.18.
|
33
|
+
version: 0.18.2
|
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.18.
|
40
|
+
version: 0.18.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: appraisal
|
43
43
|
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.0/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.0
|
194
222
|
post_install_message:
|
195
223
|
rdoc_options: []
|
196
224
|
require_paths:
|