appsignal 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/appsignal/rack/event_handler.rb +8 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/rack/event_handler_spec.rb +19 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f68ce83624657d12b65c203950c7a92681d621bc9f5644fcc61d4123417e8e93
|
4
|
+
data.tar.gz: ecda706a29b6aea7d52d3620cebb984495c85937acf561a596826fd57c457095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec9d7754da4808d85efd335d8e9c00bca8f0e2c16f7a4a9246b9bd9d679519c7550202c1d2f809c786e117cde31c76c8c3405664b9878b9b8c61724a05dca14
|
7
|
+
data.tar.gz: 955a45291f05e0df7456ae7bef0c7d9be55824b764429a6fffd72985ee252dcf83893e824a610d086c82c0050ae14bb6ddebc6baaf600946c1d50ce55a3ae4d7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 3.8.1
|
4
|
+
|
5
|
+
_Published on 2024-06-17._
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- [5459a021](https://github.com/appsignal/appsignal-ruby/commit/5459a021d7d4bbbd09a0dcbdf5f3af7bf861b6f5) patch - Report the response status for Rails requests as the `response_status` tag on samples, e.g. 200, 301, 500. This tag is visible on the sample detail page.
|
10
|
+
|
11
|
+
The response status is also reported as the `response_status` metric.
|
12
|
+
|
3
13
|
## 3.8.0
|
4
14
|
|
5
15
|
_Published on 2024-06-17._
|
@@ -55,13 +55,20 @@ module Appsignal
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def on_finish(request,
|
58
|
+
def on_finish(request, response)
|
59
59
|
self.class.safe_execution("Appsignal::Rack::EventHandler#on_finish") do
|
60
60
|
transaction = request.env[APPSIGNAL_TRANSACTION]
|
61
61
|
return unless transaction
|
62
62
|
|
63
63
|
transaction.finish_event("process_request.rack", "", "")
|
64
|
+
transaction.set_tags(:response_status => response.status)
|
64
65
|
transaction.set_http_or_background_queue_start
|
66
|
+
Appsignal.increment_counter(
|
67
|
+
:response_status,
|
68
|
+
1,
|
69
|
+
:status => response.status,
|
70
|
+
:namespace => format_namespace(transaction.namespace)
|
71
|
+
)
|
65
72
|
|
66
73
|
# Make sure the current transaction is always closed when the request
|
67
74
|
# is finished
|
data/lib/appsignal/version.rb
CHANGED
@@ -183,6 +183,25 @@ describe Appsignal::Rack::EventHandler do
|
|
183
183
|
)
|
184
184
|
end
|
185
185
|
|
186
|
+
it "sets the response status as a tag" do
|
187
|
+
on_start
|
188
|
+
on_finish
|
189
|
+
|
190
|
+
expect(last_transaction.to_h).to include(
|
191
|
+
"sample_data" => hash_including(
|
192
|
+
"tags" => { "response_status" => 200 }
|
193
|
+
)
|
194
|
+
)
|
195
|
+
end
|
196
|
+
|
197
|
+
it "increments the response status counter for response status" do
|
198
|
+
expect(Appsignal).to receive(:increment_counter)
|
199
|
+
.with(:response_status, 1, :status => 200, :namespace => :web)
|
200
|
+
|
201
|
+
on_start
|
202
|
+
on_finish
|
203
|
+
end
|
204
|
+
|
186
205
|
it "logs an error in case of an error" do
|
187
206
|
expect(Appsignal::Transaction)
|
188
207
|
.to receive(:complete_current!).and_raise(ExampleStandardError, "oh no")
|