opentelemetry-instrumentation-pg 0.22.0 → 0.22.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: d58f12ed858f82af3aa55e4c2962706477dcfcb72bfc4d16daab6366dc1abeee
4
- data.tar.gz: d00d8d3ada02014905b0c91621f69734e859d27ad01f8d7b097ce4ce89eb70dc
3
+ metadata.gz: 179f178f264fbe7f2c157f4253e7d96194484301ffc2079e8026cdc67d7e98dd
4
+ data.tar.gz: 6e24f6c7d3a005e517533e948d19ba060cb6e2ee184ccbf0ec5fbe8e0121b2bd
5
5
  SHA512:
6
- metadata.gz: f2478f862fa99d49340c803410bca43091a26dd02bb522090eb405be01ae5855b2cbe8c57836d6c244e8aa198b4ece17e60dc6bf12116c10abde250d91e4fb2e
7
- data.tar.gz: 83494bdc37be6ae03813c323946b56ad5f007759d0db96971a3813f013403edd4535f80f7c2f610329b5c4b119bdbf5e9cc038323ff2ef4c13763bfc0d0947ba
6
+ metadata.gz: 04b33b5e664ba6e8601df65b8c6125f8ae75cf7b5c856363a3cc31d7430290b9f30fea4cdba5298f72c69a18b8fe9d565849df61a4893ce0a33179a894f5fd0b
7
+ data.tar.gz: 4f955fd3764ec0f40fdf5223920b9ebd7a429cb409d2d5aba88ca885ba793456614962fa0166928809b58793b789d336d1b449a354099e88b30e9de971b1ace2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-pg
2
2
 
3
+ ### v0.22.1 / 2022-10-27
4
+
5
+ * FIXED: Only take the first item in a comma-separated list for pg attrs
6
+
3
7
  ### v0.22.0 / 2022-10-04
4
8
 
5
9
  * ADDED: Add `with_attributes` context propagation for PG instrumentation
@@ -12,7 +12,7 @@ module OpenTelemetry
12
12
  module PG
13
13
  module Patches
14
14
  # Module to prepend to PG::Connection for instrumentation
15
- module Connection
15
+ module Connection # rubocop:disable Metrics/ModuleLength
16
16
  PG::Constants::EXEC_ISH_METHODS.each do |method|
17
17
  define_method method do |*args|
18
18
  span_name, attrs = span_attrs(:query, *args)
@@ -127,12 +127,20 @@ module OpenTelemetry
127
127
  conninfo_hash[:dbname]&.to_s
128
128
  end
129
129
 
130
+ def first_in_list(item)
131
+ if (idx = item.index(','))
132
+ item[0...idx]
133
+ else
134
+ item
135
+ end
136
+ end
137
+
130
138
  def client_attributes
131
139
  attributes = {
132
140
  'db.system' => 'postgresql',
133
141
  'db.user' => conninfo_hash[:user]&.to_s,
134
142
  'db.name' => database_name,
135
- 'net.peer.name' => conninfo_hash[:host]&.to_s
143
+ 'net.peer.name' => first_in_list(conninfo_hash[:host]&.to_s)
136
144
  }
137
145
  attributes['peer.service'] = config[:peer_service] if config[:peer_service]
138
146
 
@@ -146,7 +154,7 @@ module OpenTelemetry
146
154
  {
147
155
  'net.transport' => 'IP.TCP',
148
156
  'net.peer.ip' => conninfo_hash[:hostaddr]&.to_s,
149
- 'net.peer.port' => conninfo_hash[:port]&.to_s
157
+ 'net.peer.port' => first_in_list(conninfo_hash[:port]&.to_s)
150
158
  }
151
159
  end
152
160
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module PG
10
- VERSION = '0.22.0'
10
+ VERSION = '0.22.1'
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.22.0
4
+ version: 0.22.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: 2022-10-04 00:00:00.000000000 Z
11
+ date: 2022-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -243,10 +243,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-contrib
243
243
  licenses:
244
244
  - Apache-2.0
245
245
  metadata:
246
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-pg/v0.22.0/file.CHANGELOG.html
246
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-pg/v0.22.1/file.CHANGELOG.html
247
247
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/pg
248
248
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
249
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-pg/v0.22.0
249
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-pg/v0.22.1
250
250
  post_install_message:
251
251
  rdoc_options: []
252
252
  require_paths: