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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb665c8606b2dea836702e2e4cd1baa4d0684230e245e058a9701ae42cc84e33
4
- data.tar.gz: 152b8860752631fd41779d8648a0236ee34a7bd2629452011926d6d9cb9aea2d
3
+ metadata.gz: f68ce83624657d12b65c203950c7a92681d621bc9f5644fcc61d4123417e8e93
4
+ data.tar.gz: ecda706a29b6aea7d52d3620cebb984495c85937acf561a596826fd57c457095
5
5
  SHA512:
6
- metadata.gz: 9c004f89b5f735367b13404278d8049ff990d7e87baf566a41cf0fdd901d991fbc61c48ac0c1e946abc4f3a934dc53ffac70839a947775017bd66c8fd7c951ac
7
- data.tar.gz: fdc354654701f26ae6124df92b45453f1791e3fe9d66ebb36dde90492a98da9fda3394dbc30d7940d53205700a8b558b566243ca0d09e4de847dc1b07ee99c18
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, _response)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.8.0"
4
+ VERSION = "3.8.1"
5
5
  end
@@ -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")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman