appsignal 3.6.2-java → 3.6.3-java

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: 3a301e6247ef3ffd84430308f44d847483807a96c04356346fb0a281ad9bea0f
4
- data.tar.gz: ae2bd9370beec37c374885e5bf10b5316394243ed73038f5d377553734789597
3
+ metadata.gz: '087bfd6a23d24ba7a74aeb4307eef319da3613b6d6843dc61a7995715d242958'
4
+ data.tar.gz: 63ec67e524abc5fac18bb85746b0f45b3dcb3aa05870b23fb46d8cf44381054c
5
5
  SHA512:
6
- metadata.gz: a1ffcccbd922782d969fabd46828571c9137905674943f0aa790df83fcae7c71cfcc5ac26ab5a6d5227f1e461061ff00da8ccf38ade23bb86fe7c41137774251
7
- data.tar.gz: 9e732c7b94dfa76013a8def22d31202feb6c7e4ecffb74a74408e2787ed8ae7b98fd8477b9a2af7242edc35d912d65f2c60a9228ef2ce019574082919ae4d622
6
+ metadata.gz: 3b44722132c864d47321fa58a3c8493fdb51a734b988d994f0d2f269152372ae9df9844abb4158870020f9f30fe3b386e0a97fbe757300412b637bb069fe4d68
7
+ data.tar.gz: e7b735d7384c2c9ef43141b1eb2d2eb2704c9a42d23185fd7748bdb09e786afcf2717b2a8b80ad0401503f9f65b9dd510bbdc3545e48ce40a7e8a0f6ef5ee375
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.6.3
4
+
5
+ _Published on 2024-03-20._
6
+
7
+ ### Added
8
+
9
+ - [e50433fb](https://github.com/appsignal/appsignal-ruby/commit/e50433fbcb109ef741a889b0b7e78f16b884bd81) patch - Implement CPU count configuration option. Use it to override the auto-detected, cgroups-provided number of CPUs that is used to calculate CPU usage percentages.
10
+
11
+ To set it, use the the `cpu_count`
12
+ configuration option or the `APPSIGNAL_CPU_COUNT` environment variable.
13
+
14
+ ### Fixed
15
+
16
+ - [c6dd9779](https://github.com/appsignal/appsignal-ruby/commit/c6dd9779bb50dd9385da8962ccf1057ca1a44c7a) patch - Add request parameters, path and method tags to errors reported in controllers via the Rails error reporter.
17
+
3
18
  ## 3.6.2
4
19
 
5
20
  _Published on 2024-03-08._
@@ -1459,7 +1474,7 @@ Yanked
1459
1474
  - Support for arrays, literal value types and function arguments in sql lexer
1460
1475
 
1461
1476
  ## 1.2.2
1462
- - Handle out of range numbers in queue lenght and metrics api
1477
+ - Handle out of range numbers in queue length and metrics api
1463
1478
 
1464
1479
  ## 1.2.1
1465
1480
  - Use Dir.pwd in CLI install wizard
@@ -1484,7 +1499,7 @@ Yanked
1484
1499
  ## 1.1.7
1485
1500
  - Make logging resilient for closing FD's (daemons gem does this)
1486
1501
  - Add support for using Resque through ActiveJob
1487
- - Rescue more expections in json generation
1502
+ - Rescue more exceptions in json generation
1488
1503
 
1489
1504
  ## 1.1.6
1490
1505
  - Generic Rack instrumentation middleware
@@ -1534,7 +1549,7 @@ Yanked
1534
1549
  - Improved sql sanitization
1535
1550
  - Improved mongoid/mongodb sanitization
1536
1551
  - Minor performance improvements
1537
- - Better handling for non-utf8 convertable strings
1552
+ - Better handling for non-utf8 convertible strings
1538
1553
  - Make gem installable (but not functional) on JRuby
1539
1554
 
1540
1555
  ## 1.0.4
@@ -1715,7 +1730,7 @@ Yanked
1715
1730
  Yanked
1716
1731
 
1717
1732
  ## 0.8.8
1718
- - Explicitely require securerandom
1733
+ - Explicitly require securerandom
1719
1734
 
1720
1735
  ## 0.8.7
1721
1736
  - Dup process action event to avoid threading issue
data/Rakefile CHANGED
@@ -219,7 +219,7 @@ namespace :build do
219
219
  Gem::PackageTask.new(base_gemspec, &block)
220
220
  rescue StandardError => e
221
221
  puts "Warning: An error occurred defining `build:#{task_name}:gem` Rake task."
222
- puts "This task will not be availble."
222
+ puts "This task will not be available."
223
223
  if ENV["DEBUG"]
224
224
  puts "#{e}: #{e.message}"
225
225
  puts e.backtrace
data/ext/agent.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Modifications to this file will be overwritten with the next agent release.
7
7
 
8
8
  APPSIGNAL_AGENT_CONFIG = {
9
- "version" => "0.33.2",
9
+ "version" => "0.34.1",
10
10
  "mirrors" => [
11
11
  "https://appsignal-agent-releases.global.ssl.fastly.net",
12
12
  "https://d135dj0rjqvssy.cloudfront.net"
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
14
14
  "triples" => {
15
15
  "x86_64-darwin" => {
16
16
  "static" => {
17
- "checksum" => "0864691f001133fa479b34b00a682e76f374c40c161e7715756a3c036e3c8798",
17
+ "checksum" => "351f3dae916d3e84177d8cc35eaeaca5345f4deca9e0925a29353915cc0530d2",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "5141528c4293e4bd619107ae79afc8e07fdc8b33835899c5cf3f82ab3d31de8f",
21
+ "checksum" => "91ecacdf5e826dd21d5da26c07c5ecffd668cb16eaf15388d08a223425e716bb",
22
22
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
23
23
  }
24
24
  },
25
25
  "universal-darwin" => {
26
26
  "static" => {
27
- "checksum" => "0864691f001133fa479b34b00a682e76f374c40c161e7715756a3c036e3c8798",
27
+ "checksum" => "351f3dae916d3e84177d8cc35eaeaca5345f4deca9e0925a29353915cc0530d2",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "5141528c4293e4bd619107ae79afc8e07fdc8b33835899c5cf3f82ab3d31de8f",
31
+ "checksum" => "91ecacdf5e826dd21d5da26c07c5ecffd668cb16eaf15388d08a223425e716bb",
32
32
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
33
33
  }
34
34
  },
35
35
  "aarch64-darwin" => {
36
36
  "static" => {
37
- "checksum" => "13506e5911523e7107a8cb714e18b3bcb690f3eeef88bf9aff54777ba540fdc4",
37
+ "checksum" => "fd7359232fbd65f10ee565fcf65f4afa6d7a2ba1a8dead200c34736ca942df16",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "9d4deef17f42dc54981344a5af6b872e06dbd3d317be68b6abeb2403ffd65e23",
41
+ "checksum" => "a53ed8cc13d2821a4eee1ea7e4e58346125f27309973d4a2e8f059f129e927e2",
42
42
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
43
43
  }
44
44
  },
45
45
  "arm64-darwin" => {
46
46
  "static" => {
47
- "checksum" => "13506e5911523e7107a8cb714e18b3bcb690f3eeef88bf9aff54777ba540fdc4",
47
+ "checksum" => "fd7359232fbd65f10ee565fcf65f4afa6d7a2ba1a8dead200c34736ca942df16",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "9d4deef17f42dc54981344a5af6b872e06dbd3d317be68b6abeb2403ffd65e23",
51
+ "checksum" => "a53ed8cc13d2821a4eee1ea7e4e58346125f27309973d4a2e8f059f129e927e2",
52
52
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
53
53
  }
54
54
  },
55
55
  "arm-darwin" => {
56
56
  "static" => {
57
- "checksum" => "13506e5911523e7107a8cb714e18b3bcb690f3eeef88bf9aff54777ba540fdc4",
57
+ "checksum" => "fd7359232fbd65f10ee565fcf65f4afa6d7a2ba1a8dead200c34736ca942df16",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "9d4deef17f42dc54981344a5af6b872e06dbd3d317be68b6abeb2403ffd65e23",
61
+ "checksum" => "a53ed8cc13d2821a4eee1ea7e4e58346125f27309973d4a2e8f059f129e927e2",
62
62
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
63
63
  }
64
64
  },
65
65
  "aarch64-linux" => {
66
66
  "static" => {
67
- "checksum" => "76702b5755d5bb45cc05df17dd38389b7e20e105a52324120a45ae1b481c7881",
67
+ "checksum" => "dfbab18b7faa24684bf0ab57666b6b493356a3da43ecdba2e992b2d6d513cf31",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "bf518ce2cb4a9041fe819b6bf43e1bc793fe52b3e73527687d7812618c8e7407",
71
+ "checksum" => "865b8f034aa680aa6cdfe77cf117f071f9b5857c92cc7b6f36decfd5b2293b27",
72
72
  "filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
73
73
  }
74
74
  },
75
75
  "i686-linux" => {
76
76
  "static" => {
77
- "checksum" => "22cbda11a8d801d75e9394033f5cf28f0ddcff66a2138720f827441bdcf919c2",
77
+ "checksum" => "ce4a819f3eaa4590795497915e4a20b3fe281a0821364b80d26ffd1391af67a8",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "157492663e434421499f9cc0b510178387c8968e53bdc6e216db374b86d5c3dc",
81
+ "checksum" => "195d570b7f6b1ea5d2ced90dc12d68a6627e1886d078258b5483163e52afc620",
82
82
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
83
83
  }
84
84
  },
85
85
  "x86-linux" => {
86
86
  "static" => {
87
- "checksum" => "22cbda11a8d801d75e9394033f5cf28f0ddcff66a2138720f827441bdcf919c2",
87
+ "checksum" => "ce4a819f3eaa4590795497915e4a20b3fe281a0821364b80d26ffd1391af67a8",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "157492663e434421499f9cc0b510178387c8968e53bdc6e216db374b86d5c3dc",
91
+ "checksum" => "195d570b7f6b1ea5d2ced90dc12d68a6627e1886d078258b5483163e52afc620",
92
92
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
93
93
  }
94
94
  },
95
95
  "x86_64-linux" => {
96
96
  "static" => {
97
- "checksum" => "8ff0b1d7bf0cfc1c66e918545a9ab5c29be35c371cde48f64a01c725290599ed",
97
+ "checksum" => "e55f9ecb4e4b51e9232918216487712b63a7cfea9710763f61077e8d40d53dbe",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "a186c18536c3b7ec4802e852a62154cc976dcb5f554c3d0d8472d5cd7131b02b",
101
+ "checksum" => "b5edf38f4ac2725907995518a1d09dc09c70cae600d1d3a287e0b6404c2301d2",
102
102
  "filename" => "appsignal-x86_64-linux-all-dynamic.tar.gz"
103
103
  }
104
104
  },
105
105
  "x86_64-linux-musl" => {
106
106
  "static" => {
107
- "checksum" => "a5e0af3e5e1ad908792e79c7c46b59119272e9836e5ea96791c78e3cb12ed132",
107
+ "checksum" => "8963ebc98405648205a6d8aa371bafa49cb33cd104e0c3e6cc1856ba41fe3d8c",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "17c108a83dff86b2531bf7f348481bb31ece53b4cc62615ca0a34332c0df2970",
111
+ "checksum" => "6b5bab353f1597e64d0dc7638f02e8a0c4da2b341991f8e8efb251d8f94878a2",
112
112
  "filename" => "appsignal-x86_64-linux-musl-all-dynamic.tar.gz"
113
113
  }
114
114
  },
115
115
  "aarch64-linux-musl" => {
116
116
  "static" => {
117
- "checksum" => "92460560115d540a8140cbc360bd98beba8477e8a73eafd20ee611543b4528df",
117
+ "checksum" => "34bb72678b896a2a8289a97611a61a297b5a0e6110f5085a683ad93857cdf26c",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "d4749b10a1803080e0b1b0d8f95ef9d1fef0aa694fa0fc405df97812937d8e7c",
121
+ "checksum" => "999e0bdc36613f9e016b01d4a00fab864b5996472e32ff1e03a0019877cd5e5d",
122
122
  "filename" => "appsignal-aarch64-linux-musl-all-dynamic.tar.gz"
123
123
  }
124
124
  },
125
125
  "x86_64-freebsd" => {
126
126
  "static" => {
127
- "checksum" => "8d8733c2adc0f750553be11b5e54fd614b13207be67863d95c57e4739021a92f",
127
+ "checksum" => "68e882ba3bc87328953d9bfbb676b00d4199756a7090d5cdc265a4b32d857cc5",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "8a9cbdc645b3833766458a252c2a8fefda76c62fceee8be795b286d65cc513c6",
131
+ "checksum" => "3e770a387ada2e12052929c6f4ea141d05bd3dec5337ca53bbcf1078a6a2537d",
132
132
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
133
133
  }
134
134
  },
135
135
  "amd64-freebsd" => {
136
136
  "static" => {
137
- "checksum" => "8d8733c2adc0f750553be11b5e54fd614b13207be67863d95c57e4739021a92f",
137
+ "checksum" => "68e882ba3bc87328953d9bfbb676b00d4199756a7090d5cdc265a4b32d857cc5",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "8a9cbdc645b3833766458a252c2a8fefda76c62fceee8be795b286d65cc513c6",
141
+ "checksum" => "3e770a387ada2e12052929c6f4ea141d05bd3dec5337ca53bbcf1078a6a2537d",
142
142
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
143
143
  }
144
144
  }
@@ -40,7 +40,7 @@ module Appsignal
40
40
  # @return [Array<String/nil, String>] response tuple.
41
41
  # - First value is the response status code.
42
42
  # - Second value is a description of the response and the exception error
43
- # message if an exception occured.
43
+ # message if an exception occurred.
44
44
  def perform_with_result
45
45
  status = perform
46
46
  result =
@@ -70,6 +70,7 @@ module Appsignal
70
70
  "APPSIGNAL_APP_NAME" => :name,
71
71
  "APPSIGNAL_BIND_ADDRESS" => :bind_address,
72
72
  "APPSIGNAL_CA_FILE_PATH" => :ca_file_path,
73
+ "APPSIGNAL_CPU_COUNT" => :cpu_count,
73
74
  "APPSIGNAL_DEBUG" => :debug,
74
75
  "APPSIGNAL_DNS_SERVERS" => :dns_servers,
75
76
  "APPSIGNAL_ENABLE_ALLOCATION_TRACKING" => :enable_allocation_tracking,
@@ -167,6 +168,9 @@ module Appsignal
167
168
  APPSIGNAL_IGNORE_NAMESPACES
168
169
  APPSIGNAL_REQUEST_HEADERS
169
170
  ].freeze
171
+ ENV_FLOAT_KEYS = %w[
172
+ APPSIGNAL_CPU_COUNT
173
+ ].freeze
170
174
 
171
175
  # @attribute [r] system_config
172
176
  # Config detected on the system level.
@@ -344,6 +348,7 @@ module Appsignal
344
348
  ENV["_APPSIGNAL_APP_PATH"] = root_path.to_s
345
349
  ENV["_APPSIGNAL_BIND_ADDRESS"] = config_hash[:bind_address].to_s
346
350
  ENV["_APPSIGNAL_CA_FILE_PATH"] = config_hash[:ca_file_path].to_s
351
+ ENV["_APPSIGNAL_CPU_COUNT"] = config_hash[:cpu_count].to_s
347
352
  ENV["_APPSIGNAL_DEBUG_LOGGING"] = config_hash[:debug].to_s
348
353
  ENV["_APPSIGNAL_DNS_SERVERS"] = config_hash[:dns_servers].join(",")
349
354
  ENV["_APPSIGNAL_ENABLE_HOST_METRICS"] = config_hash[:enable_host_metrics].to_s
@@ -444,7 +449,7 @@ module Appsignal
444
449
  "'APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR=1' in your system " \
445
450
  "environment."
446
451
  end
447
- message = "An error occured while loading the AppSignal config file. " \
452
+ message = "An error occurred while loading the AppSignal config file. " \
448
453
  "#{extra_message}\n" \
449
454
  "File: #{config_file.inspect}\n" \
450
455
  "#{e.class.name}: #{e}"
@@ -501,6 +506,14 @@ module Appsignal
501
506
  config[ENV_TO_KEY_MAPPING[var]] = env_var.split(",")
502
507
  end
503
508
 
509
+ # Configuration with float type
510
+ ENV_FLOAT_KEYS.each do |var|
511
+ env_var = ENV.fetch(var, nil)
512
+ next unless env_var
513
+
514
+ config[ENV_TO_KEY_MAPPING[var]] = env_var.to_f
515
+ end
516
+
504
517
  config
505
518
  end
506
519
 
@@ -4,7 +4,7 @@ module Appsignal
4
4
  class EventFormatter
5
5
  # @api private
6
6
  module Sequel
7
- # Compatability with the sequel-rails gem.
7
+ # Compatibility with the sequel-rails gem.
8
8
  # The sequel-rails gem adds its own ActiveSupport::Notifications events
9
9
  # that conflict with our own sequel instrumentor. Without this event
10
10
  # formatter the sequel-rails events are recorded without the SQL query
@@ -60,9 +60,13 @@ module Appsignal
60
60
  return unless handled
61
61
 
62
62
  Appsignal.send_error(error) do |transaction|
63
- namespace, action_name, tags, custom_data = context_for(context.dup)
63
+ namespace, action_name, path, method, params, tags, custom_data =
64
+ context_for(context.dup)
64
65
  transaction.set_namespace(namespace) if namespace
65
66
  transaction.set_action(action_name) if action_name
67
+ transaction.set_metadata("path", path)
68
+ transaction.set_metadata("method", method)
69
+ transaction.params = params
66
70
  transaction.set_sample_data("custom_data", custom_data) if custom_data
67
71
 
68
72
  tags[:severity] = severity
@@ -81,9 +85,17 @@ module Appsignal
81
85
  # Fetch the namespace and action name based on the Rails execution
82
86
  # context.
83
87
  controller = context.delete(:controller)
88
+ path = nil
89
+ method = nil
90
+ params = nil
84
91
  if controller
85
92
  namespace = Appsignal::Transaction::HTTP_REQUEST
86
93
  action_name = "#{controller.class.name}##{controller.action_name}"
94
+ unless controller.request.nil?
95
+ path = controller.request.path
96
+ method = controller.request.method
97
+ params = controller.request.filtered_parameters
98
+ end
87
99
  end
88
100
  # ActiveJob transaction naming relies on the current AppSignal
89
101
  # transaction namespace and action name copying done after this.
@@ -115,7 +127,7 @@ module Appsignal
115
127
  end
116
128
  tags.merge!(context)
117
129
 
118
- [namespace, action_name, tags, custom_data]
130
+ [namespace, action_name, path, method, params, tags, custom_data]
119
131
  end
120
132
  end
121
133
  end
@@ -64,7 +64,7 @@ module Appsignal
64
64
  alias log add
65
65
 
66
66
  # Log a debug level message
67
- # @param message Mesage to log
67
+ # @param message Message to log
68
68
  # @param attributes Attributes to tag the log with
69
69
  # @return [void]
70
70
  def debug(message = nil, attributes = {})
@@ -77,7 +77,7 @@ module Appsignal
77
77
  end
78
78
 
79
79
  # Log an info level message
80
- # @param message Mesage to log
80
+ # @param message Message to log
81
81
  # @param attributes Attributes to tag the log with
82
82
  # @return [void]
83
83
  def info(message = nil, attributes = {})
@@ -90,7 +90,7 @@ module Appsignal
90
90
  end
91
91
 
92
92
  # Log a warn level message
93
- # @param message Mesage to log
93
+ # @param message Message to log
94
94
  # @param attributes Attributes to tag the log with
95
95
  # @return [void]
96
96
  def warn(message = nil, attributes = {})
@@ -103,7 +103,7 @@ module Appsignal
103
103
  end
104
104
 
105
105
  # Log an error level message
106
- # @param message Mesage to log
106
+ # @param message Message to log
107
107
  # @param attributes Attributes to tag the log with
108
108
  # @return [void]
109
109
  def error(message = nil, attributes = {})
@@ -116,7 +116,7 @@ module Appsignal
116
116
  end
117
117
 
118
118
  # Log a fatal level message
119
- # @param message Mesage to log
119
+ # @param message Message to log
120
120
  # @param attributes Attributes to tag the log with
121
121
  # @return [void]
122
122
  def fatal(message = nil, attributes = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.6.2"
4
+ VERSION = "3.6.3"
5
5
  end
@@ -18,7 +18,7 @@ Puma::Plugin.create do # rubocop:disable Metrics/BlockLength
18
18
 
19
19
  loop do
20
20
  # Implement similar behavior to minutely probes.
21
- # Initial sleep to wait until the app is fully initalized.
21
+ # Initial sleep to wait until the app is fully initialized.
22
22
  # Then loop every 60 seconds and collect the Puma stats as AppSignal
23
23
  # metrics.
24
24
  sleep sleep_time
@@ -160,7 +160,7 @@ if DependencyHelper.capistrano2_present?
160
160
  run
161
161
  end
162
162
 
163
- it "transmits the overriden revision" do
163
+ it "transmits the overridden revision" do
164
164
  expect(output).to include \
165
165
  "Notifying AppSignal of deploy with: revision: abc123, user: batman",
166
166
  "AppSignal has been notified of this deploy!"
@@ -174,7 +174,7 @@ if DependencyHelper.capistrano2_present?
174
174
  run
175
175
  end
176
176
 
177
- it "transmits the overriden deploy user" do
177
+ it "transmits the overridden deploy user" do
178
178
  expect(output).to include \
179
179
  "Notifying AppSignal of deploy with: revision: 503ce0923ed177a3ce000005," \
180
180
  " user: robin",
@@ -172,7 +172,7 @@ if DependencyHelper.capistrano3_present?
172
172
  run
173
173
  end
174
174
 
175
- it "transmits the overriden revision" do
175
+ it "transmits the overridden revision" do
176
176
  expect(output).to include \
177
177
  "Notifying AppSignal of deploy with: revision: abc123, user: batman",
178
178
  "AppSignal has been notified of this deploy!"
@@ -186,7 +186,7 @@ if DependencyHelper.capistrano3_present?
186
186
  run
187
187
  end
188
188
 
189
- it "transmits the overriden deploy user" do
189
+ it "transmits the overridden deploy user" do
190
190
  expect(output).to include \
191
191
  "Notifying AppSignal of deploy with: revision: 503ce0923ed177a3ce000005, " \
192
192
  "user: robin",
@@ -466,7 +466,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
466
466
  end
467
467
  end
468
468
 
469
- context "when the extention returns invalid JSON" do
469
+ context "when the extension returns invalid JSON" do
470
470
  before do
471
471
  expect(Appsignal::Extension).to receive(:diagnose).and_return("invalid agent\njson")
472
472
  run
@@ -6,7 +6,8 @@ describe Appsignal::Config do
6
6
  configured_env_keys = (
7
7
  config::ENV_STRING_KEYS +
8
8
  config::ENV_BOOLEAN_KEYS +
9
- config::ENV_ARRAY_KEYS
9
+ config::ENV_ARRAY_KEYS +
10
+ config::ENV_FLOAT_KEYS
10
11
  ).sort
11
12
 
12
13
  expect(mapped_env_keys).to eql(configured_env_keys)
@@ -264,7 +265,7 @@ describe Appsignal::Config do
264
265
  end
265
266
  end
266
267
 
267
- context "with an overriden config file" do
268
+ context "with an overridden config file" do
268
269
  let(:config) do
269
270
  project_fixture_config("production", {}, Appsignal.internal_logger,
270
271
  File.join(project_fixture_path, "config", "appsignal.yml"))
@@ -275,7 +276,7 @@ describe Appsignal::Config do
275
276
  expect(config.active?).to be_truthy
276
277
  end
277
278
 
278
- context "with an invalid overriden config file" do
279
+ context "with an invalid overridden config file" do
279
280
  let(:config) do
280
281
  project_fixture_config("production", {}, Appsignal.internal_logger,
281
282
  File.join(project_fixture_path, "config", "missing.yml"))
@@ -300,7 +301,7 @@ describe Appsignal::Config do
300
301
  stdout = std_stream
301
302
  stderr = std_stream
302
303
  log = capture_logs { capture_std_streams(stdout, stderr) { config } }
303
- message = "An error occured while loading the AppSignal config file. " \
304
+ message = "An error occurred while loading the AppSignal config file. " \
304
305
  "Skipping file config. " \
305
306
  "In future versions AppSignal will not start on a config file " \
306
307
  "error. To opt-in to this new behavior set " \
@@ -326,7 +327,7 @@ describe Appsignal::Config do
326
327
  ENV["APPSIGNAL_PUSH_API_KEY"] = "something valid"
327
328
  ENV["APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR"] = "1"
328
329
  log = capture_logs { capture_std_streams(stdout, stderr) { config } }
329
- message = "An error occured while loading the AppSignal config file. " \
330
+ message = "An error occurred while loading the AppSignal config file. " \
330
331
  "Not starting AppSignal because APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR is set.\n" \
331
332
  "File: #{File.join(config_path, "config", "appsignal.yml").inspect}\n" \
332
333
  "KeyError: key not found"
@@ -414,6 +415,7 @@ describe Appsignal::Config do
414
415
  :push_api_key => "aaa-bbb-ccc",
415
416
  :active => true,
416
417
  :bind_address => "0.0.0.0",
418
+ :cpu_count => 1.5,
417
419
  :name => "App name",
418
420
  :debug => true,
419
421
  :dns_servers => ["8.8.8.8", "8.8.4.4"],
@@ -436,6 +438,7 @@ describe Appsignal::Config do
436
438
  ENV["APPSIGNAL_ACTIVE"] = "true"
437
439
  ENV["APPSIGNAL_APP_NAME"] = "App name"
438
440
  ENV["APPSIGNAL_BIND_ADDRESS"] = "0.0.0.0"
441
+ ENV["APPSIGNAL_CPU_COUNT"] = "1.5"
439
442
  ENV["APPSIGNAL_DEBUG"] = "true"
440
443
  ENV["APPSIGNAL_DNS_SERVERS"] = "8.8.8.8,8.8.4.4"
441
444
  ENV["APPSIGNAL_IGNORE_ACTIONS"] = "action1,action2"
@@ -631,6 +634,7 @@ describe Appsignal::Config do
631
634
  let(:config) { project_fixture_config(:production) }
632
635
  before do
633
636
  config[:bind_address] = "0.0.0.0"
637
+ config[:cpu_count] = 1.5
634
638
  config[:logging_endpoint] = "http://localhost:123"
635
639
  config[:http_proxy] = "http://localhost"
636
640
  config[:ignore_actions] = %w[action1 action2]
@@ -654,6 +658,7 @@ describe Appsignal::Config do
654
658
  .to end_with("spec/support/fixtures/projects/valid")
655
659
  expect(ENV.fetch("_APPSIGNAL_AGENT_PATH", nil)).to end_with("/ext")
656
660
  expect(ENV.fetch("_APPSIGNAL_BIND_ADDRESS", nil)).to eq("0.0.0.0")
661
+ expect(ENV.fetch("_APPSIGNAL_CPU_COUNT", nil)).to eq("1.5")
657
662
  expect(ENV.fetch("_APPSIGNAL_DEBUG_LOGGING", nil)).to eq "false"
658
663
  expect(ENV.fetch("_APPSIGNAL_LOG", nil)).to eq "stdout"
659
664
  expect(ENV.fetch("_APPSIGNAL_LOG_FILE_PATH", nil)).to end_with("/tmp/appsignal.log")
@@ -90,7 +90,7 @@ describe Appsignal::Environment do
90
90
  end
91
91
  end
92
92
 
93
- context "when something unforseen errors" do
93
+ context "when something unforeseen errors" do
94
94
  it "does not re-raise the error and writes it to the log" do
95
95
  klass = Class.new do
96
96
  def inspect
@@ -127,7 +127,7 @@ describe Appsignal::Environment do
127
127
  expect(rake_spec.version.to_s).to_not be_empty
128
128
  end
129
129
 
130
- context "when something unforseen errors" do
130
+ context "when something unforeseen errors" do
131
131
  it "does not re-raise the error and writes it to the log" do
132
132
  expect(Bundler).to receive(:rubygems).and_raise(RuntimeError, "bundler error")
133
133
 
@@ -148,7 +148,7 @@ describe Appsignal::Environment do
148
148
  expect_environment_metadata("ruby_a_test_enabled", "true")
149
149
  end
150
150
 
151
- context "when something unforseen errors" do
151
+ context "when something unforeseen errors" do
152
152
  it "does not re-raise the error and writes it to the log" do
153
153
  klass = Class.new do
154
154
  def to_s
@@ -21,7 +21,7 @@ describe Appsignal::EventFormatter::MongoRubyDriver::QueryFormatter do
21
21
  formatter.format(strategy, command)
22
22
  end
23
23
 
24
- context "when strategy is unkown" do
24
+ context "when strategy is unknown" do
25
25
  let(:strategy) { :bananas }
26
26
 
27
27
  it "should return an empty hash" do
@@ -160,7 +160,7 @@ describe Appsignal::Hooks::ResqueHook do
160
160
  end
161
161
  after { Object.send(:remove_const, :ActiveJobMock) }
162
162
 
163
- it "does not set arguments but lets the ActiveJob intergration handle it" do
163
+ it "does not set arguments but lets the ActiveJob integration handle it" do
164
164
  perform_job(
165
165
  ResqueTestJob,
166
166
  "class" => "ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper",
@@ -47,7 +47,7 @@ describe Appsignal::Hooks do
47
47
  Appsignal::Hooks.hooks.delete(:mock_present_hook)
48
48
  end
49
49
 
50
- it "should not install if depencies are not present" do
50
+ it "should not install if dependencies are not present" do
51
51
  Appsignal::Hooks::Hook.register(:mock_not_present_hook, MockNotPresentHook)
52
52
 
53
53
  expect(Appsignal::Hooks.hooks[:mock_not_present_hook]).to be_instance_of(MockNotPresentHook)
@@ -256,10 +256,28 @@ if DependencyHelper.rails_present?
256
256
  end
257
257
 
258
258
  context "when no transaction is active" do
259
+ class ExampleRailsRequestMock
260
+ def path
261
+ "path"
262
+ end
263
+
264
+ def method
265
+ "GET"
266
+ end
267
+
268
+ def filtered_parameters
269
+ { :user_id => 123, :password => "[FILTERED]" }
270
+ end
271
+ end
272
+
259
273
  class ExampleRailsControllerMock
260
274
  def action_name
261
275
  "index"
262
276
  end
277
+
278
+ def request
279
+ @request ||= ExampleRailsRequestMock.new
280
+ end
263
281
  end
264
282
 
265
283
  class ExampleRailsJobMock
@@ -275,7 +293,7 @@ if DependencyHelper.rails_present?
275
293
  clear_current_transaction!
276
294
  end
277
295
 
278
- it "fetches the action from the controller in the context" do
296
+ it "fetches the action, path and method from the controller in the context" do
279
297
  # The controller key is set by Rails when raised in a controller
280
298
  given_context = { :controller => ExampleRailsControllerMock.new }
281
299
  with_rails_error_reporter do
@@ -285,7 +303,14 @@ if DependencyHelper.rails_present?
285
303
  transaction = last_transaction
286
304
  transaction_hash = transaction.to_h
287
305
  expect(transaction_hash).to include(
288
- "action" => "ExampleRailsControllerMock#index"
306
+ "action" => "ExampleRailsControllerMock#index",
307
+ "metadata" => hash_including(
308
+ "path" => "path",
309
+ "method" => "GET"
310
+ ),
311
+ "sample_data" => hash_including(
312
+ "params" => { "user_id" => 123, "password" => "[FILTERED]" }
313
+ )
289
314
  )
290
315
  end
291
316
 
@@ -8,7 +8,7 @@ describe Appsignal::Integrations::SidekiqErrorHandler do
8
8
  end
9
9
  around { |example| keep_transactions { example.run } }
10
10
 
11
- context "without a current transction" do
11
+ context "without a current transaction" do
12
12
  let(:exception) do
13
13
  raise ExampleStandardError, "uh oh"
14
14
  rescue => error
@@ -303,7 +303,7 @@ describe Appsignal::Transaction do
303
303
  context "with overridden options" do
304
304
  let(:options) { { :params_method => :filtered_params } }
305
305
 
306
- it "sets the overriden :params_method" do
306
+ it "sets the overridden :params_method" do
307
307
  expect(subject[:params_method]).to eq :filtered_params
308
308
  end
309
309
  end
@@ -751,7 +751,7 @@ describe Appsignal::Transaction do
751
751
  e
752
752
  end
753
753
 
754
- it "should also respond to add_exception for backwords compatibility" do
754
+ it "should also respond to add_exception for backwards compatibility" do
755
755
  expect(transaction).to respond_to(:add_exception)
756
756
  end
757
757
 
@@ -258,7 +258,7 @@ describe Appsignal do
258
258
  end
259
259
 
260
260
  describe ".listen_for_error" do
261
- it "does not record anyhing" do
261
+ it "does not record anything" do
262
262
  error = RuntimeError.new("specific error")
263
263
  expect do
264
264
  Appsignal.listen_for_error do
@@ -204,7 +204,7 @@ RSpec.describe "Puma plugin" do
204
204
  }
205
205
  end
206
206
 
207
- it "collects puma stats as guage metrics with the (summed) worker metrics" do
207
+ it "collects puma stats as gauge metrics with the (summed) worker metrics" do
208
208
  run_plugin(stats_data, appsignal_plugin) do
209
209
  expect(logs).to_not include([:error, kind_of(String)])
210
210
  expect_gauge(:workers, 2, "type" => "count")
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.6.2
4
+ version: 3.6.3
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Beekman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-03-08 00:00:00.000000000 Z
13
+ date: 2024-03-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack