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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/instrumentation/faraday/instrumentation.rb +11 -6
- data/lib/opentelemetry/instrumentation/faraday/patches/connection.rb +1 -1
- data/lib/opentelemetry/instrumentation/faraday/version.rb +1 -1
- metadata +4 -5
- data/lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef531ecfdcc07ba765a21743d3787b8d6de244b2b371241cd5121d775c7c679b
|
4
|
+
data.tar.gz: 33df6f2dd61589ffdf001c3577679f944b52ff2d287fcf6cfc456f3de3f28cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287d1fd9d8468da07f37b2ba1c2af2292a88f0fc34bd581111c4dbd7d5e375d9f72260de1b10ec74ff690bf2913d73c2e4da829c047df05472e12aa2bc2cc858
|
7
|
+
data.tar.gz: 657f53bae563c8f50ae349e30e56411292f2e5be8a7bc910eb4506aa8eff8c6f3df6f8e46be085de9032869439ed68d3ff203180ae101addb4840a4800e2b6fe
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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(
|
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
|
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.
|
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:
|
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.
|
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.
|
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
|