atatus 2.1.0 → 2.2.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: e583b9f10ae2db24b5ffedfe79959daf38c6b1b947a0cb71ddcf2fb1005e6495
4
- data.tar.gz: 5db30ee5dd57494608263eeb2b45943a81dbd5eb8bce84a8e19fecad49ba2650
3
+ metadata.gz: e16d23e821e766b1cca553a2957eda55f3c7fc32e5bd39f11c8c8921b4d0fb80
4
+ data.tar.gz: 0f32d4913f859a284aec06e8a2a539a771ff0c58e17571b9ba563a381a3653be
5
5
  SHA512:
6
- metadata.gz: 2e88330ad4178a8b991792e2c518e2b4b4d9144508365953b8e2528fad479b01fe6d445487adf3d00c31315119ecab8a146b673145fd6cc76dda9b57ed145f03
7
- data.tar.gz: f522a2e7f232b8892b7f8a4a07a36c39fa982a4cad992c3e4edd7ef7100b7a0df2309876670f4e5f17e391703170f4a9ddd9184447c8354de05bc5e1ebf5dca1
6
+ metadata.gz: df6054fadf85753da0a9459cad54ab3efcfd2e031bd9e8d9eb89bb608fb54cd75f03c13abdc1f404f2c2bf2f8d28bc028fa54b4efcd0fd5a6b69d4a0cf56545b
7
+ data.tar.gz: 7574c2d6e0b872980b339c8d8cb7e185d2e86651bdc7a1c8290696e6df8e22442adb342ec859a5fca101955e1c357f3a339a23bf0db771ced38c7b3dfb5d92e7
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 2.2.0 (Wed, 29 Apr 2026)
8
+
9
+ - Added support for default ruby exceptions.
10
+ - Added support for query params and request headers in exceptions.
11
+
12
+
7
13
  ## 2.1.0 (Wed, 7 Jan 2026)
8
14
 
9
15
  - Fixed host details fetching issue in docker.
@@ -571,7 +571,11 @@ module Atatus
571
571
 
572
572
  if @collect_counter % 30 == 0
573
573
  @hostinfo_response = @transport.hostinfo(start_time)
574
- @config.transaction_ignore_urls = @transaction_ignore_urls | @hostinfo_response["ignoreTxnUrlPatterns"]
574
+
575
+ if @hostinfo_response.key?("ignoreTxnUrlPatterns")
576
+ @config.transaction_ignore_urls = @transaction_ignore_urls | @hostinfo_response["ignoreTxnUrlPatterns"]
577
+ end
578
+
575
579
  if @hostinfo_response.key?("errorLimit")
576
580
  @error_limit = @hostinfo_response["errorLimit"]
577
581
  end
@@ -198,6 +198,7 @@ module Atatus
198
198
  request[:method] = r.method if !r.method.nil?
199
199
  if !r.headers.nil?
200
200
  h = r.headers
201
+ request[:headers] = h
201
202
  request[:accept] = h['Accept'] if h.key?('Accept')
202
203
  request[:'accept-encoding'] = h['Accept-Encoding'] if h.key?('Accept-Encoding')
203
204
  request[:'accept-language'] = h['Accept-Language'] if h.key?('Accept-Language')
@@ -208,7 +209,13 @@ module Atatus
208
209
  u = r.url
209
210
  request[:host] = u.hostname if !u.hostname.nil?
210
211
  request[:port] = (u.port).to_i if !u.port.nil?
211
- request[:path] = u.pathname if !u.pathname.nil?
212
+
213
+ path_name = u.pathname if !u.pathname.nil?
214
+ query_param = u.search != '' ? ('?' + u.search) : ''
215
+ final_path = path_name + query_param
216
+
217
+ request[:path] = final_path
218
+ request[:url] = u.full
212
219
  end
213
220
  end
214
221
 
data/lib/atatus/config.rb CHANGED
@@ -151,6 +151,8 @@ module Atatus
151
151
 
152
152
  @__view_paths ||= []
153
153
  @__root_path ||= Dir.pwd
154
+
155
+ self.filter_exception_types = self.get_ignore_exceptions(:sinatra)
154
156
  end
155
157
 
156
158
  attr_accessor :__view_paths, :__root_path, :logger
@@ -354,6 +356,10 @@ module Atatus
354
356
  self.framework_name = framework_name || 'Sinatra'
355
357
  self.framework_version = framework_version || ::Sinatra::VERSION
356
358
  self.__root_path = Dir.pwd
359
+
360
+ if self.filter_exception_types.nil? || self.filter_exception_types.empty?
361
+ self.filter_exception_types = get_ignore_exceptions(:sinatra)
362
+ end
357
363
  end
358
364
 
359
365
  def set_rails(app)
@@ -366,6 +372,10 @@ module Atatus
366
372
  self.__root_path = ::Rails.root.to_s
367
373
  self.__view_paths = app.config.paths['app/views'].existent +
368
374
  [::Rails.root.to_s]
375
+
376
+ if self.filter_exception_types.nil? || self.filter_exception_types.empty?
377
+ self.filter_exception_types = get_ignore_exceptions(:rails)
378
+ end
369
379
  end
370
380
 
371
381
  def rails_app_name(app)
@@ -379,5 +389,39 @@ module Atatus
379
389
  def format_name(str)
380
390
  str&.gsub('::', '_')
381
391
  end
392
+
393
+ def get_ignore_exceptions(framework)
394
+ rails_exceptions = [
395
+ "AbstractController::ActionNotFound",
396
+ "ActionController::ParameterMissing",
397
+ "ActiveRecord::RecordNotFound",
398
+ "ActionController::BadRequest",
399
+ "ActionController::InvalidCrossOriginRequest",
400
+ "ActionController::UnknownFormat",
401
+ "ActionDispatch::Http::MimeNegotiation::InvalidType",
402
+ "ActionController::RoutingError",
403
+ "ActionController::InvalidAuthenticityToken",
404
+ "ActionController::NotImplemented",
405
+ "ActionController::UnknownHttpMethod",
406
+ "ActionDispatch::Http::Parameters::ParseError",
407
+ # "ActionController::MethodNotAllowed",
408
+ # "ActionController::UnknownAction",
409
+ ]
410
+
411
+ sinatra_exceptions = [
412
+ "Sinatra::NotFound",
413
+ "Rack::QueryParser::InvalidParameterError",
414
+ "Rack::QueryParser::ParameterTypeError",
415
+ ]
416
+
417
+ case framework
418
+ when :rails
419
+ rails_exceptions
420
+ when :sinatra
421
+ sinatra_exceptions
422
+ else
423
+ []
424
+ end
425
+ end
382
426
  end
383
427
  end
@@ -76,6 +76,7 @@ module Atatus
76
76
  error.transaction_id = transaction.id
77
77
  error.transaction_name = transaction.name
78
78
  error.transaction = {
79
+ name: transaction.name,
79
80
  sampled: transaction.sampled?,
80
81
  type: transaction.type
81
82
  }
@@ -87,6 +88,14 @@ module Atatus
87
88
  Util.reverse_merge!(error.context.labels, transaction.context.labels)
88
89
  Util.reverse_merge!(error.context.custom, transaction.context.custom)
89
90
 
91
+ # Copy request and response from transaction context
92
+ if transaction.context.request && !error.context.request
93
+ error.context.request = transaction.context.request
94
+ end
95
+ if transaction.context.response && !error.context.response
96
+ error.context.response = transaction.context.response
97
+ end
98
+
90
99
  return unless transaction.context.user
91
100
 
92
101
  error.context.user = transaction.context.user
@@ -19,5 +19,5 @@
19
19
 
20
20
  module Atatus
21
21
  AGENT_NAME = 'Ruby'
22
- VERSION = '2.1.0'
22
+ VERSION = '2.2.0'
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atatus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atatus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-07 00:00:00.000000000 Z
11
+ date: 2026-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby