appsignal 4.1.1 → 4.1.3
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 +77 -0
- data/ext/agent.rb +30 -30
- data/lib/appsignal/config.rb +81 -63
- data/lib/appsignal/hooks/action_cable.rb +2 -2
- data/lib/appsignal/integrations/action_cable.rb +1 -0
- data/lib/appsignal/integrations/railtie.rb +2 -1
- data/lib/appsignal/transaction.rb +3 -2
- data/lib/appsignal/version.rb +1 -1
- data/lib/appsignal.rb +15 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a441bb8864121c2d1270a87f385ad98d6942e02705d640b02e39ecd4f4f429d
|
4
|
+
data.tar.gz: bffc65fe34303b5396b2d08df716022897dcdb98c36a627d7a63fe389210568f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fb41c8fef25b7c9d16a7cbae97c974abab53c754baedc1336e74064139f4c7e286c9ef5c1bf0fef386482f82199327f6576345dbe416cf10c4b200ec698ecd8
|
7
|
+
data.tar.gz: de587e5a60a63385ff740cccc6bef444e3bf18abb9fb3580af2f5a16f70cd58bd64897e2b0e79851c6c1ed68658b219c25c7b54eb129b8c40ad3a87d7bd348ea
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,82 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 4.1.3
|
4
|
+
|
5
|
+
_Published on 2024-11-07._
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- Add `activate_if_environment` helper for `Appsignal.configure`. Avoid having to add conditionals to your configuration file and use the `activate_if_environment` helper to specify for which environments AppSignal should become active. AppSignal will automatically detect the environment and activate itself it the environment matches one of the listed environments.
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
# Before
|
13
|
+
Appsignal.configure do |config|
|
14
|
+
config.active = Rails.env.production? || Rails.env.staging?
|
15
|
+
end
|
16
|
+
|
17
|
+
# After
|
18
|
+
Appsignal.configure do |config|
|
19
|
+
# Activate for one environment
|
20
|
+
config.activate_if_environment(:production)
|
21
|
+
|
22
|
+
# Activate for multiple environments
|
23
|
+
config.activate_if_environment(:production, :staging)
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
(patch [ff31be88](https://github.com/appsignal/appsignal-ruby/commit/ff31be88cf49a18951f48663d96af3cde4184e32))
|
28
|
+
- Add a hostname AppSignal tag automatically, based on the OpenTelemetry `host.name` resource attribute. (Beta only) (patch [35449268](https://github.com/appsignal/appsignal-ruby/commit/35449268a5f6d7487d17018ddb8f5dd433d676e0))
|
29
|
+
- Add incident error count metric for enriched OpenTelemetry traces. (Beta only) (patch [35449268](https://github.com/appsignal/appsignal-ruby/commit/35449268a5f6d7487d17018ddb8f5dd433d676e0))
|
30
|
+
- Set the app revision config option for Scalingo deploys automatically. If the `CONTAINER_VERSION` system environment variable is present, it will use used to set the `revision` config option automatically. Overwrite it's value by configuring the `revision` config option for your application. (patch [35449268](https://github.com/appsignal/appsignal-ruby/commit/35449268a5f6d7487d17018ddb8f5dd433d676e0))
|
31
|
+
|
32
|
+
### Changed
|
33
|
+
|
34
|
+
- Ignore the Rails healthcheck endpoint (Rails::HealthController#show) by default for Rails apps.
|
35
|
+
|
36
|
+
If the `ignore_actions` option is set in the `config/appsignal.yml` file, the default is overwritten.
|
37
|
+
If the `APPSIGNAL_IGNORE_ACTIONS` environment variable is set, the default is overwritten.
|
38
|
+
When using the `Appsignal.configure` helper, add more actions to the default like so:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
# config/appsignal.rb
|
42
|
+
Appsignal.configure do |config|
|
43
|
+
# Add more actions to ignore
|
44
|
+
config.ignore_actions << "My action"
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
To overwrite the default using the `Appsignal.configure` helper, do either of the following:
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
# config/appsignal.rb
|
52
|
+
Appsignal.configure do |config|
|
53
|
+
# Overwrite the default value, ignoring all actions ignored by default
|
54
|
+
config.ignore_actions = ["My action"]
|
55
|
+
|
56
|
+
# To only remove the healtcheck endpoint
|
57
|
+
config.ignore_actions.delete("Rails::HealthController#show")
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
(patch [af71fb90](https://github.com/appsignal/appsignal-ruby/commit/af71fb904eebc4af05dc2fcf8bd390dd9baffd68))
|
62
|
+
|
63
|
+
### Fixed
|
64
|
+
|
65
|
+
- Fix an issue where the extension fails to build on ARM64 Linux. (patch [79ac5bbe](https://github.com/appsignal/appsignal-ruby/commit/79ac5bbe7028151ae749cbd7a4e98f706d259ad8))
|
66
|
+
|
67
|
+
## 4.1.2
|
68
|
+
|
69
|
+
_Published on 2024-10-04._
|
70
|
+
|
71
|
+
### Changed
|
72
|
+
|
73
|
+
- Change the primary download mirror for integrations. (patch [8fb8b93a](https://github.com/appsignal/appsignal-ruby/commit/8fb8b93af873735a33d9c9440260fd9afe9dd12b))
|
74
|
+
- Internal OpenTelemetry change. (patch [8fb8b93a](https://github.com/appsignal/appsignal-ruby/commit/8fb8b93af873735a33d9c9440260fd9afe9dd12b))
|
75
|
+
|
76
|
+
### Fixed
|
77
|
+
|
78
|
+
- Fix session data reporting for Action Cable actions. (patch [41642bea](https://github.com/appsignal/appsignal-ruby/commit/41642beace7e65f441a93319fbd94192c4d5aedf))
|
79
|
+
|
3
80
|
## 4.1.1
|
4
81
|
|
5
82
|
_Published on 2024-09-28._
|
data/ext/agent.rb
CHANGED
@@ -1,144 +1,144 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# DO NOT EDIT
|
4
|
-
# This is a generated file by the `rake
|
4
|
+
# This is a generated file by the `rake publish` family of tasks in the
|
5
5
|
# appsignal-agent repository.
|
6
6
|
# Modifications to this file will be overwritten with the next agent release.
|
7
7
|
|
8
8
|
APPSIGNAL_AGENT_CONFIG = {
|
9
|
-
"version" => "0.35.
|
9
|
+
"version" => "0.35.28",
|
10
10
|
"mirrors" => [
|
11
|
-
"https://
|
12
|
-
"https://
|
11
|
+
"https://d135dj0rjqvssy.cloudfront.net",
|
12
|
+
"https://appsignal-agent-releases.global.ssl.fastly.net"
|
13
13
|
],
|
14
14
|
"triples" => {
|
15
15
|
"x86_64-darwin" => {
|
16
16
|
"static" => {
|
17
|
-
"checksum" => "
|
17
|
+
"checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
|
18
18
|
"filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
|
19
19
|
},
|
20
20
|
"dynamic" => {
|
21
|
-
"checksum" => "
|
21
|
+
"checksum" => "bf65784cd4b082db18f241f02e21472f7356b59c5be1a1ef19788ffdac82e737",
|
22
22
|
"filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
|
23
23
|
}
|
24
24
|
},
|
25
25
|
"universal-darwin" => {
|
26
26
|
"static" => {
|
27
|
-
"checksum" => "
|
27
|
+
"checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
|
28
28
|
"filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
|
29
29
|
},
|
30
30
|
"dynamic" => {
|
31
|
-
"checksum" => "
|
31
|
+
"checksum" => "bf65784cd4b082db18f241f02e21472f7356b59c5be1a1ef19788ffdac82e737",
|
32
32
|
"filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
|
33
33
|
}
|
34
34
|
},
|
35
35
|
"aarch64-darwin" => {
|
36
36
|
"static" => {
|
37
|
-
"checksum" => "
|
37
|
+
"checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
|
38
38
|
"filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
|
39
39
|
},
|
40
40
|
"dynamic" => {
|
41
|
-
"checksum" => "
|
41
|
+
"checksum" => "21941505aed9051c31883e29e3b2de1816ef881ae68dc30cb0fd39104b5fcd4f",
|
42
42
|
"filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
|
43
43
|
}
|
44
44
|
},
|
45
45
|
"arm64-darwin" => {
|
46
46
|
"static" => {
|
47
|
-
"checksum" => "
|
47
|
+
"checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
|
48
48
|
"filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
|
49
49
|
},
|
50
50
|
"dynamic" => {
|
51
|
-
"checksum" => "
|
51
|
+
"checksum" => "21941505aed9051c31883e29e3b2de1816ef881ae68dc30cb0fd39104b5fcd4f",
|
52
52
|
"filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
|
53
53
|
}
|
54
54
|
},
|
55
55
|
"arm-darwin" => {
|
56
56
|
"static" => {
|
57
|
-
"checksum" => "
|
57
|
+
"checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
|
58
58
|
"filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
|
59
59
|
},
|
60
60
|
"dynamic" => {
|
61
|
-
"checksum" => "
|
61
|
+
"checksum" => "21941505aed9051c31883e29e3b2de1816ef881ae68dc30cb0fd39104b5fcd4f",
|
62
62
|
"filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
|
63
63
|
}
|
64
64
|
},
|
65
65
|
"aarch64-linux" => {
|
66
66
|
"static" => {
|
67
|
-
"checksum" => "
|
67
|
+
"checksum" => "02d62cfab5ab81faec40db6d80d47e53b2fca640026715697ab43f19539ace34",
|
68
68
|
"filename" => "appsignal-aarch64-linux-all-static.tar.gz"
|
69
69
|
},
|
70
70
|
"dynamic" => {
|
71
|
-
"checksum" => "
|
71
|
+
"checksum" => "8b580113f28781063be3538c8097c837ac85c3213c80d2597c00e32786921ef1",
|
72
72
|
"filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
|
73
73
|
}
|
74
74
|
},
|
75
75
|
"i686-linux" => {
|
76
76
|
"static" => {
|
77
|
-
"checksum" => "
|
77
|
+
"checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
|
78
78
|
"filename" => "appsignal-i686-linux-all-static.tar.gz"
|
79
79
|
},
|
80
80
|
"dynamic" => {
|
81
|
-
"checksum" => "
|
81
|
+
"checksum" => "03a066d55a5722802d053f8bdfdbe4bcb4ba9ee72b27d6a39aa62adad037f273",
|
82
82
|
"filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"x86-linux" => {
|
86
86
|
"static" => {
|
87
|
-
"checksum" => "
|
87
|
+
"checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
|
88
88
|
"filename" => "appsignal-i686-linux-all-static.tar.gz"
|
89
89
|
},
|
90
90
|
"dynamic" => {
|
91
|
-
"checksum" => "
|
91
|
+
"checksum" => "03a066d55a5722802d053f8bdfdbe4bcb4ba9ee72b27d6a39aa62adad037f273",
|
92
92
|
"filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
|
93
93
|
}
|
94
94
|
},
|
95
95
|
"x86_64-linux" => {
|
96
96
|
"static" => {
|
97
|
-
"checksum" => "
|
97
|
+
"checksum" => "f3efd7973a0a4b5a0dca7ef23a896a866f011e70d90e2d22cd77c343ffbdf0c1",
|
98
98
|
"filename" => "appsignal-x86_64-linux-all-static.tar.gz"
|
99
99
|
},
|
100
100
|
"dynamic" => {
|
101
|
-
"checksum" => "
|
101
|
+
"checksum" => "0900dd8f79838943532db19876018d95065b851eeb5f01c15dfb227bce7a01d8",
|
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" => "
|
107
|
+
"checksum" => "9e0cc593389e08527d2e62cc4389711a137511021fd59abd311da8ef5343aee6",
|
108
108
|
"filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
|
109
109
|
},
|
110
110
|
"dynamic" => {
|
111
|
-
"checksum" => "
|
111
|
+
"checksum" => "b4420a303780e8733387338dca5a0f7dce03c4e0ec95526ec108bc66f39970ab",
|
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" => "
|
117
|
+
"checksum" => "5112c3d0b22f27e6ed108d671ec2903f4cbe084c8d104a05bc946d88ccfed633",
|
118
118
|
"filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
|
119
119
|
},
|
120
120
|
"dynamic" => {
|
121
|
-
"checksum" => "
|
121
|
+
"checksum" => "f15aaacdb197b114113c9a382ab371623e49ed0593af8a7d3c7d84aa10b77556",
|
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" => "
|
127
|
+
"checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
|
128
128
|
"filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
|
129
129
|
},
|
130
130
|
"dynamic" => {
|
131
|
-
"checksum" => "
|
131
|
+
"checksum" => "9ba8d1c731212b23dccd76f22ad6979da160fe0d688f383acf8126c8922ecbdf",
|
132
132
|
"filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
|
133
133
|
}
|
134
134
|
},
|
135
135
|
"amd64-freebsd" => {
|
136
136
|
"static" => {
|
137
|
-
"checksum" => "
|
137
|
+
"checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
|
138
138
|
"filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
|
139
139
|
},
|
140
140
|
"dynamic" => {
|
141
|
-
"checksum" => "
|
141
|
+
"checksum" => "9ba8d1c731212b23dccd76f22ad6979da160fe0d688f383acf8126c8922ecbdf",
|
142
142
|
"filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
|
143
143
|
}
|
144
144
|
}
|
data/lib/appsignal/config.rb
CHANGED
@@ -120,64 +120,67 @@ module Appsignal
|
|
120
120
|
}.freeze
|
121
121
|
|
122
122
|
# @api private
|
123
|
-
|
124
|
-
"APPSIGNAL_ACTIVEJOB_REPORT_ERRORS"
|
125
|
-
"APPSIGNAL_APP_NAME"
|
126
|
-
"APPSIGNAL_BIND_ADDRESS"
|
127
|
-
"APPSIGNAL_CA_FILE_PATH"
|
128
|
-
"APPSIGNAL_HOSTNAME"
|
129
|
-
"APPSIGNAL_HOST_ROLE"
|
130
|
-
"APPSIGNAL_HTTP_PROXY"
|
131
|
-
"APPSIGNAL_LOG"
|
132
|
-
"APPSIGNAL_LOG_LEVEL"
|
133
|
-
"APPSIGNAL_LOG_PATH"
|
134
|
-
"APPSIGNAL_LOGGING_ENDPOINT"
|
135
|
-
"APPSIGNAL_PUSH_API_ENDPOINT"
|
136
|
-
"APPSIGNAL_PUSH_API_KEY"
|
137
|
-
"APPSIGNAL_SIDEKIQ_REPORT_ERRORS"
|
138
|
-
"APPSIGNAL_STATSD_PORT"
|
139
|
-
"APPSIGNAL_WORKING_DIRECTORY_PATH"
|
140
|
-
"APP_REVISION"
|
123
|
+
STRING_OPTIONS = {
|
124
|
+
:activejob_report_errors => "APPSIGNAL_ACTIVEJOB_REPORT_ERRORS",
|
125
|
+
:name => "APPSIGNAL_APP_NAME",
|
126
|
+
:bind_address => "APPSIGNAL_BIND_ADDRESS",
|
127
|
+
:ca_file_path => "APPSIGNAL_CA_FILE_PATH",
|
128
|
+
:hostname => "APPSIGNAL_HOSTNAME",
|
129
|
+
:host_role => "APPSIGNAL_HOST_ROLE",
|
130
|
+
:http_proxy => "APPSIGNAL_HTTP_PROXY",
|
131
|
+
:log => "APPSIGNAL_LOG",
|
132
|
+
:log_level => "APPSIGNAL_LOG_LEVEL",
|
133
|
+
:log_path => "APPSIGNAL_LOG_PATH",
|
134
|
+
:logging_endpoint => "APPSIGNAL_LOGGING_ENDPOINT",
|
135
|
+
:endpoint => "APPSIGNAL_PUSH_API_ENDPOINT",
|
136
|
+
:push_api_key => "APPSIGNAL_PUSH_API_KEY",
|
137
|
+
:sidekiq_report_errors => "APPSIGNAL_SIDEKIQ_REPORT_ERRORS",
|
138
|
+
:statsd_port => "APPSIGNAL_STATSD_PORT",
|
139
|
+
:working_directory_path => "APPSIGNAL_WORKING_DIRECTORY_PATH",
|
140
|
+
:revision => "APP_REVISION"
|
141
141
|
}.freeze
|
142
|
+
|
142
143
|
# @api private
|
143
|
-
|
144
|
-
"APPSIGNAL_ACTIVE"
|
145
|
-
"APPSIGNAL_ENABLE_ALLOCATION_TRACKING"
|
146
|
-
"APPSIGNAL_ENABLE_AT_EXIT_REPORTER"
|
147
|
-
"APPSIGNAL_ENABLE_HOST_METRICS"
|
148
|
-
"APPSIGNAL_ENABLE_MINUTELY_PROBES"
|
149
|
-
"APPSIGNAL_ENABLE_STATSD"
|
150
|
-
"APPSIGNAL_ENABLE_NGINX_METRICS"
|
151
|
-
"APPSIGNAL_ENABLE_GVL_GLOBAL_TIMER"
|
152
|
-
"APPSIGNAL_ENABLE_GVL_WAITING_THREADS"
|
153
|
-
"APPSIGNAL_ENABLE_RAILS_ERROR_REPORTER"
|
154
|
-
|
155
|
-
|
156
|
-
"APPSIGNAL_FILES_WORLD_ACCESSIBLE"
|
157
|
-
"APPSIGNAL_INSTRUMENT_HTTP_RB"
|
158
|
-
"APPSIGNAL_INSTRUMENT_NET_HTTP"
|
159
|
-
"APPSIGNAL_INSTRUMENT_REDIS"
|
160
|
-
"APPSIGNAL_INSTRUMENT_SEQUEL"
|
161
|
-
"APPSIGNAL_RUNNING_IN_CONTAINER"
|
162
|
-
"APPSIGNAL_SEND_ENVIRONMENT_METADATA"
|
163
|
-
"APPSIGNAL_SEND_PARAMS"
|
164
|
-
"APPSIGNAL_SEND_SESSION_DATA"
|
144
|
+
BOOLEAN_OPTIONS = {
|
145
|
+
:active => "APPSIGNAL_ACTIVE",
|
146
|
+
:enable_allocation_tracking => "APPSIGNAL_ENABLE_ALLOCATION_TRACKING",
|
147
|
+
:enable_at_exit_reporter => "APPSIGNAL_ENABLE_AT_EXIT_REPORTER",
|
148
|
+
:enable_host_metrics => "APPSIGNAL_ENABLE_HOST_METRICS",
|
149
|
+
:enable_minutely_probes => "APPSIGNAL_ENABLE_MINUTELY_PROBES",
|
150
|
+
:enable_statsd => "APPSIGNAL_ENABLE_STATSD",
|
151
|
+
:enable_nginx_metrics => "APPSIGNAL_ENABLE_NGINX_METRICS",
|
152
|
+
:enable_gvl_global_timer => "APPSIGNAL_ENABLE_GVL_GLOBAL_TIMER",
|
153
|
+
:enable_gvl_waiting_threads => "APPSIGNAL_ENABLE_GVL_WAITING_THREADS",
|
154
|
+
:enable_rails_error_reporter => "APPSIGNAL_ENABLE_RAILS_ERROR_REPORTER",
|
155
|
+
:enable_rake_performance_instrumentation =>
|
156
|
+
"APPSIGNAL_ENABLE_RAKE_PERFORMANCE_INSTRUMENTATION",
|
157
|
+
:files_world_accessible => "APPSIGNAL_FILES_WORLD_ACCESSIBLE",
|
158
|
+
:instrument_http_rb => "APPSIGNAL_INSTRUMENT_HTTP_RB",
|
159
|
+
:instrument_net_http => "APPSIGNAL_INSTRUMENT_NET_HTTP",
|
160
|
+
:instrument_redis => "APPSIGNAL_INSTRUMENT_REDIS",
|
161
|
+
:instrument_sequel => "APPSIGNAL_INSTRUMENT_SEQUEL",
|
162
|
+
:running_in_container => "APPSIGNAL_RUNNING_IN_CONTAINER",
|
163
|
+
:send_environment_metadata => "APPSIGNAL_SEND_ENVIRONMENT_METADATA",
|
164
|
+
:send_params => "APPSIGNAL_SEND_PARAMS",
|
165
|
+
:send_session_data => "APPSIGNAL_SEND_SESSION_DATA"
|
165
166
|
}.freeze
|
167
|
+
|
166
168
|
# @api private
|
167
|
-
|
168
|
-
"APPSIGNAL_DNS_SERVERS"
|
169
|
-
"APPSIGNAL_FILTER_METADATA"
|
170
|
-
"APPSIGNAL_FILTER_PARAMETERS"
|
171
|
-
"APPSIGNAL_FILTER_SESSION_DATA"
|
172
|
-
"APPSIGNAL_IGNORE_ACTIONS"
|
173
|
-
"APPSIGNAL_IGNORE_ERRORS"
|
174
|
-
"APPSIGNAL_IGNORE_LOGS"
|
175
|
-
"APPSIGNAL_IGNORE_NAMESPACES"
|
176
|
-
"APPSIGNAL_REQUEST_HEADERS"
|
169
|
+
ARRAY_OPTIONS = {
|
170
|
+
:dns_servers => "APPSIGNAL_DNS_SERVERS",
|
171
|
+
:filter_metadata => "APPSIGNAL_FILTER_METADATA",
|
172
|
+
:filter_parameters => "APPSIGNAL_FILTER_PARAMETERS",
|
173
|
+
:filter_session_data => "APPSIGNAL_FILTER_SESSION_DATA",
|
174
|
+
:ignore_actions => "APPSIGNAL_IGNORE_ACTIONS",
|
175
|
+
:ignore_errors => "APPSIGNAL_IGNORE_ERRORS",
|
176
|
+
:ignore_logs => "APPSIGNAL_IGNORE_LOGS",
|
177
|
+
:ignore_namespaces => "APPSIGNAL_IGNORE_NAMESPACES",
|
178
|
+
:request_headers => "APPSIGNAL_REQUEST_HEADERS"
|
177
179
|
}.freeze
|
180
|
+
|
178
181
|
# @api private
|
179
|
-
|
180
|
-
"APPSIGNAL_CPU_COUNT"
|
182
|
+
FLOAT_OPTIONS = {
|
183
|
+
:cpu_count => "APPSIGNAL_CPU_COUNT"
|
181
184
|
}.freeze
|
182
185
|
|
183
186
|
# @api private
|
@@ -240,15 +243,26 @@ module Appsignal
|
|
240
243
|
@system_config = detect_from_system
|
241
244
|
merge(system_config)
|
242
245
|
|
243
|
-
# Set defaults from loaders in reverse order so the first
|
246
|
+
# Set defaults from loaders in reverse order so the first registered
|
244
247
|
# loader's defaults overwrite all others
|
245
248
|
self.class.loader_defaults.reverse.each do |loader_defaults|
|
249
|
+
options = config_hash
|
250
|
+
new_loader_defaults = {}
|
246
251
|
defaults = loader_defaults[:options]
|
247
|
-
|
252
|
+
defaults.each do |option, value|
|
253
|
+
new_loader_defaults[option] =
|
254
|
+
if ARRAY_OPTIONS.key?(option)
|
255
|
+
# Merge arrays: new value first
|
256
|
+
value + options[option]
|
257
|
+
else
|
258
|
+
value
|
259
|
+
end
|
260
|
+
end
|
261
|
+
@loaders_config.merge!(new_loader_defaults.merge(
|
248
262
|
:root_path => loader_defaults[:root_path],
|
249
263
|
:env => loader_defaults[:env]
|
250
264
|
))
|
251
|
-
merge(
|
265
|
+
merge(new_loader_defaults)
|
252
266
|
end
|
253
267
|
|
254
268
|
# Track origin of env
|
@@ -470,7 +484,7 @@ module Appsignal
|
|
470
484
|
config = {}
|
471
485
|
|
472
486
|
# Configuration with string type
|
473
|
-
|
487
|
+
STRING_OPTIONS.each do |option, env_key|
|
474
488
|
env_var = ENV.fetch(env_key, nil)
|
475
489
|
next unless env_var
|
476
490
|
|
@@ -478,7 +492,7 @@ module Appsignal
|
|
478
492
|
end
|
479
493
|
|
480
494
|
# Configuration with boolean type
|
481
|
-
|
495
|
+
BOOLEAN_OPTIONS.each do |option, env_key|
|
482
496
|
env_var = ENV.fetch(env_key, nil)
|
483
497
|
next unless env_var
|
484
498
|
|
@@ -486,7 +500,7 @@ module Appsignal
|
|
486
500
|
end
|
487
501
|
|
488
502
|
# Configuration with array of strings type
|
489
|
-
|
503
|
+
ARRAY_OPTIONS.each do |option, env_key|
|
490
504
|
env_var = ENV.fetch(env_key, nil)
|
491
505
|
next unless env_var
|
492
506
|
|
@@ -494,7 +508,7 @@ module Appsignal
|
|
494
508
|
end
|
495
509
|
|
496
510
|
# Configuration with float type
|
497
|
-
|
511
|
+
FLOAT_OPTIONS.each do |option, env_key|
|
498
512
|
env_var = ENV.fetch(env_key, nil)
|
499
513
|
next unless env_var
|
500
514
|
|
@@ -550,7 +564,11 @@ module Appsignal
|
|
550
564
|
@config.env
|
551
565
|
end
|
552
566
|
|
553
|
-
|
567
|
+
def activate_if_environment(*envs)
|
568
|
+
self.active = envs.map(&:to_s).include?(env)
|
569
|
+
end
|
570
|
+
|
571
|
+
Appsignal::Config::STRING_OPTIONS.each_key do |option|
|
554
572
|
define_method(option) do
|
555
573
|
fetch_option(option)
|
556
574
|
end
|
@@ -560,7 +578,7 @@ module Appsignal
|
|
560
578
|
end
|
561
579
|
end
|
562
580
|
|
563
|
-
Appsignal::Config::
|
581
|
+
Appsignal::Config::BOOLEAN_OPTIONS.each_key do |option|
|
564
582
|
define_method(option) do
|
565
583
|
fetch_option(option)
|
566
584
|
end
|
@@ -570,7 +588,7 @@ module Appsignal
|
|
570
588
|
end
|
571
589
|
end
|
572
590
|
|
573
|
-
Appsignal::Config::
|
591
|
+
Appsignal::Config::ARRAY_OPTIONS.each_key do |option|
|
574
592
|
define_method(option) do
|
575
593
|
fetch_option(option)
|
576
594
|
end
|
@@ -580,7 +598,7 @@ module Appsignal
|
|
580
598
|
end
|
581
599
|
end
|
582
600
|
|
583
|
-
Appsignal::Config::
|
601
|
+
Appsignal::Config::FLOAT_OPTIONS.each_key do |option|
|
584
602
|
define_method(option) do
|
585
603
|
fetch_option(option)
|
586
604
|
end
|
@@ -52,7 +52,7 @@ module Appsignal
|
|
52
52
|
transaction.set_metadata("method", "websocket")
|
53
53
|
transaction.add_params_if_nil { request.params }
|
54
54
|
transaction.add_headers_if_nil { request.env }
|
55
|
-
transaction.add_session_data { request.session if request.respond_to? :session }
|
55
|
+
transaction.add_session_data { request.session.to_h if request.respond_to? :session }
|
56
56
|
transaction.add_tags(:request_id => request_id) if request_id
|
57
57
|
Appsignal::Transaction.complete_current!
|
58
58
|
end
|
@@ -88,7 +88,7 @@ module Appsignal
|
|
88
88
|
transaction.set_metadata("method", "websocket")
|
89
89
|
transaction.add_params_if_nil { request.params }
|
90
90
|
transaction.add_headers_if_nil { request.env }
|
91
|
-
transaction.add_session_data { request.session if request.respond_to? :session }
|
91
|
+
transaction.add_session_data { request.session.to_h if request.respond_to? :session }
|
92
92
|
transaction.add_tags(:request_id => request_id) if request_id
|
93
93
|
Appsignal::Transaction.complete_current!
|
94
94
|
end
|
@@ -21,6 +21,7 @@ module Appsignal
|
|
21
21
|
ensure
|
22
22
|
transaction.set_action_if_nil("#{self.class}##{args.first["action"]}")
|
23
23
|
transaction.add_params_if_nil(args.first)
|
24
|
+
transaction.add_session_data { request.session.to_h if request.respond_to? :session }
|
24
25
|
transaction.set_metadata("path", request.path)
|
25
26
|
transaction.set_metadata("method", "websocket")
|
26
27
|
transaction.add_tags(:request_id => request_id) if request_id
|
@@ -45,7 +45,8 @@ module Appsignal
|
|
45
45
|
:root_path => Rails.root,
|
46
46
|
:env => Rails.env,
|
47
47
|
:name => Appsignal::Utils::RailsHelper.detected_rails_app_name,
|
48
|
-
:log_path => Rails.root.join("log")
|
48
|
+
:log_path => Rails.root.join("log"),
|
49
|
+
:ignore_actions => ["Rails::HealthController#show"]
|
49
50
|
)
|
50
51
|
end
|
51
52
|
|
@@ -641,7 +641,7 @@ module Appsignal
|
|
641
641
|
end
|
642
642
|
|
643
643
|
BACKTRACE_REGEX =
|
644
|
-
%r{(?<gem>[\w-]+ \(.+\) )?(?<path>:?/?\w+?.+?):(?<line>:?\d+)(
|
644
|
+
%r{(?<gem>[\w-]+ \(.+\) )?(?<path>:?/?\w+?.+?):(?<line>:?\d+)(?::in `(?<method>.+)')?$}.freeze
|
645
645
|
|
646
646
|
def first_formatted_backtrace_line(error)
|
647
647
|
backtrace = cleaned_backtrace(error.backtrace)
|
@@ -655,7 +655,6 @@ module Appsignal
|
|
655
655
|
.merge("original" => first_line)
|
656
656
|
.tap do |c|
|
657
657
|
config = Appsignal.config
|
658
|
-
c.delete("group") # Unused key, only for easier matching
|
659
658
|
# Strip of whitespace at the end of the gem name
|
660
659
|
c["gem"] = c["gem"]&.strip
|
661
660
|
# Strip the app path from the path if present
|
@@ -667,6 +666,8 @@ module Appsignal
|
|
667
666
|
end
|
668
667
|
# Add revision for linking to the repository from the UI
|
669
668
|
c["revision"] = config[:revision]
|
669
|
+
# Convert line number to an integer
|
670
|
+
c["line"] = c["line"].to_i
|
670
671
|
end
|
671
672
|
end
|
672
673
|
|
data/lib/appsignal/version.rb
CHANGED
data/lib/appsignal.rb
CHANGED
@@ -94,7 +94,7 @@ module Appsignal
|
|
94
94
|
# @since 0.7.0
|
95
95
|
def start # rubocop:disable Metrics/AbcSize
|
96
96
|
if ENV.fetch("_APPSIGNAL_DIAGNOSE", false)
|
97
|
-
internal_logger.
|
97
|
+
internal_logger.info("Skipping start in diagnose context")
|
98
98
|
return
|
99
99
|
end
|
100
100
|
|
@@ -231,20 +231,20 @@ module Appsignal
|
|
231
231
|
# @see Config
|
232
232
|
# @see https://docs.appsignal.com/ruby/configuration.html Configuration guide
|
233
233
|
# @see https://docs.appsignal.com/ruby/configuration/options.html Configuration options
|
234
|
-
def configure(
|
234
|
+
def configure(env_param = nil, root_path: nil)
|
235
235
|
if Appsignal.started?
|
236
236
|
Appsignal.internal_logger
|
237
237
|
.warn("AppSignal is already started. Ignoring `Appsignal.configure` call.")
|
238
238
|
return
|
239
239
|
end
|
240
240
|
|
241
|
-
|
242
|
-
|
241
|
+
root_path_param = root_path
|
242
|
+
if params_match_loaded_config?(env_param, root_path_param)
|
243
243
|
config
|
244
244
|
else
|
245
245
|
@config = Config.new(
|
246
|
-
|
247
|
-
Config.determine_env(
|
246
|
+
root_path_param || Config.determine_root_path,
|
247
|
+
Config.determine_env(env_param)
|
248
248
|
)
|
249
249
|
end
|
250
250
|
|
@@ -399,6 +399,15 @@ module Appsignal
|
|
399
399
|
|
400
400
|
private
|
401
401
|
|
402
|
+
def params_match_loaded_config?(env_param, root_path_param)
|
403
|
+
# No config present: can't match any config
|
404
|
+
return false unless config
|
405
|
+
|
406
|
+
# Check if the params, if present, match the loaded config
|
407
|
+
(env_param.nil? || config.env == env_param.to_s) &&
|
408
|
+
(root_path_param.nil? || config.root_path == root_path_param)
|
409
|
+
end
|
410
|
+
|
402
411
|
def start_internal_stdout_logger
|
403
412
|
@internal_logger = Appsignal::Utils::IntegrationLogger.new($stdout)
|
404
413
|
internal_logger.formatter = log_formatter("appsignal")
|
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.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
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-
|
13
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: logger
|
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
312
|
- !ruby/object:Gem::Version
|
313
313
|
version: '0'
|
314
314
|
requirements: []
|
315
|
-
rubygems_version: 3.
|
315
|
+
rubygems_version: 3.3.7
|
316
316
|
signing_key:
|
317
317
|
specification_version: 4
|
318
318
|
summary: Logs performance and exception data from your app to appsignal.com
|