hubstep 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/lib/hubstep/faraday/middleware.rb +28 -2
- data/lib/hubstep/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 931085ea4e5c72ee66f49d6e2a706bfadfcff707
|
4
|
+
data.tar.gz: 7699cc179fdb410ecfa67b909f9363bc1ee94df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ecb9021740887aba98a9c13f3082394226b5d081bac1b6f456d1f6699a8c6034742d3fc19c4f2e0e7a11d86da6e9c8abc93d81b751d89258329ad5b394ba281
|
7
|
+
data.tar.gz: abd2f91b4c15b8d75fe98549aaec282058036270aca42adf0d8e00d63b50d51a2e3213c9585964217521b2894be1125433a5ddfa3efa9e0fe6daa598d7b310a7
|
data/.rubocop.yml
CHANGED
@@ -13,6 +13,25 @@ module HubStep
|
|
13
13
|
# b.adapter(:typhoeus)
|
14
14
|
# end
|
15
15
|
class Middleware < ::Faraday::Middleware
|
16
|
+
class << self
|
17
|
+
# Set a URI parser.
|
18
|
+
#
|
19
|
+
# parser - An object that responds to `parse`
|
20
|
+
#
|
21
|
+
def uri_parser=(parser)
|
22
|
+
if parser == :default
|
23
|
+
parser = URI
|
24
|
+
end
|
25
|
+
@uri_parser = parser
|
26
|
+
end
|
27
|
+
|
28
|
+
# Get the URI parser.
|
29
|
+
attr_reader :uri_parser
|
30
|
+
end
|
31
|
+
|
32
|
+
# Default the uri_parser
|
33
|
+
self.uri_parser = :default
|
34
|
+
|
16
35
|
# Create a Middleware
|
17
36
|
#
|
18
37
|
# tracer - a HubStep::Tracer instance
|
@@ -56,8 +75,15 @@ module HubStep
|
|
56
75
|
url = request_env[:url]
|
57
76
|
span.set_tag("http.url", url) if @include_urls
|
58
77
|
|
59
|
-
|
60
|
-
|
78
|
+
begin
|
79
|
+
uri = self.class.uri_parser.parse(url.to_s)
|
80
|
+
domain = uri.host
|
81
|
+
rescue => e
|
82
|
+
HubStep.instrumenter.instrument("hubstep.faraday.middleware.error", error: e)
|
83
|
+
domain = nil
|
84
|
+
end
|
85
|
+
|
86
|
+
span.set_tag("http.domain", domain)
|
61
87
|
end
|
62
88
|
|
63
89
|
def record_response(span, response_env)
|
data/lib/hubstep/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubstep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lightstep
|