appsignal 4.1.0 → 4.1.1

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: 6cc06af97e89c3a76097a8b22b34db9665a967b84d6ddf39fdccfe8aaadb8adc
4
- data.tar.gz: d00e77104454c2f28f6439a08293789edff5b8c758c5f349ac12d106953f323e
3
+ metadata.gz: fd929ef03ad3a9ceec274cc57e036614e3b2dfb76be026b8c0b878a35a5ce654
4
+ data.tar.gz: ef77980f54715f5b4a05ee218df8a0e51b3f867643ca793ef790dda3f324e05c
5
5
  SHA512:
6
- metadata.gz: 5f82c502d350b79840a9649fdb7e1dce6e7a64327b79f90b6090b950dbc0cf925486f76b24801cfd9c8c63b1b2b1926bc43914b340fe6eb9745271a3f59fe840
7
- data.tar.gz: 14b10d0ef16f27cc312d961526d21add84c329b2213e9ff518bf4d1a29e6d44c1cd7b4dbf8e3b3e1f87c19599d61f2b944d93262faaca54c0705985d481ebc88
6
+ metadata.gz: 0a6ad722785e28515a5d716df4dbf4aad9bc134718ebc2354cd4bcd3fda75c923cd1266f249e2d019cdc459ca43fc0ca2559cc4733859a05546a809f1e5f5410
7
+ data.tar.gz: 0cf285924ec8dd63cbcdb89a0354f76dfdc86d6737dc32c80f2538ae136b8653763b67a3507238db866751869d7c17f817eb2e766b4b7860584f4618be550d58
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 4.1.1
4
+
5
+ _Published on 2024-09-28._
6
+
7
+ ### Changed
8
+
9
+ - Add the `reported_by` tag to errors reported by the Rails error reporter so the source of the error is easier to identify. (patch [ff98ed67](https://github.com/appsignal/appsignal-ruby/commit/ff98ed677bf30242c51261bf7e44c9b6ba2f33ac))
10
+
11
+ ### Fixed
12
+
13
+ - Fix no AppSignal internal logs being logged from Capistrano tasks. (patch [089d0325](https://github.com/appsignal/appsignal-ruby/commit/089d03251c3dc8b83658a4ebfade51ab6bed1771))
14
+ - Report all the config options set via `Appsignal.config` in the DSL config source in the diagnose report. Previously, it would only report the options from the last time `Appsignal.configure` was called. (patch [27b9aff7](https://github.com/appsignal/appsignal-ruby/commit/27b9aff7776646dfef6c55fa589024a71052e70b))
15
+ - Fix 'no implicit conversion of Pathname into String' error when parsing backtrace lines of error causes in Rails apps. (patch [b767f269](https://github.com/appsignal/appsignal-ruby/commit/b767f269c41cb7625d6869d8e8acb9b288292d19))
16
+
3
17
  ## 4.1.0
4
18
 
5
19
  _Published on 2024-09-26._
@@ -180,36 +180,19 @@ module Appsignal
180
180
  "APPSIGNAL_CPU_COUNT" => :cpu_count
181
181
  }.freeze
182
182
 
183
- # @attribute [r] system_config
184
- # Config detected on the system level.
185
- # Used in diagnose report.
186
- # @api private
187
- # @return [Hash]
188
- # @!attribute [r] file_config
189
- # Config loaded from `config/appsignal.yml` config file.
190
- # Used in diagnose report.
191
- # @api private
192
- # @return [Hash]
193
- # @!attribute [r] env_config
194
- # Config loaded from the system environment.
195
- # Used in diagnose report.
196
- # @api private
197
- # @return [Hash]
198
- # @!attribute [r] config_hash
199
- # Config used by the AppSignal gem.
200
- # Combined Hash of the {system_config}, {file_config}, {env_config}
201
- # attributes.
202
- # @see #[]
203
- # @see #[]=
204
- # @api private
205
- # @return [Hash]
183
+ # @api private
184
+ attr_reader :root_path, :env, :config_hash
206
185
 
186
+ # List of config option sources. If a config option was set by a source,
187
+ # it's listed in that source's config options hash.
188
+ #
189
+ # These options are merged as the config is initialized.
190
+ # Their values cannot be changed after the config is initialized.
191
+ #
192
+ # Used by the diagnose report to list which value was read from which source.
207
193
  # @api private
208
- attr_accessor :root_path, :env, :config_hash
209
194
  attr_reader :system_config, :loaders_config, :initial_config, :file_config,
210
195
  :env_config, :override_config, :dsl_config
211
- # @api private
212
- attr_accessor :logger
213
196
 
214
197
  # Initialize a new configuration object for AppSignal.
215
198
  #
@@ -217,9 +200,6 @@ module Appsignal
217
200
  # @param env [String] The environment to load when AppSignal is started. It
218
201
  # will look for an environment with this name in the `config/appsignal.yml`
219
202
  # config file.
220
- # @param logger [Logger] The logger to use for the AppSignal gem. This is
221
- # used by the configuration class only. Default:
222
- # {Appsignal.internal_logger}. See also {Appsignal.start}.
223
203
  #
224
204
  # @api private
225
205
  # @see https://docs.appsignal.com/ruby/configuration/
@@ -230,13 +210,11 @@ module Appsignal
230
210
  # How to integrate AppSignal manually
231
211
  def initialize(
232
212
  root_path,
233
- env,
234
- logger = Appsignal.internal_logger
213
+ env
235
214
  )
236
- @root_path = root_path
215
+ @root_path = root_path.to_s
237
216
  @config_file_error = false
238
217
  @config_file = config_file
239
- @logger = logger
240
218
  @valid = false
241
219
 
242
220
  @env = env.to_s
@@ -402,7 +380,7 @@ module Appsignal
402
380
 
403
381
  # @api private
404
382
  def merge_dsl_options(options)
405
- @dsl_config = options
383
+ @dsl_config.merge!(options)
406
384
  merge(options)
407
385
  end
408
386
 
@@ -426,7 +404,7 @@ module Appsignal
426
404
  push_api_key = config_hash[:push_api_key] || ""
427
405
  if push_api_key.strip.empty?
428
406
  @valid = false
429
- @logger.error "Push API key not set after loading config"
407
+ logger.error "Push API key not set after loading config"
430
408
  else
431
409
  @valid = true
432
410
  end
@@ -445,6 +423,10 @@ module Appsignal
445
423
 
446
424
  private
447
425
 
426
+ def logger
427
+ Appsignal.internal_logger
428
+ end
429
+
448
430
  def config_file
449
431
  @config_file ||=
450
432
  root_path.nil? ? nil : File.join(root_path, "config", "appsignal.yml")
@@ -546,7 +528,7 @@ module Appsignal
546
528
 
547
529
  def merge(new_config)
548
530
  new_config.each do |key, value|
549
- @logger.debug("Config key '#{key}' is being overwritten") unless config_hash[key].nil?
531
+ logger.debug("Config key '#{key}' is being overwritten") unless config_hash[key].nil?
550
532
  config_hash[key] = value
551
533
  end
552
534
  end
@@ -10,12 +10,12 @@ namespace :appsignal do
10
10
 
11
11
  appsignal_config = Appsignal::Config.new(
12
12
  Dir.pwd,
13
- appsignal_env,
14
- Logger.new(StringIO.new)
13
+ appsignal_env
15
14
  ).tap do |c|
16
15
  c.merge_dsl_options(fetch(:appsignal_config, {}))
17
16
  c.validate
18
17
  end
18
+ Appsignal._start_logger
19
19
 
20
20
  if appsignal_config&.active?
21
21
  marker_data = {
@@ -18,12 +18,12 @@ module Appsignal
18
18
 
19
19
  appsignal_config = Appsignal::Config.new(
20
20
  ENV.fetch("PWD", nil),
21
- env,
22
- Appsignal::Utils::IntegrationLogger.new(StringIO.new)
21
+ env
23
22
  ).tap do |c|
24
23
  c.merge_dsl_options(fetch(:appsignal_config, {}))
25
24
  c.validate
26
25
  end
26
+ Appsignal._start_logger
27
27
 
28
28
  if appsignal_config&.active?
29
29
  marker_data = {
@@ -94,6 +94,7 @@ module Appsignal
94
94
  transaction.set_action(action_name) if action_name
95
95
  transaction.add_custom_data(custom_data) if custom_data
96
96
 
97
+ tags[:reported_by] = :rails_error_reporter
97
98
  tags[:severity] = severity
98
99
  tags[:source] = source.to_s if source
99
100
  transaction.add_tags(tags)
@@ -107,7 +107,7 @@ module Appsignal
107
107
  if ca_file && File.exist?(ca_file) && File.readable?(ca_file)
108
108
  http.ca_file = ca_file
109
109
  else
110
- config.logger.warn "Ignoring non-existing or unreadable " \
110
+ Appsignal.internal_logger.warn "Ignoring non-existing or unreadable " \
111
111
  "`ca_file_path`: #{ca_file}"
112
112
  end
113
113
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "4.1.0"
4
+ VERSION = "4.1.1"
5
5
  end
data/lib/appsignal.rb CHANGED
@@ -244,8 +244,7 @@ module Appsignal
244
244
  else
245
245
  @config = Config.new(
246
246
  root_path || Config.determine_root_path,
247
- Config.determine_env(env),
248
- Appsignal.internal_logger
247
+ Config.determine_env(env)
249
248
  )
250
249
  end
251
250
 
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.0
4
+ version: 4.1.1
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-09-26 00:00:00.000000000 Z
13
+ date: 2024-09-28 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.3.7
315
+ rubygems_version: 3.5.14
316
316
  signing_key:
317
317
  specification_version: 4
318
318
  summary: Logs performance and exception data from your app to appsignal.com