elastic-transport 8.3.5 → 8.3.6
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/.github/workflows/otel.yml +3 -3
- data/.github/workflows/tests.yml +7 -7
- data/CHANGELOG.md +5 -0
- data/lib/elastic/transport/transport/base.rb +6 -2
- data/lib/elastic/transport/transport/errors.rb +2 -0
- data/lib/elastic/transport/transport/sniffer.rb +2 -0
- data/lib/elastic/transport/version.rb +1 -1
- data/lib/elastic/transport.rb +0 -1
- data/spec/elastic/transport/opentelemetry_spec.rb +16 -0
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55e1343a320fd2a1dba29077ff4d9ad72b6adf62fe918856480f43e00e8a9927
|
4
|
+
data.tar.gz: da17629d377258be5b8564ba0bd82c3ef6119117e307a14ac60f8da14894e375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e375ab5339638b8fedd29d38ae0ff6384407e8256c9201c383ee084689e4781752fe4cc9b23830a2380185234acfbbc59533d91f653ec51fff9007a433b033b3
|
7
|
+
data.tar.gz: 25a3847030def992ed441260e8921509ad5375353ad3e564218e799341bc53942e30245e6dad79c6e38e1783b993298e6729951320bb785e17308a2f5f9ca19f
|
data/.github/workflows/otel.yml
CHANGED
@@ -2,10 +2,10 @@ name: opentelemetry
|
|
2
2
|
on:
|
3
3
|
push:
|
4
4
|
branches:
|
5
|
-
-
|
5
|
+
- 8.3
|
6
6
|
pull_request:
|
7
7
|
branches:
|
8
|
-
-
|
8
|
+
- 8.3
|
9
9
|
jobs:
|
10
10
|
test-otel:
|
11
11
|
name: 'Test Open Telemetry'
|
@@ -17,7 +17,7 @@ jobs:
|
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
19
|
ruby: ['3.3', 'jruby-9.4']
|
20
|
-
es_version: ['
|
20
|
+
es_version: ['9.2.0-SNAPSHOT']
|
21
21
|
runs-on: ubuntu-latest
|
22
22
|
steps:
|
23
23
|
- uses: actions/checkout@v4
|
data/.github/workflows/tests.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
name:
|
1
|
+
name: 8.3 tests
|
2
2
|
on:
|
3
3
|
push:
|
4
4
|
branches:
|
5
|
-
-
|
5
|
+
- 8.3
|
6
6
|
pull_request:
|
7
7
|
branches:
|
8
|
-
-
|
8
|
+
- 8.3
|
9
9
|
jobs:
|
10
10
|
test:
|
11
11
|
name: 'Main tests'
|
@@ -15,8 +15,8 @@ jobs:
|
|
15
15
|
strategy:
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
|
-
ruby: ['3.
|
19
|
-
es_version: ['8.
|
18
|
+
ruby: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.3', 'jruby-9.4']
|
19
|
+
es_version: ['8.18.8-SNAPSHOT', '8.19.5-SNAPSHOT', '9.0.8-SNAPSHOT', '9.1.5-SNAPSHOT', '9.2.0-SNAPSHOT']
|
20
20
|
runs-on: ubuntu-latest
|
21
21
|
steps:
|
22
22
|
- uses: actions/checkout@v4
|
@@ -53,8 +53,8 @@ jobs:
|
|
53
53
|
strategy:
|
54
54
|
fail-fast: false
|
55
55
|
matrix:
|
56
|
-
ruby: ['3.
|
57
|
-
es_version: ['8.
|
56
|
+
ruby: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.3']
|
57
|
+
es_version: ['8.19.5-SNAPSHOT']
|
58
58
|
runs-on: ubuntu-latest
|
59
59
|
steps:
|
60
60
|
- uses: actions/checkout@v4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 8.3.6
|
2
|
+
|
3
|
+
- Moves `require 'timeout'` to the classes that use it. Closed [#79](https://github.com/elastic/elastic-transport-ruby/issues/79).
|
4
|
+
- Sanitize url on OTEL spans, thanks @steve21168. Pull Request: [#98](https://github.com/elastic/elastic-transport-ruby/pull/98)
|
5
|
+
|
1
6
|
## 8.3.5
|
2
7
|
|
3
8
|
- Small updates in source code documentation.
|
@@ -195,7 +195,7 @@ module Elastic
|
|
195
195
|
#
|
196
196
|
def __log_response(method, path, params, body, url, response, json, took, duration)
|
197
197
|
if logger
|
198
|
-
sanitized_url = url.to_s
|
198
|
+
sanitized_url = sanitize_url(url.to_s)
|
199
199
|
log_info "#{method.to_s.upcase} #{sanitized_url} " +
|
200
200
|
"[status:#{response.status}, request:#{sprintf('%.3fs', duration)}, query:#{took}]"
|
201
201
|
log_debug "> #{__convert_to_json(body)}" if body
|
@@ -472,9 +472,13 @@ module Elastic
|
|
472
472
|
end
|
473
473
|
end
|
474
474
|
|
475
|
+
def sanitize_url(url)
|
476
|
+
url.to_s.gsub(/\/\/(.+):(.+)@/, '//' + '\1:' + SANITIZED_PASSWORD + '@')
|
477
|
+
end
|
478
|
+
|
475
479
|
def capture_otel_span_attributes(connection, url)
|
476
480
|
if defined?(::OpenTelemetry)
|
477
|
-
::OpenTelemetry::Trace.current_span&.set_attribute('url.full', url)
|
481
|
+
::OpenTelemetry::Trace.current_span&.set_attribute('url.full', sanitize_url(url))
|
478
482
|
::OpenTelemetry::Trace.current_span&.set_attribute('server.address', connection.host[:host])
|
479
483
|
::OpenTelemetry::Trace.current_span&.set_attribute('server.port', connection.host[:port].to_i)
|
480
484
|
end
|
data/lib/elastic/transport.rb
CHANGED
@@ -320,6 +320,22 @@ if defined?(::OpenTelemetry)
|
|
320
320
|
end
|
321
321
|
end
|
322
322
|
end
|
323
|
+
|
324
|
+
context 'sanitize in URL' do
|
325
|
+
let(:client) {
|
326
|
+
Elastic::Transport::Client.new(host: 'http://elastic:changeme@localhost:9250')
|
327
|
+
}
|
328
|
+
|
329
|
+
it 'sanitizes URL' do
|
330
|
+
client.perform_request(
|
331
|
+
'GET', '/', {}, nil, {}
|
332
|
+
)
|
333
|
+
|
334
|
+
span = exporter.finished_spans.find { |s| s.name == 'GET' }
|
335
|
+
expect(span.name).to eql('GET')
|
336
|
+
expect(span.attributes['url.full']).to match(/http:\/\/elastic:\*+@localhost:9250/)
|
337
|
+
end
|
338
|
+
end
|
323
339
|
end
|
324
340
|
end
|
325
341
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.3.
|
4
|
+
version: 8.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic Client Library Maintainers
|
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: faraday
|
@@ -257,8 +256,8 @@ email:
|
|
257
256
|
executables: []
|
258
257
|
extensions: []
|
259
258
|
extra_rdoc_files:
|
260
|
-
- README.md
|
261
259
|
- LICENSE
|
260
|
+
- README.md
|
262
261
|
files:
|
263
262
|
- ".github/check_license_headers.rb"
|
264
263
|
- ".github/license-header.txt"
|
@@ -324,7 +323,6 @@ metadata:
|
|
324
323
|
changelog_uri: https://github.com/elastic/elastic-transport-ruby/blob/master/CHANGELOG.md
|
325
324
|
source_code_uri: https://github.com/elastic/elastic-transport-ruby
|
326
325
|
bug_tracker_uri: https://github.com/elastic/elastic-transport-ruby/issues
|
327
|
-
post_install_message:
|
328
326
|
rdoc_options:
|
329
327
|
- "--charset=UTF-8"
|
330
328
|
require_paths:
|
@@ -340,8 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
338
|
- !ruby/object:Gem::Version
|
341
339
|
version: '0'
|
342
340
|
requirements: []
|
343
|
-
rubygems_version: 3.
|
344
|
-
signing_key:
|
341
|
+
rubygems_version: 3.6.9
|
345
342
|
specification_version: 4
|
346
343
|
summary: Low level Ruby client for Elastic services.
|
347
344
|
test_files:
|