appsignal 3.8.0-java → 3.8.1-java

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: ea91daa3ea445a106491fad55612667e26c7198f1e601308dffae2bec2ccb0f9
4
- data.tar.gz: 152b8860752631fd41779d8648a0236ee34a7bd2629452011926d6d9cb9aea2d
3
+ metadata.gz: ddf04573e8eddcf88fbe66caa2ec76605a1cf39e7867578b35daca0dd625aaf6
4
+ data.tar.gz: ecda706a29b6aea7d52d3620cebb984495c85937acf561a596826fd57c457095
5
5
  SHA512:
6
- metadata.gz: 5b26be3efaa921c8402c47d6b28fd8c5603d2c3b43e496c8645b5d154f85084def2f32ac6512d708501f215072edfebf27a0fd5524031cb736e29ae4b8c113b8
7
- data.tar.gz: fdc354654701f26ae6124df92b45453f1791e3fe9d66ebb36dde90492a98da9fda3394dbc30d7940d53205700a8b558b566243ca0d09e4de847dc1b07ee99c18
6
+ metadata.gz: 1806b5e232c00df359eaba8bc66bd9fc1239237ef67c08d73469d5ee471c609d1b712d1452f7c796d623c3e76489ff29214e877173083c5097aa4ce7d42ad601
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: java
6
6
  authors:
7
7
  - Robert Beekman