appsignal 4.5.7-java → 4.5.8-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 +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/appsignal/config.rb +4 -0
- data/lib/appsignal/helpers/instrumentation.rb +5 -0
- data/lib/appsignal/hooks/at_exit.rb +18 -4
- data/lib/appsignal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ecc706edb88f6b60fd226d388ef36ccb4d0a3cb8b3cbf98a8eaca1aeace9b22
|
4
|
+
data.tar.gz: eb18c6e7c352ab0e5e44f739190df8a2c671212b97133311070633944597b63f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b77daa7a8e0b80534be9a721cb9cca2f16843e9bef86151345114e66303aaff08ea0e8f94e6314c12384bd17a2e4a3faf50a230f5ef52349c54fb3767d0b7755
|
7
|
+
data.tar.gz: 18efa45cf4d42fd8faacaf5cec5ec93e76d41773d83e9e077a6d4528aeb5019a05ce41b35b1e88e3449ccd8635ce27045c8cca49d46077327d6490e3e6dc31d4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 4.5.8
|
4
|
+
|
5
|
+
_Published on 2025-04-04._
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- Add the `enable_at_exit_hook` option to configure if `Appsignal.stop` is called when the Ruby application exits. Calling `Appsignal.stop` will stop the application for a moment to flush all the data to our agent before shutting down.
|
10
|
+
|
11
|
+
This option has three possible values:
|
12
|
+
|
13
|
+
- `always`: Always call `Appsignal.stop` when the program exits. On (Docker) containers it's automatically set to this value.
|
14
|
+
- `never`: Never call `Appsignal.stop` when the program exits. The default value when the program doesn't run on a (Docker) container.
|
15
|
+
- `on_error`: Call `Appsignal.stop` when the program exits with an error.
|
16
|
+
|
17
|
+
(patch [d0a5875c](https://github.com/appsignal/appsignal-ruby/commit/d0a5875cef5101680f1cab4649d71440212f9ea8), [043a6c74](https://github.com/appsignal/appsignal-ruby/commit/043a6c740b708e1182ed7161e3c9ad38bd3314de), [b680fe6f](https://github.com/appsignal/appsignal-ruby/commit/b680fe6f6b283205a13ca61bd4a26167f541dbca))
|
18
|
+
|
19
|
+
### Deprecated
|
20
|
+
|
21
|
+
- Deprecate the `Appsignal.monitor_and_stop` helper.
|
22
|
+
|
23
|
+
We instead recommend using the `Appsignal.monitor` helper and configuring the `enable_at_exit_hook` config option to `always`.
|
24
|
+
|
25
|
+
(patch [84969aea](https://github.com/appsignal/appsignal-ruby/commit/84969aeaca8f3737921e9adf1efdad55b52e1206))
|
26
|
+
|
3
27
|
## 4.5.7
|
4
28
|
|
5
29
|
_Published on 2025-03-20._
|
data/lib/appsignal/config.rb
CHANGED
@@ -93,6 +93,7 @@ module Appsignal
|
|
93
93
|
:ca_file_path => File.expand_path(File.join("../../../resources/cacert.pem"), __FILE__),
|
94
94
|
:dns_servers => [],
|
95
95
|
:enable_allocation_tracking => true,
|
96
|
+
:enable_at_exit_hook => "on_error",
|
96
97
|
:enable_at_exit_reporter => true,
|
97
98
|
:enable_host_metrics => true,
|
98
99
|
:enable_minutely_probes => true,
|
@@ -153,6 +154,7 @@ module Appsignal
|
|
153
154
|
:name => "APPSIGNAL_APP_NAME",
|
154
155
|
:bind_address => "APPSIGNAL_BIND_ADDRESS",
|
155
156
|
:ca_file_path => "APPSIGNAL_CA_FILE_PATH",
|
157
|
+
:enable_at_exit_hook => "APPSIGNAL_ENABLE_AT_EXIT_HOOK",
|
156
158
|
:hostname => "APPSIGNAL_HOSTNAME",
|
157
159
|
:host_role => "APPSIGNAL_HOST_ROLE",
|
158
160
|
:http_proxy => "APPSIGNAL_HTTP_PROXY",
|
@@ -507,6 +509,8 @@ module Appsignal
|
|
507
509
|
# environment variable is present and not empty.
|
508
510
|
env_push_api_key = ENV["APPSIGNAL_PUSH_API_KEY"] || ""
|
509
511
|
hash[:active] = true unless env_push_api_key.strip.empty?
|
512
|
+
|
513
|
+
hash[:enable_at_exit_hook] = "always" if Appsignal::Extension.running_in_container?
|
510
514
|
end
|
511
515
|
end
|
512
516
|
|
@@ -154,6 +154,11 @@ module Appsignal
|
|
154
154
|
#
|
155
155
|
# @see monitor
|
156
156
|
def monitor_and_stop(action:, namespace: nil, &block)
|
157
|
+
Appsignal::Utils::StdoutAndLoggerMessage.warning \
|
158
|
+
"The `Appsignal.monitor_and_stop` helper is deprecated. " \
|
159
|
+
"Use the `Appsignal.monitor` along with our `enable_at_exit_hook` " \
|
160
|
+
"option instead."
|
161
|
+
|
157
162
|
monitor(:namespace => namespace, :action => action, &block)
|
158
163
|
ensure
|
159
164
|
Appsignal.stop("monitor_and_stop")
|
@@ -11,27 +11,41 @@ module Appsignal
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def install
|
14
|
-
return unless Appsignal.config[:enable_at_exit_reporter]
|
15
|
-
|
16
14
|
Kernel.at_exit(&AtExitCallback.method(:call))
|
17
15
|
end
|
18
16
|
|
19
|
-
#
|
17
|
+
# Stop AppSignal before the app exists.
|
18
|
+
#
|
19
|
+
# This is the default behavior and can be customized with the
|
20
|
+
# `enable_at_exit_hook` option.
|
21
|
+
#
|
22
|
+
# When the `enable_at_exit_reporter` option is set to `true` (the
|
23
|
+
# default), it will report any unhandled errors that will crash the Ruby
|
24
|
+
# process.
|
20
25
|
#
|
21
26
|
# If this error was previously reported by any of our instrumentation,
|
22
27
|
# the error will not also be reported here. This way we don't report an
|
23
28
|
# error from a Rake task or instrumented script twice.
|
24
29
|
class AtExitCallback
|
25
30
|
def self.call
|
31
|
+
report_error = false
|
32
|
+
return unless Appsignal.config&.[](:enable_at_exit_reporter)
|
33
|
+
|
26
34
|
error = $! # rubocop:disable Style/SpecialGlobalVars
|
27
35
|
return unless error
|
28
36
|
return if ignored_error?(error)
|
29
37
|
return if Appsignal::Transaction.last_errors.include?(error)
|
30
38
|
|
39
|
+
report_error = true
|
40
|
+
|
31
41
|
Appsignal.report_error(error) do |transaction|
|
32
42
|
transaction.set_namespace("unhandled")
|
33
43
|
end
|
34
|
-
|
44
|
+
ensure
|
45
|
+
at_exit_hook = Appsignal.config&.[](:enable_at_exit_hook)
|
46
|
+
if at_exit_hook == "always" || (at_exit_hook == "on_error" && report_error)
|
47
|
+
Appsignal.stop("at_exit")
|
48
|
+
end
|
35
49
|
end
|
36
50
|
|
37
51
|
IGNORED_ERRORS = [
|
data/lib/appsignal/version.rb
CHANGED
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: 4.5.
|
4
|
+
version: 4.5.8
|
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: 2025-
|
13
|
+
date: 2025-04-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: logger
|