appsignal 4.1.2-java → 4.1.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: 4ebb0a0dcb25f6b1d3a081538c731b3119d9c35a0d50f4fd4970d86d2883f56f
4
- data.tar.gz: c0c933abb03dcbf90b97f60a101821a27922d3f9882eb7e30e1c5aadccd19018
3
+ metadata.gz: 9d03cdf6cdea9ef98cbbd70225a3e699a91ca711626d44918b9256407bba9251
4
+ data.tar.gz: bffc65fe34303b5396b2d08df716022897dcdb98c36a627d7a63fe389210568f
5
5
  SHA512:
6
- metadata.gz: d4b363ba6154f2e05a9665da3984f10ef65fefaab3e402cf281d30d39f51fe3a50c8cf8b5a6d9d827b509965451264d30bbd0c0f1096991259a20de5b112597e
7
- data.tar.gz: f439966b51ea704309eef8422ebfbb098d98c850cae7084f0532b50f45c558ecbf5f87888b23f7337f916e25f7ea35b3868e935ee2eaab3c84a3f12766305645
6
+ metadata.gz: dcde40137a170bf8d81d9b69bf95fcf0925af59b6a9eec93e99d403bce04830a3e79b12e78f30ff27b5ac316ba221ad5a1dd9b02601414651cf30a57d9e480b2
7
+ data.tar.gz: de587e5a60a63385ff740cccc6bef444e3bf18abb9fb3580af2f5a16f70cd58bd64897e2b0e79851c6c1ed68658b219c25c7b54eb129b8c40ad3a87d7bd348ea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
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
+
3
67
  ## 4.1.2
4
68
 
5
69
  _Published on 2024-10-04._
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.35.26",
9
+ "version" => "0.35.28",
10
10
  "mirrors" => [
11
11
  "https://d135dj0rjqvssy.cloudfront.net",
12
12
  "https://appsignal-agent-releases.global.ssl.fastly.net"
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
14
14
  "triples" => {
15
15
  "x86_64-darwin" => {
16
16
  "static" => {
17
- "checksum" => "e0b0674dad04528f14048a0941fdacf9cbdb317627116c9b4dd7b786e572caa3",
17
+ "checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "a30a6502787df7354da94e0c86eff92745b712d916cb2740a7fdb412add15ffc",
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" => "e0b0674dad04528f14048a0941fdacf9cbdb317627116c9b4dd7b786e572caa3",
27
+ "checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "a30a6502787df7354da94e0c86eff92745b712d916cb2740a7fdb412add15ffc",
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" => "377d6eac5dc10de28275ec88a368f1c5da61438afa41f0767803d6c3a9399717",
37
+ "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "45dfb897e2aaacbe7e638f88781d50059c6cb1fcce624e33bef409c75e70ac7f",
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" => "377d6eac5dc10de28275ec88a368f1c5da61438afa41f0767803d6c3a9399717",
47
+ "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "45dfb897e2aaacbe7e638f88781d50059c6cb1fcce624e33bef409c75e70ac7f",
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" => "377d6eac5dc10de28275ec88a368f1c5da61438afa41f0767803d6c3a9399717",
57
+ "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "45dfb897e2aaacbe7e638f88781d50059c6cb1fcce624e33bef409c75e70ac7f",
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" => "67f927b89d9ef65f063c487bcd5bef832051a547d0b0f911589b4f90554c3185",
67
+ "checksum" => "02d62cfab5ab81faec40db6d80d47e53b2fca640026715697ab43f19539ace34",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "291fbaddd0fb48d300268fe80c41b069d2669da2e592a27831b13e850983c247",
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" => "aee4d5a74c0d5a39bf7047b2fb0c1ab0af4151bdf20b23c7095b024d8f34d6eb",
77
+ "checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "2bb793d036e7f605c0bb56b7c70a5107c4dd29a37966cdc33358287403b52c0a",
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" => "aee4d5a74c0d5a39bf7047b2fb0c1ab0af4151bdf20b23c7095b024d8f34d6eb",
87
+ "checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "2bb793d036e7f605c0bb56b7c70a5107c4dd29a37966cdc33358287403b52c0a",
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" => "595eef52453a179a6c5fde2a5d7206a85e07970a2dbceb631a19af20e05b46db",
97
+ "checksum" => "f3efd7973a0a4b5a0dca7ef23a896a866f011e70d90e2d22cd77c343ffbdf0c1",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "018754bf36f98246d961caf2d115ce345bf6f74fa160c2cbfa733820cd787396",
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" => "5992db83dc784e4aaec4cc4d4ebbd62a9d68ae7197697c34f3d4d820233c3238",
107
+ "checksum" => "9e0cc593389e08527d2e62cc4389711a137511021fd59abd311da8ef5343aee6",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "4b93de4ba07614c313822ee5cbc1d2f3dea2c864fe91e3b0ec6c79927a9e58e5",
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" => "f5d35cea12db1d473757d5fbed9c66e2018b6eaf35e0c96b2787f67e08ceae13",
117
+ "checksum" => "5112c3d0b22f27e6ed108d671ec2903f4cbe084c8d104a05bc946d88ccfed633",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "70309cff2e3f5330156c8ea530ccc537d4113eabe1d21590f8363c22803719fe",
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" => "6a696cde1d84fbc56e152d560100bd941276e7b1ddda38de81bc3e985780366a",
127
+ "checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "184e8fdb8bd69f0d0bd5fec1da66ae6ea87d2f447aac56e91d7a89e31c2c0cd0",
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" => "6a696cde1d84fbc56e152d560100bd941276e7b1ddda38de81bc3e985780366a",
137
+ "checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "184e8fdb8bd69f0d0bd5fec1da66ae6ea87d2f447aac56e91d7a89e31c2c0cd0",
141
+ "checksum" => "9ba8d1c731212b23dccd76f22ad6979da160fe0d688f383acf8126c8922ecbdf",
142
142
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
143
143
  }
144
144
  }
@@ -120,64 +120,67 @@ module Appsignal
120
120
  }.freeze
121
121
 
122
122
  # @api private
123
- ENV_STRING_KEYS = {
124
- "APPSIGNAL_ACTIVEJOB_REPORT_ERRORS" => :activejob_report_errors,
125
- "APPSIGNAL_APP_NAME" => :name,
126
- "APPSIGNAL_BIND_ADDRESS" => :bind_address,
127
- "APPSIGNAL_CA_FILE_PATH" => :ca_file_path,
128
- "APPSIGNAL_HOSTNAME" => :hostname,
129
- "APPSIGNAL_HOST_ROLE" => :host_role,
130
- "APPSIGNAL_HTTP_PROXY" => :http_proxy,
131
- "APPSIGNAL_LOG" => :log,
132
- "APPSIGNAL_LOG_LEVEL" => :log_level,
133
- "APPSIGNAL_LOG_PATH" => :log_path,
134
- "APPSIGNAL_LOGGING_ENDPOINT" => :logging_endpoint,
135
- "APPSIGNAL_PUSH_API_ENDPOINT" => :endpoint,
136
- "APPSIGNAL_PUSH_API_KEY" => :push_api_key,
137
- "APPSIGNAL_SIDEKIQ_REPORT_ERRORS" => :sidekiq_report_errors,
138
- "APPSIGNAL_STATSD_PORT" => :statsd_port,
139
- "APPSIGNAL_WORKING_DIRECTORY_PATH" => :working_directory_path,
140
- "APP_REVISION" => :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
- ENV_BOOLEAN_KEYS = {
144
- "APPSIGNAL_ACTIVE" => :active,
145
- "APPSIGNAL_ENABLE_ALLOCATION_TRACKING" => :enable_allocation_tracking,
146
- "APPSIGNAL_ENABLE_AT_EXIT_REPORTER" => :enable_at_exit_reporter,
147
- "APPSIGNAL_ENABLE_HOST_METRICS" => :enable_host_metrics,
148
- "APPSIGNAL_ENABLE_MINUTELY_PROBES" => :enable_minutely_probes,
149
- "APPSIGNAL_ENABLE_STATSD" => :enable_statsd,
150
- "APPSIGNAL_ENABLE_NGINX_METRICS" => :enable_nginx_metrics,
151
- "APPSIGNAL_ENABLE_GVL_GLOBAL_TIMER" => :enable_gvl_global_timer,
152
- "APPSIGNAL_ENABLE_GVL_WAITING_THREADS" => :enable_gvl_waiting_threads,
153
- "APPSIGNAL_ENABLE_RAILS_ERROR_REPORTER" => :enable_rails_error_reporter,
154
- "APPSIGNAL_ENABLE_RAKE_PERFORMANCE_INSTRUMENTATION" =>
155
- :enable_rake_performance_instrumentation,
156
- "APPSIGNAL_FILES_WORLD_ACCESSIBLE" => :files_world_accessible,
157
- "APPSIGNAL_INSTRUMENT_HTTP_RB" => :instrument_http_rb,
158
- "APPSIGNAL_INSTRUMENT_NET_HTTP" => :instrument_net_http,
159
- "APPSIGNAL_INSTRUMENT_REDIS" => :instrument_redis,
160
- "APPSIGNAL_INSTRUMENT_SEQUEL" => :instrument_sequel,
161
- "APPSIGNAL_RUNNING_IN_CONTAINER" => :running_in_container,
162
- "APPSIGNAL_SEND_ENVIRONMENT_METADATA" => :send_environment_metadata,
163
- "APPSIGNAL_SEND_PARAMS" => :send_params,
164
- "APPSIGNAL_SEND_SESSION_DATA" => :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
- ENV_ARRAY_KEYS = {
168
- "APPSIGNAL_DNS_SERVERS" => :dns_servers,
169
- "APPSIGNAL_FILTER_METADATA" => :filter_metadata,
170
- "APPSIGNAL_FILTER_PARAMETERS" => :filter_parameters,
171
- "APPSIGNAL_FILTER_SESSION_DATA" => :filter_session_data,
172
- "APPSIGNAL_IGNORE_ACTIONS" => :ignore_actions,
173
- "APPSIGNAL_IGNORE_ERRORS" => :ignore_errors,
174
- "APPSIGNAL_IGNORE_LOGS" => :ignore_logs,
175
- "APPSIGNAL_IGNORE_NAMESPACES" => :ignore_namespaces,
176
- "APPSIGNAL_REQUEST_HEADERS" => :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
- ENV_FLOAT_KEYS = {
180
- "APPSIGNAL_CPU_COUNT" => :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 register
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
- @loaders_config.merge!(defaults.merge(
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(defaults)
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
- ENV_STRING_KEYS.each do |env_key, option|
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
- ENV_BOOLEAN_KEYS.each do |env_key, option|
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
- ENV_ARRAY_KEYS.each do |env_key, option|
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
- ENV_FLOAT_KEYS.each do |env_key, option|
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
- Appsignal::Config::ENV_STRING_KEYS.each_value do |option|
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::ENV_BOOLEAN_KEYS.each_value do |option|
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::ENV_ARRAY_KEYS.each_value do |option|
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::ENV_FLOAT_KEYS.each_value do |option|
601
+ Appsignal::Config::FLOAT_OPTIONS.each_key do |option|
584
602
  define_method(option) do
585
603
  fetch_option(option)
586
604
  end
@@ -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+)(?<group>:in `(?<method>.+)')?$}.freeze # rubocop:disable Layout/LineLength
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "4.1.2"
4
+ VERSION = "4.1.3"
5
5
  end
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.warn("Skipping start in diagnose context")
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(env = nil, root_path: nil)
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
- if config && ((env.nil? || config.env == env.to_s) &&
242
- (root_path.nil? || config.root_path == root_path))
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
- root_path || Config.determine_root_path,
247
- Config.determine_env(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.2
4
+ version: 4.1.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-10-04 00:00:00.000000000 Z
13
+ date: 2024-11-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: logger
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  - !ruby/object:Gem::Version
327
327
  version: '0'
328
328
  requirements: []
329
- rubygems_version: 3.5.14
329
+ rubygems_version: 3.3.7
330
330
  signing_key:
331
331
  specification_version: 4
332
332
  summary: Logs performance and exception data from your app to appsignal.com