opentelemetry-instrumentation-pg 0.18.0 → 0.19.2

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: 9c4e243b4d741da7773591d3cb977a3e65b95dbd9088f7d23a2ed7fc0b8f0a6d
4
- data.tar.gz: 74f20ba5842d45473849d918d5ac76a2e4c00498c2e18e9950167e43fb4121aa
3
+ metadata.gz: af97ae3e034bdbaf786cc36bca5bea76d4d559bdfca4681c619c21d44925caf8
4
+ data.tar.gz: 16a7437169927314555953895ee94fb911aac22921e84e9f7963ddaf6e867fd9
5
5
  SHA512:
6
- metadata.gz: 4bbc8c8042c08d46be7095e5a596f5e24df65a3de4900d76ca9bb742c37a0487a0f58e754ec99bc4fb72bbc9e176bbacd1267329b87cf5fc66c85b637a0737b7
7
- data.tar.gz: 464984b8e0c2621d600c1d433b55ae5298f066ae0d005d3c3e648957666fc816c6a456a09ad9357547d580d409289413a67f0b5905f42c38ae3920bed2389c09
6
+ metadata.gz: 54e1dcb374d7f00093322497835d2aee858b0de0e9f9dd3b0d5645d03aaa151402f68f9dfac3bddd1c16a2813354b7d7855435d075c58ce5dcd075e27b457682
7
+ data.tar.gz: 5cd93c0b31cdf8ce8dd9641cb8ea42b5d9f0c86b82202d216527896cb9ea9a78ba4bb9f3386d5cc008116a02fcb6f9f2caf22aab0995c35b48d0f23dbbdd3199
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Release History: opentelemetry-instrumentation-pg
2
2
 
3
+ ### v0.19.2 / 2021-12-02
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.19.1 / 2021-09-29
8
+
9
+ * (No significant changes)
10
+
11
+ ### v0.19.0 / 2021-08-12
12
+
13
+ * ADDED: Add db_statement toggle for postgres
14
+ * DOCS: Update docs to rely more on environment variable configuration
15
+
16
+ ### v0.18.1 / 2021-06-23
17
+
18
+ * (No significant changes)
19
+
3
20
  ### v0.18.0 / 2021-05-21
4
21
 
5
22
  * ADDED: Updated API depedency for 1.0.0.rc1
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 (possibly sanitized, according to the value of `enable_sql_obfuscation`).
48
- # Optionally, you may disable the inclusion of this attribute entirely by
49
- # setting this option to false.
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 |_config|
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 if config[:enable_statement_attribute]
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[:enable_sql_obfuscation]
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
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module PG
10
- VERSION = '0.18.0'
10
+ VERSION = '0.19.2'
11
11
  end
12
12
  end
13
13
  end
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.18.0
4
+ version: 0.19.2
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-05-21 00:00:00.000000000 Z
11
+ date: 2021-12-02 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.rc1
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: 1.0.0.rc1
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.18.0
33
+ version: 0.19.0
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.0
40
+ version: 0.19.0
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: 1.0.0.rc1
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: 1.0.0.rc1
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.18.0/file.CHANGELOG.html
218
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-pg/v0.19.2/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.18.0
221
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-pg/v0.19.2
194
222
  post_install_message:
195
223
  rdoc_options: []
196
224
  require_paths: