appsignal 4.5.17 → 4.6.0
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 +33 -0
- data/CLAUDE.md +177 -0
- data/README.md +17 -0
- data/appsignal.gemspec +1 -0
- data/build_matrix.yml +29 -0
- data/lib/appsignal/auth_check.rb +3 -3
- data/lib/appsignal/check_in/cron.rb +1 -1
- data/lib/appsignal/check_in/event.rb +1 -1
- data/lib/appsignal/check_in/scheduler.rb +3 -1
- data/lib/appsignal/check_in.rb +9 -6
- data/lib/appsignal/cli/diagnose.rb +1 -1
- data/lib/appsignal/cli.rb +1 -1
- data/lib/appsignal/config.rb +231 -30
- data/lib/appsignal/custom_marker.rb +3 -3
- data/lib/appsignal/environment.rb +7 -1
- data/lib/appsignal/event_formatter/action_view/render_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/active_record/instantiation_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/active_record/sql_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/elastic_search/search_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/faraday/request_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/rom/sql_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/sequel/sql_formatter.rb +1 -1
- data/lib/appsignal/event_formatter/view_component/render_formatter.rb +1 -1
- data/lib/appsignal/event_formatter.rb +41 -3
- data/lib/appsignal/extension.rb +1 -1
- data/lib/appsignal/garbage_collection.rb +1 -1
- data/lib/appsignal/helpers/instrumentation.rb +82 -35
- data/lib/appsignal/helpers/metrics.rb +12 -9
- data/lib/appsignal/hooks/action_cable.rb +1 -1
- data/lib/appsignal/hooks/action_mailer.rb +1 -0
- data/lib/appsignal/hooks/active_job.rb +1 -1
- data/lib/appsignal/hooks/active_support_notifications.rb +1 -1
- data/lib/appsignal/hooks/at_exit.rb +1 -1
- data/lib/appsignal/hooks/celluloid.rb +1 -1
- data/lib/appsignal/hooks/data_mapper.rb +1 -1
- data/lib/appsignal/hooks/delayed_job.rb +1 -1
- data/lib/appsignal/hooks/dry_monitor.rb +1 -1
- data/lib/appsignal/hooks/excon.rb +1 -1
- data/lib/appsignal/hooks/gvl.rb +1 -1
- data/lib/appsignal/hooks/http.rb +1 -1
- data/lib/appsignal/hooks/mongo_ruby_driver.rb +1 -1
- data/lib/appsignal/hooks/mri.rb +1 -1
- data/lib/appsignal/hooks/net_http.rb +1 -1
- data/lib/appsignal/hooks/ownership.rb +1 -1
- data/lib/appsignal/hooks/passenger.rb +1 -1
- data/lib/appsignal/hooks/puma.rb +1 -1
- data/lib/appsignal/hooks/que.rb +1 -1
- data/lib/appsignal/hooks/rake.rb +1 -1
- data/lib/appsignal/hooks/redis.rb +1 -1
- data/lib/appsignal/hooks/redis_client.rb +1 -1
- data/lib/appsignal/hooks/resque.rb +1 -1
- data/lib/appsignal/hooks/sequel.rb +2 -1
- data/lib/appsignal/hooks/shoryuken.rb +1 -1
- data/lib/appsignal/hooks/sidekiq.rb +1 -0
- data/lib/appsignal/hooks/unicorn.rb +1 -1
- data/lib/appsignal/hooks/webmachine.rb +1 -1
- data/lib/appsignal/hooks.rb +5 -3
- data/lib/appsignal/integrations/action_cable.rb +1 -1
- data/lib/appsignal/integrations/active_support_notifications.rb +1 -1
- data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +1 -1
- data/lib/appsignal/integrations/data_mapper.rb +1 -1
- data/lib/appsignal/integrations/delayed_job_plugin.rb +1 -1
- data/lib/appsignal/integrations/dry_monitor.rb +1 -1
- data/lib/appsignal/integrations/excon.rb +1 -1
- data/lib/appsignal/integrations/http.rb +1 -1
- data/lib/appsignal/integrations/mongo_ruby_driver.rb +1 -1
- data/lib/appsignal/integrations/net_http.rb +1 -1
- data/lib/appsignal/integrations/object.rb +18 -2
- data/lib/appsignal/integrations/ownership.rb +1 -1
- data/lib/appsignal/integrations/puma.rb +1 -1
- data/lib/appsignal/integrations/que.rb +1 -1
- data/lib/appsignal/integrations/railtie.rb +2 -2
- data/lib/appsignal/integrations/rake.rb +2 -2
- data/lib/appsignal/integrations/redis.rb +1 -1
- data/lib/appsignal/integrations/redis_client.rb +1 -1
- data/lib/appsignal/integrations/resque.rb +2 -2
- data/lib/appsignal/integrations/shoryuken.rb +1 -1
- data/lib/appsignal/integrations/sidekiq.rb +3 -3
- data/lib/appsignal/integrations/unicorn.rb +1 -1
- data/lib/appsignal/integrations/webmachine.rb +1 -1
- data/lib/appsignal/internal_errors.rb +2 -2
- data/lib/appsignal/loaders.rb +1 -1
- data/lib/appsignal/logger.rb +36 -19
- data/lib/appsignal/marker.rb +1 -1
- data/lib/appsignal/probes/gvl.rb +4 -3
- data/lib/appsignal/probes/helpers.rb +1 -1
- data/lib/appsignal/probes/mri.rb +3 -3
- data/lib/appsignal/probes/sidekiq.rb +4 -3
- data/lib/appsignal/probes.rb +20 -15
- data/lib/appsignal/rack.rb +1 -1
- data/lib/appsignal/sample_data.rb +31 -12
- data/lib/appsignal/span.rb +1 -1
- data/lib/appsignal/system.rb +9 -8
- data/lib/appsignal/transaction.rb +72 -52
- data/lib/appsignal/transmitter.rb +1 -1
- data/lib/appsignal/utils.rb +1 -1
- data/lib/appsignal/version.rb +2 -1
- data/lib/appsignal.rb +22 -14
- data/lib/puma/plugin/appsignal.rb +1 -1
- data/sig/appsignal.rbi +2599 -0
- data/sig/appsignal.rbs +2420 -0
- metadata +20 -6
data/lib/appsignal/config.rb
CHANGED
@@ -8,12 +8,12 @@ require "tmpdir"
|
|
8
8
|
|
9
9
|
module Appsignal
|
10
10
|
class Config
|
11
|
-
#
|
11
|
+
# @!visibility private
|
12
12
|
def self.loader_defaults
|
13
13
|
@loader_defaults ||= []
|
14
14
|
end
|
15
15
|
|
16
|
-
#
|
16
|
+
# @!visibility private
|
17
17
|
def self.add_loader_defaults(name, env: nil, root_path: nil, **options)
|
18
18
|
if Appsignal.config
|
19
19
|
Appsignal.internal_logger.warn(
|
@@ -31,7 +31,7 @@ module Appsignal
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Determine which env AppSignal should initialize with.
|
34
|
-
#
|
34
|
+
# @!visibility private
|
35
35
|
def self.determine_env(initial_env = nil)
|
36
36
|
[
|
37
37
|
initial_env,
|
@@ -54,7 +54,7 @@ module Appsignal
|
|
54
54
|
end
|
55
55
|
|
56
56
|
# Determine which root path AppSignal should initialize with.
|
57
|
-
#
|
57
|
+
# @!visibility private
|
58
58
|
def self.determine_root_path
|
59
59
|
app_path_env_var = ENV.fetch("APPSIGNAL_APP_PATH", nil)
|
60
60
|
return app_path_env_var if app_path_env_var
|
@@ -67,7 +67,7 @@ module Appsignal
|
|
67
67
|
Dir.pwd
|
68
68
|
end
|
69
69
|
|
70
|
-
#
|
70
|
+
# @!visibility private
|
71
71
|
class Context
|
72
72
|
DSL_FILENAME = "config/appsignal.rb"
|
73
73
|
|
@@ -87,7 +87,7 @@ module Appsignal
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
#
|
90
|
+
# @!visibility private
|
91
91
|
DEFAULT_CONFIG = {
|
92
92
|
:activejob_report_errors => "all",
|
93
93
|
:ca_file_path => File.expand_path(File.join("../../../resources/cacert.pem"), __FILE__),
|
@@ -133,12 +133,12 @@ module Appsignal
|
|
133
133
|
:sidekiq_report_errors => "all"
|
134
134
|
}.freeze
|
135
135
|
|
136
|
-
#
|
136
|
+
# @!visibility private
|
137
137
|
DEFAULT_LOG_LEVEL = ::Logger::INFO
|
138
138
|
# Map from the `log_level` config option to Ruby's Logger level value.
|
139
139
|
#
|
140
140
|
# The trace level doesn't exist in the Ruby logger so it's mapped to debug.
|
141
|
-
#
|
141
|
+
# @!visibility private
|
142
142
|
LOG_LEVEL_MAP = {
|
143
143
|
"error" => ::Logger::ERROR,
|
144
144
|
"warn" => ::Logger::WARN,
|
@@ -148,7 +148,7 @@ module Appsignal
|
|
148
148
|
"trace" => ::Logger::DEBUG
|
149
149
|
}.freeze
|
150
150
|
|
151
|
-
#
|
151
|
+
# @!visibility private
|
152
152
|
STRING_OPTIONS = {
|
153
153
|
:activejob_report_errors => "APPSIGNAL_ACTIVEJOB_REPORT_ERRORS",
|
154
154
|
:name => "APPSIGNAL_APP_NAME",
|
@@ -171,7 +171,7 @@ module Appsignal
|
|
171
171
|
:revision => "APP_REVISION"
|
172
172
|
}.freeze
|
173
173
|
|
174
|
-
#
|
174
|
+
# @!visibility private
|
175
175
|
BOOLEAN_OPTIONS = {
|
176
176
|
:active => "APPSIGNAL_ACTIVE",
|
177
177
|
:enable_allocation_tracking => "APPSIGNAL_ENABLE_ALLOCATION_TRACKING",
|
@@ -198,7 +198,7 @@ module Appsignal
|
|
198
198
|
:send_session_data => "APPSIGNAL_SEND_SESSION_DATA"
|
199
199
|
}.freeze
|
200
200
|
|
201
|
-
#
|
201
|
+
# @!visibility private
|
202
202
|
ARRAY_OPTIONS = {
|
203
203
|
:dns_servers => "APPSIGNAL_DNS_SERVERS",
|
204
204
|
:filter_metadata => "APPSIGNAL_FILTER_METADATA",
|
@@ -211,12 +211,12 @@ module Appsignal
|
|
211
211
|
:request_headers => "APPSIGNAL_REQUEST_HEADERS"
|
212
212
|
}.freeze
|
213
213
|
|
214
|
-
#
|
214
|
+
# @!visibility private
|
215
215
|
FLOAT_OPTIONS = {
|
216
216
|
:cpu_count => "APPSIGNAL_CPU_COUNT"
|
217
217
|
}.freeze
|
218
218
|
|
219
|
-
#
|
219
|
+
# @!visibility private
|
220
220
|
attr_reader :root_path, :env, :config_hash
|
221
221
|
|
222
222
|
# List of config option sources. If a config option was set by a source,
|
@@ -226,18 +226,20 @@ module Appsignal
|
|
226
226
|
# Their values cannot be changed after the config is initialized.
|
227
227
|
#
|
228
228
|
# Used by the diagnose report to list which value was read from which source.
|
229
|
-
#
|
229
|
+
# @!visibility private
|
230
230
|
attr_reader :system_config, :loaders_config, :initial_config, :file_config,
|
231
231
|
:env_config, :override_config, :dsl_config
|
232
232
|
|
233
|
-
# Initialize a new configuration object
|
233
|
+
# Initialize a new AppSignal configuration object.
|
234
234
|
#
|
235
|
-
# @param root_path [String]
|
235
|
+
# @param root_path [String] Path to the root of the application.
|
236
236
|
# @param env [String] The environment to load when AppSignal is started. It
|
237
237
|
# will look for an environment with this name in the `config/appsignal.yml`
|
238
238
|
# config file.
|
239
|
-
#
|
240
|
-
#
|
239
|
+
# @param load_yaml_file [Boolean] Whether to load configuration from
|
240
|
+
# the YAML config file. Defaults to true.
|
241
|
+
# @return [Config] The initialized configuration object.
|
242
|
+
# @!visibility private
|
241
243
|
# @see https://docs.appsignal.com/ruby/configuration/
|
242
244
|
# Configuration documentation
|
243
245
|
# @see https://docs.appsignal.com/ruby/configuration/load-order.html
|
@@ -268,7 +270,7 @@ module Appsignal
|
|
268
270
|
load_config
|
269
271
|
end
|
270
272
|
|
271
|
-
#
|
273
|
+
# @!visibility private
|
272
274
|
def load_config
|
273
275
|
# Set defaults
|
274
276
|
# Deep duplicate each frozen default value
|
@@ -327,8 +329,8 @@ module Appsignal
|
|
327
329
|
@env_config[:env] = env_loaded_from_env if env_loaded_from_env
|
328
330
|
end
|
329
331
|
|
330
|
-
# @api private
|
331
332
|
# @return [String] System's tmp directory.
|
333
|
+
# @!visibility private
|
332
334
|
def self.system_tmp_dir
|
333
335
|
if Gem.win_platform?
|
334
336
|
Dir.tmpdir
|
@@ -337,7 +339,11 @@ module Appsignal
|
|
337
339
|
end
|
338
340
|
end
|
339
341
|
|
340
|
-
#
|
342
|
+
# Fetch a configuration value by key.
|
343
|
+
#
|
344
|
+
# @param key [Symbol, String] The configuration option key to fetch.
|
345
|
+
# @return [Object] The configuration value.
|
346
|
+
# @!visibility private
|
341
347
|
def [](key)
|
342
348
|
config_hash[key]
|
343
349
|
end
|
@@ -347,12 +353,15 @@ module Appsignal
|
|
347
353
|
# This method does not update the config in the extension and agent. It
|
348
354
|
# should not be used to update the config after AppSignal has started.
|
349
355
|
#
|
350
|
-
# @
|
356
|
+
# @param key [Symbol, String] The configuration option key to set.
|
357
|
+
# @param value [Object] The configuration value to set.
|
358
|
+
# @return [void]
|
359
|
+
# @!visibility private
|
351
360
|
def []=(key, value)
|
352
361
|
config_hash[key] = value
|
353
362
|
end
|
354
363
|
|
355
|
-
#
|
364
|
+
# @!visibility private
|
356
365
|
def log_level
|
357
366
|
option = config_hash[:log_level]
|
358
367
|
level =
|
@@ -363,7 +372,7 @@ module Appsignal
|
|
363
372
|
level.nil? ? Appsignal::Config::DEFAULT_LOG_LEVEL : level
|
364
373
|
end
|
365
374
|
|
366
|
-
#
|
375
|
+
# @!visibility private
|
367
376
|
def log_file_path
|
368
377
|
return @log_file_path if defined? @log_file_path
|
369
378
|
|
@@ -390,19 +399,28 @@ module Appsignal
|
|
390
399
|
@log_file_path
|
391
400
|
end
|
392
401
|
|
402
|
+
# Check if the configuration is valid.
|
403
|
+
#
|
404
|
+
# @return [Boolean] True if the configuration is valid, false otherwise.
|
393
405
|
def valid?
|
394
406
|
@valid
|
395
407
|
end
|
396
408
|
|
409
|
+
# Check if AppSignal is active for the current environment.
|
410
|
+
#
|
411
|
+
# @return [Boolean] True if active for the current environment.
|
397
412
|
def active_for_env?
|
398
413
|
config_hash[:active]
|
399
414
|
end
|
400
415
|
|
416
|
+
# Check if AppSignal is active.
|
417
|
+
#
|
418
|
+
# @return [Boolean] True if valid and active for the current environment.
|
401
419
|
def active?
|
402
420
|
valid? && active_for_env?
|
403
421
|
end
|
404
422
|
|
405
|
-
#
|
423
|
+
# @!visibility private
|
406
424
|
def write_to_environment # rubocop:disable Metrics/AbcSize
|
407
425
|
ENV["_APPSIGNAL_ACTIVE"] = active?.to_s
|
408
426
|
ENV["_APPSIGNAL_AGENT_PATH"] = File.expand_path("../../ext", __dir__).to_s
|
@@ -444,21 +462,21 @@ module Appsignal
|
|
444
462
|
ENV["_APP_REVISION"] = config_hash[:revision].to_s
|
445
463
|
end
|
446
464
|
|
447
|
-
#
|
465
|
+
# @!visibility private
|
448
466
|
def merge_dsl_options(options)
|
449
467
|
@dsl_config.merge!(options)
|
450
468
|
merge(options)
|
451
469
|
end
|
452
470
|
|
453
471
|
# Apply any overrides for invalid settings.
|
454
|
-
#
|
472
|
+
# @!visibility private
|
455
473
|
def apply_overrides
|
456
474
|
@override_config = determine_overrides
|
457
475
|
merge(override_config)
|
458
476
|
end
|
459
477
|
|
460
478
|
# @return [void]
|
461
|
-
#
|
479
|
+
# @!visibility private
|
462
480
|
def validate
|
463
481
|
# Strip path from endpoint so we're backwards compatible with
|
464
482
|
# earlier versions of the gem.
|
@@ -483,8 +501,8 @@ module Appsignal
|
|
483
501
|
# Deep freeze the config object so it cannot be modified during the runtime
|
484
502
|
# of the Ruby app.
|
485
503
|
#
|
486
|
-
# @api private
|
487
504
|
# @return [void]
|
505
|
+
# @!visibility private
|
488
506
|
# @since 4.0.0
|
489
507
|
def freeze
|
490
508
|
super
|
@@ -520,6 +538,41 @@ module Appsignal
|
|
520
538
|
hash[:active] = true unless env_push_api_key.strip.empty?
|
521
539
|
|
522
540
|
hash[:enable_at_exit_hook] = "always" if Appsignal::Extension.running_in_container?
|
541
|
+
|
542
|
+
# Set revision from REVISION file if present in project root
|
543
|
+
# This helps with Capistrano and Hatchbox.io deployments
|
544
|
+
revision_from_file = detect_revision_from_file
|
545
|
+
hash[:revision] = revision_from_file if revision_from_file
|
546
|
+
end
|
547
|
+
end
|
548
|
+
|
549
|
+
def detect_revision_from_file
|
550
|
+
return unless root_path
|
551
|
+
|
552
|
+
revision_file_path = File.join(root_path, "REVISION")
|
553
|
+
unless File.exist?(revision_file_path)
|
554
|
+
logger.debug "No REVISION file found at: #{revision_file_path}"
|
555
|
+
return
|
556
|
+
end
|
557
|
+
|
558
|
+
unless File.readable?(revision_file_path)
|
559
|
+
logger.debug "REVISION file is not readable at: #{revision_file_path}"
|
560
|
+
return
|
561
|
+
end
|
562
|
+
|
563
|
+
begin
|
564
|
+
revision_content = File.read(revision_file_path).strip
|
565
|
+
if revision_content.empty?
|
566
|
+
logger.debug "REVISION file found but is empty at: #{revision_file_path}"
|
567
|
+
nil
|
568
|
+
else
|
569
|
+
logger.debug "REVISION file found and read successfully at: #{revision_file_path}"
|
570
|
+
revision_content
|
571
|
+
end
|
572
|
+
rescue SystemCallError => e
|
573
|
+
logger.debug "Error occurred while reading REVISION file at " \
|
574
|
+
"#{revision_file_path}: #{e.class}: #{e.message}\n#{e.backtrace}"
|
575
|
+
nil
|
523
576
|
end
|
524
577
|
end
|
525
578
|
|
@@ -613,19 +666,43 @@ module Appsignal
|
|
613
666
|
end
|
614
667
|
end
|
615
668
|
|
616
|
-
#
|
669
|
+
# Configuration DSL for use in configuration blocks.
|
670
|
+
#
|
671
|
+
# This class provides a Domain Specific Language for configuring AppSignal
|
672
|
+
# within the `Appsignal.configure` block. It provides getter and setter
|
673
|
+
# methods for all configuration options.
|
674
|
+
#
|
675
|
+
# @example Using the configuration DSL
|
676
|
+
# Appsignal.configure do |config|
|
677
|
+
# config.name = "My App"
|
678
|
+
# config.active = true
|
679
|
+
# config.push_api_key = "your-api-key"
|
680
|
+
# config.ignore_actions = ["StatusController#health"]
|
681
|
+
# end
|
682
|
+
#
|
683
|
+
# @see AppSignal Ruby gem configuration
|
684
|
+
# https://docs.appsignal.com/ruby/configuration.html
|
617
685
|
class ConfigDSL
|
686
|
+
# @!visibility private
|
687
|
+
# @return [Hash] Hash containing the DSL option values
|
618
688
|
attr_reader :dsl_options
|
619
689
|
|
690
|
+
# @!visibility private
|
620
691
|
def initialize(config)
|
621
692
|
@config = config
|
622
693
|
@dsl_options = {}
|
623
694
|
end
|
624
695
|
|
696
|
+
# Returns the application's root path.
|
697
|
+
#
|
698
|
+
# @return [String] The root path of the application
|
625
699
|
def app_path
|
626
700
|
@config.root_path
|
627
701
|
end
|
628
702
|
|
703
|
+
# Returns the current environment name.
|
704
|
+
#
|
705
|
+
# @return [String] The environment name (e.g., "production", "development")
|
629
706
|
def env
|
630
707
|
@config.env
|
631
708
|
end
|
@@ -639,10 +716,58 @@ module Appsignal
|
|
639
716
|
env == given_env.to_s
|
640
717
|
end
|
641
718
|
|
719
|
+
# Activates AppSignal if the current environment matches any of the given environments.
|
720
|
+
#
|
721
|
+
# @param envs [Array<String, Symbol>] List of environment names to activate for
|
722
|
+
# @return [Boolean] true if AppSignal was activated, false otherwise
|
723
|
+
#
|
724
|
+
# @example Activate for production and staging
|
725
|
+
# config.activate_if_environment(:production, :staging)
|
642
726
|
def activate_if_environment(*envs)
|
643
727
|
self.active = envs.map(&:to_s).include?(env)
|
644
728
|
end
|
645
729
|
|
730
|
+
# @!group String Configuration Options
|
731
|
+
|
732
|
+
# @!attribute [rw] activejob_report_errors
|
733
|
+
# @return [String] Error reporting mode for ActiveJob ("all", "discard" or "none")
|
734
|
+
# @!attribute [rw] name
|
735
|
+
# @return [String] The application name
|
736
|
+
# @!attribute [rw] bind_address
|
737
|
+
# @return [String] The host to the agent binds to for its HTTP server
|
738
|
+
# @!attribute [rw] ca_file_path
|
739
|
+
# @return [String] Path to the CA certificate file
|
740
|
+
# @!attribute [rw] hostname
|
741
|
+
# @return [String] Override for the detected hostname
|
742
|
+
# @!attribute [rw] host_role
|
743
|
+
# @return [String] Role of the host for grouping in metrics
|
744
|
+
# @!attribute [rw] http_proxy
|
745
|
+
# @return [String] HTTP proxy URL
|
746
|
+
# @!attribute [rw] log
|
747
|
+
# @return [String] Log destination ("file" or "stdout")
|
748
|
+
# @!attribute [rw] log_level
|
749
|
+
# @return [String] AppSignal internal logger
|
750
|
+
# log level ("error", "warn", "info", "debug", "trace")
|
751
|
+
# @!attribute [rw] log_path
|
752
|
+
# @return [String] Path to the log directory
|
753
|
+
# @!attribute [rw] logging_endpoint
|
754
|
+
# @return [String] Endpoint for log transmission
|
755
|
+
# @!attribute [rw] endpoint
|
756
|
+
# @return [String] Push API endpoint URL
|
757
|
+
# @!attribute [rw] push_api_key
|
758
|
+
# @return [String] AppSignal Push API key
|
759
|
+
# @!attribute [rw] sidekiq_report_errors
|
760
|
+
# @return [String] Error reporting mode for Sidekiq ("all", "discard" or "none")
|
761
|
+
# @!attribute [rw] statsd_port
|
762
|
+
# @return [String] Port for StatsD metrics
|
763
|
+
# @!attribute [rw] nginx_port
|
764
|
+
# @return [String] Port for Nginx metrics collection
|
765
|
+
# @!attribute [rw] working_directory_path
|
766
|
+
# @return [String] Override for the agent working directory
|
767
|
+
# @!attribute [rw] revision
|
768
|
+
# @return [String] Application revision identifier
|
769
|
+
|
770
|
+
# @!endgroup
|
646
771
|
Appsignal::Config::STRING_OPTIONS.each_key do |option|
|
647
772
|
define_method(option) do
|
648
773
|
fetch_option(option)
|
@@ -653,6 +778,54 @@ module Appsignal
|
|
653
778
|
end
|
654
779
|
end
|
655
780
|
|
781
|
+
# @!group Boolean Configuration Options
|
782
|
+
|
783
|
+
# @!attribute [rw] active
|
784
|
+
# @return [Boolean] Activate AppSignal for the loaded environment
|
785
|
+
# @!attribute [rw] enable_allocation_tracking
|
786
|
+
# @return [Boolean] Configure whether allocation tracking is enabled
|
787
|
+
# @!attribute [rw] enable_at_exit_reporter
|
788
|
+
# @return [Boolean] Configure whether the at_exit reporter is enabled
|
789
|
+
# @!attribute [rw] enable_host_metrics
|
790
|
+
# @return [Boolean] Configure whether host metrics collection is enabled
|
791
|
+
# @!attribute [rw] enable_minutely_probes
|
792
|
+
# @return [Boolean] Configure whether minutely probes are enabled
|
793
|
+
# @!attribute [rw] enable_statsd
|
794
|
+
# @return [Boolean] Configure whether the StatsD metrics endpoint on the agent is enabled
|
795
|
+
# @!attribute [rw] enable_nginx_metrics
|
796
|
+
# @return [Boolean] Configure whether the agent's NGINX metrics endpoint is enabled
|
797
|
+
# @!attribute [rw] enable_gvl_global_timer
|
798
|
+
# @return [Boolean] Configure whether the GVL global timer instrumentationis enabled
|
799
|
+
# @!attribute [rw] enable_gvl_waiting_threads
|
800
|
+
# @return [Boolean] Configure whether GVL waiting threads instrumentation is enabled
|
801
|
+
# @!attribute [rw] enable_rails_error_reporter
|
802
|
+
# @return [Boolean] Configure whether Rails error reporter integration is enabled
|
803
|
+
# @!attribute [rw] enable_rake_performance_instrumentation
|
804
|
+
# @return [Boolean] Configure whether Rake performance instrumentation is enabled
|
805
|
+
# @!attribute [rw] files_world_accessible
|
806
|
+
# @return [Boolean] Configure whether files created by AppSignal should be world accessible
|
807
|
+
# @!attribute [rw] instrument_http_rb
|
808
|
+
# @return [Boolean] Configure whether to instrument requests made with the http.rb gem
|
809
|
+
# @!attribute [rw] instrument_net_http
|
810
|
+
# @return [Boolean] Configure whether to instrument requests made with Net::HTTP
|
811
|
+
# @!attribute [rw] instrument_ownership
|
812
|
+
# @return [Boolean] Configure whether to instrument the Ownership gem
|
813
|
+
# @!attribute [rw] instrument_redis
|
814
|
+
# @return [Boolean] Configure whether to instrument Redis queries
|
815
|
+
# @!attribute [rw] instrument_sequel
|
816
|
+
# @return [Boolean] Configure whether to instrument Sequel queries
|
817
|
+
# @!attribute [rw] ownership_set_namespace
|
818
|
+
# @return [Boolean] Configure whether the Ownership gem instrumentation should set namespace
|
819
|
+
# @!attribute [rw] running_in_container
|
820
|
+
# @return [Boolean] Configure whether the application is running in a container
|
821
|
+
# @!attribute [rw] send_environment_metadata
|
822
|
+
# @return [Boolean] Configure whether to send environment metadata
|
823
|
+
# @!attribute [rw] send_params
|
824
|
+
# @return [Boolean] Configure whether to send request parameters
|
825
|
+
# @!attribute [rw] send_session_data
|
826
|
+
# @return [Boolean] Configure whether to send request session data
|
827
|
+
|
828
|
+
# @!endgroup
|
656
829
|
Appsignal::Config::BOOLEAN_OPTIONS.each_key do |option|
|
657
830
|
define_method(option) do
|
658
831
|
fetch_option(option)
|
@@ -663,6 +836,28 @@ module Appsignal
|
|
663
836
|
end
|
664
837
|
end
|
665
838
|
|
839
|
+
# @!group Array Configuration Options
|
840
|
+
|
841
|
+
# @!attribute [rw] dns_servers
|
842
|
+
# @return [Array<String>] Custom DNS servers to use
|
843
|
+
# @!attribute [rw] filter_metadata
|
844
|
+
# @return [Array<String>] Metadata keys to filter from trace data
|
845
|
+
# @!attribute [rw] filter_parameters
|
846
|
+
# @return [Array<String>] Keys of parameter to filter
|
847
|
+
# @!attribute [rw] filter_session_data
|
848
|
+
# @return [Array<String>] Request session data keys to filter
|
849
|
+
# @!attribute [rw] ignore_actions
|
850
|
+
# @return [Array<String>] Ignore traces by action names
|
851
|
+
# @!attribute [rw] ignore_errors
|
852
|
+
# @return [Array<String>] List of errors to not report
|
853
|
+
# @!attribute [rw] ignore_logs
|
854
|
+
# @return [Array<String>] Ignore log messages by substrings
|
855
|
+
# @!attribute [rw] ignore_namespaces
|
856
|
+
# @return [Array<String>] Ignore traces by namespaces
|
857
|
+
# @!attribute [rw] request_headers
|
858
|
+
# @return [Array<String>] HTTP request headers to include in error reports
|
859
|
+
|
860
|
+
# @!endgroup
|
666
861
|
Appsignal::Config::ARRAY_OPTIONS.each_key do |option|
|
667
862
|
define_method(option) do
|
668
863
|
fetch_option(option)
|
@@ -673,6 +868,12 @@ module Appsignal
|
|
673
868
|
end
|
674
869
|
end
|
675
870
|
|
871
|
+
# @!group Float Configuration Options
|
872
|
+
|
873
|
+
# @!attribute [rw] cpu_count
|
874
|
+
# @return [Float] CPU count override for metrics collection
|
875
|
+
|
876
|
+
# @!endgroup
|
676
877
|
Appsignal::Config::FLOAT_OPTIONS.each_key do |option|
|
677
878
|
define_method(option) do
|
678
879
|
fetch_option(option)
|
@@ -15,7 +15,7 @@ module Appsignal
|
|
15
15
|
# @param icon [String] icon to use for the marker, like an emoji.
|
16
16
|
# @param message [String] name of the user that is creating the
|
17
17
|
# marker.
|
18
|
-
# @param created_at [Time
|
18
|
+
# @param created_at [Time, String] A Ruby time object or a valid ISO8601
|
19
19
|
# timestamp.
|
20
20
|
# @return [Boolean]
|
21
21
|
def self.report(
|
@@ -32,12 +32,12 @@ module Appsignal
|
|
32
32
|
).transmit
|
33
33
|
end
|
34
34
|
|
35
|
-
#
|
35
|
+
# @!visibility private
|
36
36
|
def initialize(marker_data)
|
37
37
|
@marker_data = marker_data
|
38
38
|
end
|
39
39
|
|
40
|
-
#
|
40
|
+
# @!visibility private
|
41
41
|
def transmit
|
42
42
|
unless Appsignal.config
|
43
43
|
Appsignal.internal_logger.warn(
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Appsignal
|
4
|
-
#
|
4
|
+
# @!visibility private
|
5
5
|
class Environment
|
6
6
|
ERROR_ON_YIELD = :APPSIGNAL_ERROR_ON_YIELD
|
7
7
|
|
@@ -119,6 +119,8 @@ module Appsignal
|
|
119
119
|
#
|
120
120
|
# It will ask Bundler to report name and version information from the gems
|
121
121
|
# that are present in the app bundle.
|
122
|
+
#
|
123
|
+
# @return [void]
|
122
124
|
def self.report_supported_gems
|
123
125
|
return unless defined?(Bundler) # Do nothing if Bundler is not present
|
124
126
|
|
@@ -139,6 +141,10 @@ module Appsignal
|
|
139
141
|
"#{e.class}: #{e}"
|
140
142
|
end
|
141
143
|
|
144
|
+
# Report a Ruby feature is enabled
|
145
|
+
#
|
146
|
+
# @param feature [String] Name of the feature to report as enabled.
|
147
|
+
# @return [void]
|
142
148
|
def self.report_enabled(feature)
|
143
149
|
Appsignal::Environment.report("ruby_#{feature}_enabled") { true }
|
144
150
|
rescue => e
|