opentelemetry-instrumentation-faraday 0.24.8 → 0.25.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: 6d77c32dd025abec6065c2178b3bb4f5b8b1e30f8346c144c90a69f842fe0e94
4
- data.tar.gz: d2b7de74cb08ba24ea51979f8766b357255ce9154d71cb9fcf4cbc28d074bd06
3
+ metadata.gz: ef531ecfdcc07ba765a21743d3787b8d6de244b2b371241cd5121d775c7c679b
4
+ data.tar.gz: 33df6f2dd61589ffdf001c3577679f944b52ff2d287fcf6cfc456f3de3f28cae
5
5
  SHA512:
6
- metadata.gz: affd8957e6074906a6471b0341d66e5f0df2e7b646994ed4940939270509a41cc1287faa0171d0c00b95aa0c3908c574ce9d28b27ab16c124458d3ff78c037e2
7
- data.tar.gz: d3cfa506f11913c13bc71ca202f124821399ac2066993d69b06a052a176a8475ac708f968449e4b42dfe59a7679f5796f68c752f268a7d9b33d99dca28f3c700
6
+ metadata.gz: 287d1fd9d8468da07f37b2ba1c2af2292a88f0fc34bd581111c4dbd7d5e375d9f72260de1b10ec74ff690bf2913d73c2e4da829c047df05472e12aa2bc2cc858
7
+ data.tar.gz: 657f53bae563c8f50ae349e30e56411292f2e5be8a7bc910eb4506aa8eff8c6f3df6f8e46be085de9032869439ed68d3ff203180ae101addb4840a4800e2b6fe
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-faraday
2
2
 
3
+ ### v0.25.0 / 2025-01-07
4
+
5
+ * ADDED: Faraday Minimum v1.0
6
+
3
7
  ### v0.24.8 / 2024-12-17
4
8
 
5
9
  * FIXED: Share Faraday Attrs with Adapter Spans
@@ -10,12 +10,18 @@ module OpenTelemetry
10
10
  # The Instrumentation class contains logic to detect and install the Faraday
11
11
  # instrumentation
12
12
  class Instrumentation < OpenTelemetry::Instrumentation::Base
13
+ MINIMUM_VERSION = Gem::Version.new('1.0')
14
+
13
15
  install do |_config|
14
16
  require_dependencies
15
17
  register_tracer_middleware
16
18
  use_middleware_by_default
17
19
  end
18
20
 
21
+ compatible do
22
+ gem_version >= MINIMUM_VERSION
23
+ end
24
+
19
25
  present do
20
26
  defined?(::Faraday)
21
27
  end
@@ -25,10 +31,13 @@ module OpenTelemetry
25
31
 
26
32
  private
27
33
 
34
+ def gem_version
35
+ Gem::Version.new(::Faraday::VERSION)
36
+ end
37
+
28
38
  def require_dependencies
29
39
  require_relative 'middlewares/tracer_middleware'
30
40
  require_relative 'patches/connection'
31
- require_relative 'patches/rack_builder'
32
41
  end
33
42
 
34
43
  def register_tracer_middleware
@@ -38,11 +47,7 @@ module OpenTelemetry
38
47
  end
39
48
 
40
49
  def use_middleware_by_default
41
- if Gem::Version.new(::Faraday::VERSION) >= Gem::Version.new('1')
42
- ::Faraday::Connection.prepend(Patches::Connection)
43
- else
44
- ::Faraday::RackBuilder.prepend(Patches::RackBuilder)
45
- end
50
+ ::Faraday::Connection.prepend(Patches::Connection)
46
51
  end
47
52
  end
48
53
  end
@@ -13,7 +13,7 @@ module OpenTelemetry
13
13
  module Connection
14
14
  # Wraps Faraday::Connection#initialize:
15
15
  # https://github.com/lostisland/faraday/blob/ff9dc1d1219a1bbdba95a9a4cf5d135b97247ee2/lib/faraday/connection.rb#L62-L92
16
- def initialize(*args)
16
+ def initialize(...)
17
17
  super.tap do
18
18
  use(:open_telemetry) unless builder.handlers.any? do |handler|
19
19
  handler.klass == Middlewares::TracerMiddleware
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Faraday
10
- VERSION = '0.24.8'
10
+ VERSION = '0.25.0'
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-faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.8
4
+ version: 0.25.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: 2024-12-17 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -195,16 +195,15 @@ files:
195
195
  - lib/opentelemetry/instrumentation/faraday/instrumentation.rb
196
196
  - lib/opentelemetry/instrumentation/faraday/middlewares/tracer_middleware.rb
197
197
  - lib/opentelemetry/instrumentation/faraday/patches/connection.rb
198
- - lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb
199
198
  - lib/opentelemetry/instrumentation/faraday/version.rb
200
199
  homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
201
200
  licenses:
202
201
  - Apache-2.0
203
202
  metadata:
204
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-faraday/0.24.8/file/CHANGELOG.md
203
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-faraday/0.25.0/file/CHANGELOG.md
205
204
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/faraday
206
205
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
207
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-faraday/0.24.8
206
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-faraday/0.25.0
208
207
  post_install_message:
209
208
  rdoc_options: []
210
209
  require_paths:
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright The OpenTelemetry Authors
4
- #
5
- # SPDX-License-Identifier: Apache-2.0
6
-
7
- module OpenTelemetry
8
- module Instrumentation
9
- module Faraday
10
- module Patches
11
- # Module to be prepended to force Faraday to use the middleware by
12
- # default so the user doesn't have to call `use` for every connection.
13
- module RackBuilder
14
- def adapter(*args)
15
- use(:open_telemetry) unless @handlers.any? do |handler|
16
- handler.klass == Faraday::Middlewares::TracerMiddleware
17
- end
18
-
19
- super
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end