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.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/CLAUDE.md +177 -0
  4. data/README.md +17 -0
  5. data/appsignal.gemspec +1 -0
  6. data/build_matrix.yml +29 -0
  7. data/lib/appsignal/auth_check.rb +3 -3
  8. data/lib/appsignal/check_in/cron.rb +1 -1
  9. data/lib/appsignal/check_in/event.rb +1 -1
  10. data/lib/appsignal/check_in/scheduler.rb +3 -1
  11. data/lib/appsignal/check_in.rb +9 -6
  12. data/lib/appsignal/cli/diagnose.rb +1 -1
  13. data/lib/appsignal/cli.rb +1 -1
  14. data/lib/appsignal/config.rb +231 -30
  15. data/lib/appsignal/custom_marker.rb +3 -3
  16. data/lib/appsignal/environment.rb +7 -1
  17. data/lib/appsignal/event_formatter/action_view/render_formatter.rb +1 -1
  18. data/lib/appsignal/event_formatter/active_record/instantiation_formatter.rb +1 -1
  19. data/lib/appsignal/event_formatter/active_record/sql_formatter.rb +1 -1
  20. data/lib/appsignal/event_formatter/elastic_search/search_formatter.rb +1 -1
  21. data/lib/appsignal/event_formatter/faraday/request_formatter.rb +1 -1
  22. data/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb +1 -1
  23. data/lib/appsignal/event_formatter/rom/sql_formatter.rb +1 -1
  24. data/lib/appsignal/event_formatter/sequel/sql_formatter.rb +1 -1
  25. data/lib/appsignal/event_formatter/view_component/render_formatter.rb +1 -1
  26. data/lib/appsignal/event_formatter.rb +41 -3
  27. data/lib/appsignal/extension.rb +1 -1
  28. data/lib/appsignal/garbage_collection.rb +1 -1
  29. data/lib/appsignal/helpers/instrumentation.rb +82 -35
  30. data/lib/appsignal/helpers/metrics.rb +12 -9
  31. data/lib/appsignal/hooks/action_cable.rb +1 -1
  32. data/lib/appsignal/hooks/action_mailer.rb +1 -0
  33. data/lib/appsignal/hooks/active_job.rb +1 -1
  34. data/lib/appsignal/hooks/active_support_notifications.rb +1 -1
  35. data/lib/appsignal/hooks/at_exit.rb +1 -1
  36. data/lib/appsignal/hooks/celluloid.rb +1 -1
  37. data/lib/appsignal/hooks/data_mapper.rb +1 -1
  38. data/lib/appsignal/hooks/delayed_job.rb +1 -1
  39. data/lib/appsignal/hooks/dry_monitor.rb +1 -1
  40. data/lib/appsignal/hooks/excon.rb +1 -1
  41. data/lib/appsignal/hooks/gvl.rb +1 -1
  42. data/lib/appsignal/hooks/http.rb +1 -1
  43. data/lib/appsignal/hooks/mongo_ruby_driver.rb +1 -1
  44. data/lib/appsignal/hooks/mri.rb +1 -1
  45. data/lib/appsignal/hooks/net_http.rb +1 -1
  46. data/lib/appsignal/hooks/ownership.rb +1 -1
  47. data/lib/appsignal/hooks/passenger.rb +1 -1
  48. data/lib/appsignal/hooks/puma.rb +1 -1
  49. data/lib/appsignal/hooks/que.rb +1 -1
  50. data/lib/appsignal/hooks/rake.rb +1 -1
  51. data/lib/appsignal/hooks/redis.rb +1 -1
  52. data/lib/appsignal/hooks/redis_client.rb +1 -1
  53. data/lib/appsignal/hooks/resque.rb +1 -1
  54. data/lib/appsignal/hooks/sequel.rb +2 -1
  55. data/lib/appsignal/hooks/shoryuken.rb +1 -1
  56. data/lib/appsignal/hooks/sidekiq.rb +1 -0
  57. data/lib/appsignal/hooks/unicorn.rb +1 -1
  58. data/lib/appsignal/hooks/webmachine.rb +1 -1
  59. data/lib/appsignal/hooks.rb +5 -3
  60. data/lib/appsignal/integrations/action_cable.rb +1 -1
  61. data/lib/appsignal/integrations/active_support_notifications.rb +1 -1
  62. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +1 -1
  63. data/lib/appsignal/integrations/data_mapper.rb +1 -1
  64. data/lib/appsignal/integrations/delayed_job_plugin.rb +1 -1
  65. data/lib/appsignal/integrations/dry_monitor.rb +1 -1
  66. data/lib/appsignal/integrations/excon.rb +1 -1
  67. data/lib/appsignal/integrations/http.rb +1 -1
  68. data/lib/appsignal/integrations/mongo_ruby_driver.rb +1 -1
  69. data/lib/appsignal/integrations/net_http.rb +1 -1
  70. data/lib/appsignal/integrations/object.rb +18 -2
  71. data/lib/appsignal/integrations/ownership.rb +1 -1
  72. data/lib/appsignal/integrations/puma.rb +1 -1
  73. data/lib/appsignal/integrations/que.rb +1 -1
  74. data/lib/appsignal/integrations/railtie.rb +2 -2
  75. data/lib/appsignal/integrations/rake.rb +2 -2
  76. data/lib/appsignal/integrations/redis.rb +1 -1
  77. data/lib/appsignal/integrations/redis_client.rb +1 -1
  78. data/lib/appsignal/integrations/resque.rb +2 -2
  79. data/lib/appsignal/integrations/shoryuken.rb +1 -1
  80. data/lib/appsignal/integrations/sidekiq.rb +3 -3
  81. data/lib/appsignal/integrations/unicorn.rb +1 -1
  82. data/lib/appsignal/integrations/webmachine.rb +1 -1
  83. data/lib/appsignal/internal_errors.rb +2 -2
  84. data/lib/appsignal/loaders.rb +1 -1
  85. data/lib/appsignal/logger.rb +36 -19
  86. data/lib/appsignal/marker.rb +1 -1
  87. data/lib/appsignal/probes/gvl.rb +4 -3
  88. data/lib/appsignal/probes/helpers.rb +1 -1
  89. data/lib/appsignal/probes/mri.rb +3 -3
  90. data/lib/appsignal/probes/sidekiq.rb +4 -3
  91. data/lib/appsignal/probes.rb +20 -15
  92. data/lib/appsignal/rack.rb +1 -1
  93. data/lib/appsignal/sample_data.rb +31 -12
  94. data/lib/appsignal/span.rb +1 -1
  95. data/lib/appsignal/system.rb +9 -8
  96. data/lib/appsignal/transaction.rb +72 -52
  97. data/lib/appsignal/transmitter.rb +1 -1
  98. data/lib/appsignal/utils.rb +1 -1
  99. data/lib/appsignal/version.rb +2 -1
  100. data/lib/appsignal.rb +22 -14
  101. data/lib/puma/plugin/appsignal.rb +1 -1
  102. data/sig/appsignal.rbi +2599 -0
  103. data/sig/appsignal.rbs +2420 -0
  104. metadata +20 -6
@@ -8,12 +8,12 @@ require "tmpdir"
8
8
 
9
9
  module Appsignal
10
10
  class Config
11
- # @api private
11
+ # @!visibility private
12
12
  def self.loader_defaults
13
13
  @loader_defaults ||= []
14
14
  end
15
15
 
16
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
214
+ # @!visibility private
215
215
  FLOAT_OPTIONS = {
216
216
  :cpu_count => "APPSIGNAL_CPU_COUNT"
217
217
  }.freeze
218
218
 
219
- # @api private
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
- # @api private
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 for AppSignal.
233
+ # Initialize a new AppSignal configuration object.
234
234
  #
235
- # @param root_path [String] Root path of the app.
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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
- # @api private
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/String] A Ruby time object or a valid ISO8601
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
- # @api private
35
+ # @!visibility private
36
36
  def initialize(marker_data)
37
37
  @marker_data = marker_data
38
38
  end
39
39
 
40
- # @api private
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
- # @api private
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module ActionView
7
7
  class RenderFormatter
8
8
  BLANK = ""
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module ActiveRecord
7
7
  class InstantiationFormatter
8
8
  def format(payload)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module ActiveRecord
7
7
  class SqlFormatter
8
8
  def format(payload)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module ElasticSearch
7
7
  class SearchFormatter
8
8
  def format(payload)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module Faraday
7
7
  class RequestFormatter
8
8
  def format(payload)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module MongoRubyDriver
7
7
  class QueryFormatter
8
8
  ALLOWED = {
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module Rom
7
7
  class SqlFormatter
8
8
  def format(payload)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module Sequel
7
7
  # Compatibility with the sequel-rails gem.
8
8
  # The sequel-rails gem adds its own ActiveSupport::Notifications events
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appsignal
4
4
  class EventFormatter
5
- # @api private
5
+ # @!visibility private
6
6
  module ViewComponent
7
7
  class RenderFormatter
8
8
  BLANK = ""