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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd929ef03ad3a9ceec274cc57e036614e3b2dfb76be026b8c0b878a35a5ce654
4
- data.tar.gz: ef77980f54715f5b4a05ee218df8a0e51b3f867643ca793ef790dda3f324e05c
3
+ metadata.gz: 8a441bb8864121c2d1270a87f385ad98d6942e02705d640b02e39ecd4f4f429d
4
+ data.tar.gz: bffc65fe34303b5396b2d08df716022897dcdb98c36a627d7a63fe389210568f
5
5
  SHA512:
6
- metadata.gz: 0a6ad722785e28515a5d716df4dbf4aad9bc134718ebc2354cd4bcd3fda75c923cd1266f249e2d019cdc459ca43fc0ca2559cc4733859a05546a809f1e5f5410
7
- data.tar.gz: 0cf285924ec8dd63cbcdb89a0354f76dfdc86d6737dc32c80f2538ae136b8653763b67a3507238db866751869d7c17f817eb2e766b4b7860584f4618be550d58
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 ship` family of tasks in the
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.25",
9
+ "version" => "0.35.28",
10
10
  "mirrors" => [
11
- "https://appsignal-agent-releases.global.ssl.fastly.net",
12
- "https://d135dj0rjqvssy.cloudfront.net"
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" => "f7d6332565a44130bcefb4574d7b81ae90234347ee2bb745f6d4158b7b75c7a7",
17
+ "checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "12f654a00d044983253b3b21b4158d964e36cb1f6f24130cf73e0fe4ecc27ca6",
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" => "f7d6332565a44130bcefb4574d7b81ae90234347ee2bb745f6d4158b7b75c7a7",
27
+ "checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "12f654a00d044983253b3b21b4158d964e36cb1f6f24130cf73e0fe4ecc27ca6",
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" => "a5ad691a67a7417dfbacf2ecb0ad31830d0f2ebb9bad1ed640426477bd0c2023",
37
+ "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "eefe5860a0b353c9539e70002096d0080a01e9b95a0ce5c492c1d1f86916e5bc",
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" => "a5ad691a67a7417dfbacf2ecb0ad31830d0f2ebb9bad1ed640426477bd0c2023",
47
+ "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "eefe5860a0b353c9539e70002096d0080a01e9b95a0ce5c492c1d1f86916e5bc",
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" => "a5ad691a67a7417dfbacf2ecb0ad31830d0f2ebb9bad1ed640426477bd0c2023",
57
+ "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "eefe5860a0b353c9539e70002096d0080a01e9b95a0ce5c492c1d1f86916e5bc",
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" => "fee51c4d0740298a295eaca0cc7bebf9ae05ad03993af7f18501944170492c7b",
67
+ "checksum" => "02d62cfab5ab81faec40db6d80d47e53b2fca640026715697ab43f19539ace34",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "49d52a9f18f6543d4436a64cea184f37884257a03e95ceb59245e03c672ce377",
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" => "0a84aeb8c57d8a401bd971a6d0adae104ef11a6ab101e4b7f2f0b5b744f3be16",
77
+ "checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "c16dc7c7ae2b2cf9d54b263eb43717396fd8ed21dc6b0e28f4a15c6adb9c2f90",
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" => "0a84aeb8c57d8a401bd971a6d0adae104ef11a6ab101e4b7f2f0b5b744f3be16",
87
+ "checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "c16dc7c7ae2b2cf9d54b263eb43717396fd8ed21dc6b0e28f4a15c6adb9c2f90",
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" => "2c913ea2196ab69aaabf8bafb38a3f156f879b363d9c3245fcd7eb6bc4a6d13e",
97
+ "checksum" => "f3efd7973a0a4b5a0dca7ef23a896a866f011e70d90e2d22cd77c343ffbdf0c1",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "d8963880dcc2dc75f3a7a5909f7bc1e259a1f687117e7cc69f5234fd5690e659",
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" => "d15a51024585597985f1e0c7b5c5a2ea83e59aacf9bd3acc4f4bbbb00f8e7ee8",
107
+ "checksum" => "9e0cc593389e08527d2e62cc4389711a137511021fd59abd311da8ef5343aee6",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "f190d6a79242151434ca2758b32bce9be05b43a0f3dbf7467ffac518751ba54c",
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" => "7b1db25a569e9050f4689fc9874719d40f8ef86e960e425cca5bd4a2d40f922d",
117
+ "checksum" => "5112c3d0b22f27e6ed108d671ec2903f4cbe084c8d104a05bc946d88ccfed633",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "5538c5a597de923fe5e60c7bfe626269b3f4f76d769a16dfcd18a060c4c27ee2",
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" => "31d2e6bdb294c29934e57f6b5c0ce87538bdb3e2639ec1dbda10b013b3655c3e",
127
+ "checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "e68aca29d9538be90a113c015e98b2e02f9a11c41db655c17f1bdf785c88cc20",
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" => "31d2e6bdb294c29934e57f6b5c0ce87538bdb3e2639ec1dbda10b013b3655c3e",
137
+ "checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "e68aca29d9538be90a113c015e98b2e02f9a11c41db655c17f1bdf785c88cc20",
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
@@ -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+)(?<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.1"
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.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-09-28 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
@@ -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.5.14
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