async-http 0.90.2 → 0.91.0

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: 9f3d3f7847e4ca1d36ea14f2e2a429aaee69540f417eccde36d0e78b046cdd04
4
- data.tar.gz: 72254daf856acd1339850a6af190dc3aa302483b00a31891bbc0bcbb41edbe4d
3
+ metadata.gz: ae6c0e0cd15050304be680a8c0b5e49447fb83c6533b7aefebec427a83ae3aac
4
+ data.tar.gz: 614910bd99032d2f19672876eada276fba03a887feafec21f3a50263410f272e
5
5
  SHA512:
6
- metadata.gz: d116c25e3ef63211b53222cc2baf36c7469b4da0526d464a30981bbde0e18abdf1860bb4f84a2ac19e89a4ea9ed1f43698e08139214773092e2dd82f74cb8233
7
- data.tar.gz: 5550db7a5ddca2f6e0512184a5706504226315337af5eaa357a1f9756afcc01718ce09e00e06cd845c52c19d3ec45180fbbcf4f6447942f767cf9fc73dd29e41
6
+ metadata.gz: 301c38b5c92a927d11d73420e88a47442e3dbcc7445850bb269412dc1c2c4edf3dd97456e8bbbed13de1fa013dec139652b274248ae882e294ce48912d3935e9
7
+ data.tar.gz: 6e2dc40b2761b4484191368b2ebadea5045d1d35c28306bbd09b97d5433badeb1c5e31a1c9af54222e7583377488bdcf4f300b545882d7ed1d303c2470c13716
checksums.yaml.gz.sig CHANGED
Binary file
@@ -11,8 +11,6 @@ require "async/pool/controller"
11
11
  require "protocol/http/body/completable"
12
12
  require "protocol/http/methods"
13
13
 
14
- require "traces/provider"
15
-
16
14
  require_relative "protocol"
17
15
 
18
16
  module Async
@@ -168,56 +166,6 @@ module Async
168
166
  @protocol.client(@endpoint.connect)
169
167
  end
170
168
  end
171
-
172
- Traces::Provider(self) do
173
- def call(request)
174
- attributes = {
175
- 'http.method': request.method,
176
- 'http.authority': request.authority || self.authority,
177
- 'http.scheme': request.scheme || self.scheme,
178
- 'http.path': request.path,
179
- }
180
-
181
- if protocol = request.protocol
182
- attributes["http.protocol"] = protocol
183
- end
184
-
185
- if length = request.body&.length
186
- attributes["http.request.length"] = length
187
- end
188
-
189
- Traces.trace("async.http.client.call", attributes: attributes) do |span|
190
- if context = Traces.trace_context
191
- request.headers["traceparent"] = context.to_s
192
- # request.headers['tracestate'] = context.state
193
- end
194
-
195
- super.tap do |response|
196
- if version = response&.version
197
- span["http.version"] = version
198
- end
199
-
200
- if status = response&.status
201
- span["http.status_code"] = status
202
- end
203
-
204
- if length = response.body&.length
205
- span["http.response.length"] = length
206
- end
207
- end
208
- end
209
- end
210
-
211
- def make_response(request, connection, attempt)
212
- attributes = {
213
- attempt: attempt,
214
- }
215
-
216
- Traces.trace("async.http.client.make_response", attributes: attributes) do
217
- super
218
- end
219
- end
220
- end
221
169
  end
222
170
  end
223
171
  end
@@ -5,8 +5,6 @@
5
5
 
6
6
  require_relative "connection"
7
7
 
8
- require "traces/provider"
9
-
10
8
  module Async
11
9
  module HTTP
12
10
  module Protocol
@@ -88,20 +86,6 @@ module Async
88
86
  self.close(error)
89
87
  raise
90
88
  end
91
-
92
- Traces::Provider(self) do
93
- def write_request(...)
94
- Traces.trace("async.http.protocol.http1.client.write_request") do
95
- super
96
- end
97
- end
98
-
99
- def read_response(...)
100
- Traces.trace("async.http.protocol.http1.client.read_response") do
101
- super
102
- end
103
- end
104
- end
105
89
  end
106
90
  end
107
91
  end
@@ -6,7 +6,6 @@
6
6
  require_relative "connection"
7
7
  require_relative "response"
8
8
 
9
- require "traces/provider"
10
9
  require "protocol/http2/client"
11
10
 
12
11
  module Async
@@ -46,20 +45,6 @@ module Async
46
45
  def read_response(response)
47
46
  response.wait
48
47
  end
49
-
50
- Traces::Provider(self) do
51
- def write_request(...)
52
- Traces.trace("async.http.protocol.http2.client.write_request") do
53
- super
54
- end
55
- end
56
-
57
- def read_response(...)
58
- Traces.trace("async.http.protocol.http2.client.read_response") do
59
- super
60
- end
61
- end
62
- end
63
48
  end
64
49
  end
65
50
  end
@@ -7,7 +7,6 @@
7
7
  require "async"
8
8
  require "io/endpoint"
9
9
  require "protocol/http/middleware"
10
- require "traces/provider"
11
10
 
12
11
  require_relative "protocol"
13
12
 
@@ -70,43 +69,6 @@ module Async
70
69
  task.children.each(&:wait)
71
70
  end
72
71
  end
73
-
74
- Traces::Provider(self) do
75
- def call(request)
76
- if trace_parent = request.headers["traceparent"]
77
- Traces.trace_context = Traces::Context.parse(trace_parent.join, request.headers["tracestate"], remote: true)
78
- end
79
-
80
- attributes = {
81
- 'http.version': request.version,
82
- 'http.method': request.method,
83
- 'http.authority': request.authority,
84
- 'http.scheme': request.scheme,
85
- 'http.path': request.path,
86
- 'http.user_agent': request.headers["user-agent"],
87
- }
88
-
89
- if length = request.body&.length
90
- attributes["http.request.length"] = length
91
- end
92
-
93
- if protocol = request.protocol
94
- attributes["http.protocol"] = protocol
95
- end
96
-
97
- Traces.trace("async.http.server.call", attributes: attributes) do |span|
98
- super.tap do |response|
99
- if status = response&.status
100
- span["http.status_code"] = status
101
- end
102
-
103
- if length = response&.body&.length
104
- span["http.response.length"] = length
105
- end
106
- end
107
- end
108
- end
109
- end
110
72
  end
111
73
  end
112
74
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module HTTP
8
- VERSION = "0.90.2"
8
+ VERSION = "0.91.0"
9
9
  end
10
10
  end
@@ -0,0 +1,51 @@
1
+ require_relative "../../../../async/http/client"
2
+
3
+ Traces::Provider(Async::HTTP::Client) do
4
+ def call(request)
5
+ attributes = {
6
+ 'http.method': request.method,
7
+ 'http.authority': request.authority || self.authority,
8
+ 'http.scheme': request.scheme || self.scheme,
9
+ 'http.path': request.path,
10
+ }
11
+
12
+ if protocol = request.protocol
13
+ attributes["http.protocol"] = protocol
14
+ end
15
+
16
+ if length = request.body&.length
17
+ attributes["http.request.length"] = length
18
+ end
19
+
20
+ Traces.trace("async.http.client.call", attributes: attributes) do |span|
21
+ if context = Traces.trace_context
22
+ request.headers["traceparent"] = context.to_s
23
+ # request.headers['tracestate'] = context.state
24
+ end
25
+
26
+ super.tap do |response|
27
+ if version = response&.version
28
+ span["http.version"] = version
29
+ end
30
+
31
+ if status = response&.status
32
+ span["http.status_code"] = status
33
+ end
34
+
35
+ if length = response.body&.length
36
+ span["http.response.length"] = length
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ def make_response(request, connection, attempt)
43
+ attributes = {
44
+ attempt: attempt,
45
+ }
46
+
47
+ Traces.trace("async.http.client.make_response", attributes: attributes) do
48
+ super
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,15 @@
1
+ require_relative "../../../../../../async/http/protocol/http1/client"
2
+
3
+ Traces::Provider(Async::HTTP::Protocol::HTTP1::Client) do
4
+ def write_request(...)
5
+ Traces.trace("async.http.protocol.http1.client.write_request") do
6
+ super
7
+ end
8
+ end
9
+
10
+ def read_response(...)
11
+ Traces.trace("async.http.protocol.http1.client.read_response") do
12
+ super
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require_relative "../../../../../../async/http/protocol/http2/client"
2
+
3
+ Traces::Provider(Async::HTTP::Protocol::HTTP2::Client) do
4
+ def write_request(...)
5
+ Traces.trace("async.http.protocol.http2.client.write_request") do
6
+ super
7
+ end
8
+ end
9
+
10
+ def read_response(...)
11
+ Traces.trace("async.http.protocol.http2.client.read_response") do
12
+ super
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,38 @@
1
+ require_relative "../../../../async/http/server"
2
+
3
+ Traces::Provider(Async::HTTP::Server) do
4
+ def call(request)
5
+ if trace_parent = request.headers["traceparent"]
6
+ Traces.trace_context = Traces::Context.parse(trace_parent.join, request.headers["tracestate"], remote: true)
7
+ end
8
+
9
+ attributes = {
10
+ 'http.version': request.version,
11
+ 'http.method': request.method,
12
+ 'http.authority': request.authority,
13
+ 'http.scheme': request.scheme,
14
+ 'http.path': request.path,
15
+ 'http.user_agent': request.headers["user-agent"],
16
+ }
17
+
18
+ if length = request.body&.length
19
+ attributes["http.request.length"] = length
20
+ end
21
+
22
+ if protocol = request.protocol
23
+ attributes["http.protocol"] = protocol
24
+ end
25
+
26
+ Traces.trace("async.http.server.call", attributes: attributes) do |span|
27
+ super.tap do |response|
28
+ if status = response&.status
29
+ span["http.status_code"] = status
30
+ end
31
+
32
+ if length = response&.body&.length
33
+ span["http.response.length"] = length
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,2 @@
1
+ require_relative "http/client"
2
+ require_relative "http/server"
data/readme.md CHANGED
@@ -16,6 +16,10 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
16
16
 
17
17
  Please see the [project releases](https://socketry.github.io/async-http/releases/index) for all releases.
18
18
 
19
+ ### v0.91.0
20
+
21
+ - Move all default trace providers into `traces/provider/async/http`.
22
+
19
23
  ### v0.90.2
20
24
 
21
25
  - Don't emit `resource:` keyword argument in traces - it's unsupported by OpenTelemetry.
@@ -55,10 +59,6 @@ Please see the [project releases](https://socketry.github.io/async-http/releases
55
59
  - Remove `Async::HTTP::Body::Delayed` with no replacement.
56
60
  - Remove `Async::HTTP::Body::Slowloris` with no replacement.
57
61
 
58
- ### v0.75.0
59
-
60
- - Better handling of HTTP/1 \<-\> HTTP/2 proxying, specifically upgrade/CONNECT requests.
61
-
62
62
  ## See Also
63
63
 
64
64
  - [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.91.0
4
+
5
+ - Move all default trace providers into `traces/provider/async/http`.
6
+
3
7
  ## v0.90.2
4
8
 
5
9
  - Don't emit `resource:` keyword argument in traces - it's unsupported by OpenTelemetry.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.90.2
4
+ version: 0.91.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -238,6 +238,11 @@ files:
238
238
  - lib/metrics/provider/async/http.rb
239
239
  - lib/metrics/provider/async/http/client.rb
240
240
  - lib/metrics/provider/async/http/server.rb
241
+ - lib/traces/provider/async/http.rb
242
+ - lib/traces/provider/async/http/client.rb
243
+ - lib/traces/provider/async/http/protocol/http1/client.rb
244
+ - lib/traces/provider/async/http/protocol/http2/client.rb
245
+ - lib/traces/provider/async/http/server.rb
241
246
  - license.md
242
247
  - readme.md
243
248
  - releases.md
metadata.gz.sig CHANGED
Binary file