appsignal 3.4.11 → 3.4.12

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: c1ac4bb4c6c83da9041228fe7094f6543073d00fac2b317ade49695d795b770b
4
- data.tar.gz: 1870d2a660dd057868f81d931a27bd047c781bb386ddc938cb3f5e48a41d989c
3
+ metadata.gz: 23564a15fbad1ecb68987675c925a81b0e423ffa66a3481563999f97db10ef79
4
+ data.tar.gz: a42321ba0bc9809e2b4b26a3c7e3707e5c06941a30ed6187cba491cbc76b9cfd
5
5
  SHA512:
6
- metadata.gz: 5400da137bc9e4644301afc2c9d0de690edf0f6759cfceaf5b72a072b5f78e2f95d15df2d6ccb897f379b92d9bd7be0770a8d38538687ee8d4f3de9cfd7b6012
7
- data.tar.gz: 13e146b750712f1e3e1cb08bf6765ecf88762f278a3e0d21067aaae390d2deadaf0dbc76a08c0812a1996d83fa18d99977e1fc96f50d0335aa6890a1a3bcf52b
6
+ metadata.gz: ff4db633c340cf16fc0cfb3b154f4b754ef3416d3e56077203b7a298851457624dba934576c634b56bad599199fe427d1200dfa019f3bcfab67a9aa7349a0591
7
+ data.tar.gz: 811176ae1f6735a901e1b0b822b4956aa5a0ca86efd2fbc8cc969afde01510022d3d2adf4fe11de50609f324df4dab0c699dbf84ca120ab27556d18735e7748b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.4.12
4
+
5
+ ### Added
6
+
7
+ - [441de353](https://github.com/appsignal/appsignal-ruby/commit/441de3537e7a8f36dd2460149c171aaa80929e53) patch - Add an option to not start AppSignal on config file errors. When the `config/appsignal.yml` file raises an error (due to ERB syntax issues or ERB errors), it will currently ignore the config file and try to make a configuration work from the other config sources (default, auto detection and system environment variables). This can cause unexpected behavior, because the config from the config file is not part of the loaded config.
8
+
9
+ In future versions of the Ruby gem, AppSignal will not start when the config file contains an error. To opt-in to this new behavior, set the `APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR` system environment variable to either `1` or `true`.
10
+
11
+ ### Changed
12
+
13
+ - [a42da92b](https://github.com/appsignal/appsignal-ruby/commit/a42da92b1ff16c48eb40dc081d3b4fbd6480c7c0) patch - Log an error when sample data is of an invalid type. Accepted types are Array and Hash. If any other types are given, it will log an error to the `appsignal.log` file.
14
+ - [8e636323](https://github.com/appsignal/appsignal-ruby/commit/8e6363232dc7fabe5f1aeae5758802e4c8d6cbfa) patch - Bump agent to 6133900.
15
+
16
+ - Fix `disk_inodes_usage` metric name format to not be interpreted as a JSON object.
17
+
3
18
  ## 3.4.11
4
19
 
5
20
  ### Added
data/ext/agent.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Modifications to this file will be overwritten with the next agent release.
7
7
 
8
8
  APPSIGNAL_AGENT_CONFIG = {
9
- "version" => "d789895",
9
+ "version" => "6133900",
10
10
  "mirrors" => [
11
11
  "https://appsignal-agent-releases.global.ssl.fastly.net",
12
12
  "https://d135dj0rjqvssy.cloudfront.net"
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
14
14
  "triples" => {
15
15
  "x86_64-darwin" => {
16
16
  "static" => {
17
- "checksum" => "8ea76b7d011c728b7988d017a39fc3a432d9c86392e6e46767ecc931e583777a",
17
+ "checksum" => "19cfea536fc6c4a8fe335a26d14ce955b422c23217902642f95d7df670152238",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "beacdcd579bcc06a69da279dbca2f363395ea4b1846fa4b6e49de612beb07a8a",
21
+ "checksum" => "f5c4b66b45faac47473befdbe286a037d8fca9386339b00f59be9e9505d15b13",
22
22
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
23
23
  }
24
24
  },
25
25
  "universal-darwin" => {
26
26
  "static" => {
27
- "checksum" => "8ea76b7d011c728b7988d017a39fc3a432d9c86392e6e46767ecc931e583777a",
27
+ "checksum" => "19cfea536fc6c4a8fe335a26d14ce955b422c23217902642f95d7df670152238",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "beacdcd579bcc06a69da279dbca2f363395ea4b1846fa4b6e49de612beb07a8a",
31
+ "checksum" => "f5c4b66b45faac47473befdbe286a037d8fca9386339b00f59be9e9505d15b13",
32
32
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
33
33
  }
34
34
  },
35
35
  "aarch64-darwin" => {
36
36
  "static" => {
37
- "checksum" => "535fed60ac1484e40bbfe77cd4fe9131c67f25e6362a2fe31d987c36ec82ba08",
37
+ "checksum" => "4fa0dbccba79f70edc6844a86bfd047ccdd612d752b65aff46fe0e21d8a610ea",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "6c984f53a07788ebb469ede014ac8732d9db1ef43736825690492e7c12e3fb83",
41
+ "checksum" => "f86e88647be6c64f0f1f56b1ac15e0e4453c7e4a6c997fd5e510cf459c572a57",
42
42
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
43
43
  }
44
44
  },
45
45
  "arm64-darwin" => {
46
46
  "static" => {
47
- "checksum" => "535fed60ac1484e40bbfe77cd4fe9131c67f25e6362a2fe31d987c36ec82ba08",
47
+ "checksum" => "4fa0dbccba79f70edc6844a86bfd047ccdd612d752b65aff46fe0e21d8a610ea",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "6c984f53a07788ebb469ede014ac8732d9db1ef43736825690492e7c12e3fb83",
51
+ "checksum" => "f86e88647be6c64f0f1f56b1ac15e0e4453c7e4a6c997fd5e510cf459c572a57",
52
52
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
53
53
  }
54
54
  },
55
55
  "arm-darwin" => {
56
56
  "static" => {
57
- "checksum" => "535fed60ac1484e40bbfe77cd4fe9131c67f25e6362a2fe31d987c36ec82ba08",
57
+ "checksum" => "4fa0dbccba79f70edc6844a86bfd047ccdd612d752b65aff46fe0e21d8a610ea",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "6c984f53a07788ebb469ede014ac8732d9db1ef43736825690492e7c12e3fb83",
61
+ "checksum" => "f86e88647be6c64f0f1f56b1ac15e0e4453c7e4a6c997fd5e510cf459c572a57",
62
62
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
63
63
  }
64
64
  },
65
65
  "aarch64-linux" => {
66
66
  "static" => {
67
- "checksum" => "35f96e0adf408fd8ac3e89c6cb3c5506eb4250643199aad3ba298ab131d773c8",
67
+ "checksum" => "cdd75637940fcfd369b569e873048c7d37a3844d9d31d783e4459b375b78ee0e",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "6f4e5431c50c947f9fdeb92b7536780277bebb75327cfa5ee9c27659a9d20b5e",
71
+ "checksum" => "99b52c29d497d63f02a4ff7162152641b51e7ecd292d07f0330e7d4f3abc8075",
72
72
  "filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
73
73
  }
74
74
  },
75
75
  "i686-linux" => {
76
76
  "static" => {
77
- "checksum" => "f4a1c9a67a0a4cde7e13ef555a6782e5d4f15bfbce9277c2aaf8e248a0fb858e",
77
+ "checksum" => "a9374d1fd4baae84f1c4a74957cbb8c919b29ae2ab05a571ff75b9ca483717ab",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "26a3fa059874d76897e6a4c709048789f531d7e84e6b8ae4e7fbcdfb26cdef40",
81
+ "checksum" => "d643c72add6fe1054faff034101cf5a2676a169c7bff479f3d79e71875598b8a",
82
82
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
83
83
  }
84
84
  },
85
85
  "x86-linux" => {
86
86
  "static" => {
87
- "checksum" => "f4a1c9a67a0a4cde7e13ef555a6782e5d4f15bfbce9277c2aaf8e248a0fb858e",
87
+ "checksum" => "a9374d1fd4baae84f1c4a74957cbb8c919b29ae2ab05a571ff75b9ca483717ab",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "26a3fa059874d76897e6a4c709048789f531d7e84e6b8ae4e7fbcdfb26cdef40",
91
+ "checksum" => "d643c72add6fe1054faff034101cf5a2676a169c7bff479f3d79e71875598b8a",
92
92
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
93
93
  }
94
94
  },
95
95
  "x86_64-linux" => {
96
96
  "static" => {
97
- "checksum" => "016c962727e31a07eee7a221944ff9c4bbb054eada7e87bbe4602233364f380c",
97
+ "checksum" => "bd625ed84100d0632b298ac602b152463628c41afe56a8621745cdae626f8413",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "d286a8bcc4a876057a14a90cc6ceecdc75230e1c4d721ea3f3138c58c748e602",
101
+ "checksum" => "0daa644acfee46848282ad733b175e4994e7faf64c8bc046d2efff2b8fc1afdd",
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" => "2ce9e34b283c76c6b25028d3a770a942f4975cd071c586438a8765948237ca42",
107
+ "checksum" => "7988c4a2a6ba5d59be2186ce9bf51ab50b6537a60888b08c8e9066172516e59d",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "0eebe8cd448bce5386cdce1039e7f74c60208408108af9537a80e8e8737f7aec",
111
+ "checksum" => "93e47c9400ddae42a8cd2b80c09c9134ee96a76bf622c3ad5d53b776fec1a3f0",
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" => "017da79e62a2875c0384898c9160cd83acd712faba05154fd8a0627fec1b5ba4",
117
+ "checksum" => "8e5fe2a8bc4cb7de4ba7d61fec48f15aa0cd580050f67752f07625853636eb16",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "507d4fa0f3d6168f905404b4b36fe494c5479606d77f50d2d2d3d27b6c645ea1",
121
+ "checksum" => "01f993b3320f0377ef9f652bb215ce268da208f46a6f59ad0c0e71f57257b4ef",
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" => "13d27afcb68aff5e164e05fc4fd8874e73f14c0154301f2e6e6e75f67fa9182c",
127
+ "checksum" => "09e21821eb98ad6afdb5d3708b67ea25799aedbee2ccb0d566b99d9c5703cb1e",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "dafa25a73cd79e269466d5129dd7b61ac88e09d87c3f253fc9705e1d9469fa2b",
131
+ "checksum" => "e77592de9dd7ff41efb6c1d2d88e06fa7b663e9ff009392bb971b1333e0f28d7",
132
132
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
133
133
  }
134
134
  },
135
135
  "amd64-freebsd" => {
136
136
  "static" => {
137
- "checksum" => "13d27afcb68aff5e164e05fc4fd8874e73f14c0154301f2e6e6e75f67fa9182c",
137
+ "checksum" => "09e21821eb98ad6afdb5d3708b67ea25799aedbee2ccb0d566b99d9c5703cb1e",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "dafa25a73cd79e269466d5129dd7b61ac88e09d87c3f253fc9705e1d9469fa2b",
141
+ "checksum" => "e77592de9dd7ff41efb6c1d2d88e06fa7b663e9ff009392bb971b1333e0f28d7",
142
142
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
143
143
  }
144
144
  }
@@ -232,6 +232,7 @@ module Appsignal
232
232
  # How to integrate AppSignal manually
233
233
  def initialize(root_path, env, initial_config = {}, logger = Appsignal.logger,
234
234
  config_file = nil)
235
+ @config_file_error = false
235
236
  @root_path = root_path
236
237
  @config_file = config_file
237
238
  @logger = logger
@@ -417,8 +418,20 @@ module Appsignal
417
418
  nil
418
419
  end
419
420
  rescue => e
420
- message = "An error occured while loading the AppSignal config file." \
421
- " Skipping file config.\n" \
421
+ # TODO: Remove in the next major version
422
+ @config_file_error = true
423
+ extra_message =
424
+ if inactive_on_config_file_error?
425
+ "Not starting AppSignal because " \
426
+ "APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR is set."
427
+ else
428
+ "Skipping file config. In future versions AppSignal will not start " \
429
+ "on a config file error. To opt-in to this new behavior set " \
430
+ "'APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR=1' in your system " \
431
+ "environment."
432
+ end
433
+ message = "An error occured while loading the AppSignal config file. " \
434
+ "#{extra_message}\n" \
422
435
  "File: #{config_file.inspect}\n" \
423
436
  "#{e.class.name}: #{e}"
424
437
  Kernel.warn "appsignal: #{message}"
@@ -485,6 +498,12 @@ module Appsignal
485
498
  # stick around as a structure for future deprecations.
486
499
  def determine_overrides
487
500
  config = {}
501
+ # If an error was detected during config file reading/parsing and the new
502
+ # behavior is enabled to not start AppSignal on incomplete config, do not
503
+ # start AppSignal.
504
+ # TODO: Make default behavior in next major version. Remove
505
+ # `inactive_on_config_file_error?` call.
506
+ config[:active] = false if @config_file_error && inactive_on_config_file_error?
488
507
  skip_session_data = config_hash[:skip_session_data]
489
508
  send_session_data = config_hash[:send_session_data]
490
509
  if skip_session_data.nil? # Deprecated option is not set
@@ -508,5 +527,11 @@ module Appsignal
508
527
  config_hash[key] = value
509
528
  end
510
529
  end
530
+
531
+ # Does it use the new behavior?
532
+ def inactive_on_config_file_error?
533
+ value = ENV.fetch("APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR", false)
534
+ ["1", "true"].include?(value)
535
+ end
511
536
  end
512
537
  end
@@ -320,7 +320,14 @@ module Appsignal
320
320
  end
321
321
 
322
322
  def set_sample_data(key, data)
323
- return unless key && data && (data.is_a?(Array) || data.is_a?(Hash))
323
+ return unless key && data
324
+
325
+ if !data.is_a?(Array) && !data.is_a?(Hash)
326
+ Appsignal.logger.error(
327
+ "Invalid sample data for '#{key}'. Value is not an Array or Hash: '#{data.inspect}'"
328
+ )
329
+ return
330
+ end
324
331
 
325
332
  @ext.set_sample_data(
326
333
  key.to_s,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.4.11"
4
+ VERSION = "3.4.12"
5
5
  end
@@ -294,19 +294,48 @@ describe Appsignal::Config do
294
294
  end
295
295
  let(:config) { Appsignal::Config.new(config_path, "foo") }
296
296
 
297
- it "logs & prints an error, skipping the file source" do
298
- stdout = std_stream
299
- stderr = std_stream
300
- log = capture_logs { capture_std_streams(stdout, stderr) { config } }
301
- message = "An error occured while loading the AppSignal config file. " \
302
- "Skipping file config.\n" \
303
- "File: #{File.join(config_path, "config", "appsignal.yml").inspect}\n" \
304
- "KeyError: key not found"
305
- expect(log).to contains_log :error, message
306
- expect(log).to include("/appsignal/config.rb:") # Backtrace
307
- expect(stdout.read).to_not include("appsignal:")
308
- expect(stderr.read).to include "appsignal: #{message}"
309
- expect(config.file_config).to eql({})
297
+ context "when APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR is not set" do
298
+ it "logs & prints an error, skipping the file source" do
299
+ stdout = std_stream
300
+ stderr = std_stream
301
+ log = capture_logs { capture_std_streams(stdout, stderr) { config } }
302
+ message = "An error occured while loading the AppSignal config file. " \
303
+ "Skipping file config. " \
304
+ "In future versions AppSignal will not start on a config file " \
305
+ "error. To opt-in to this new behavior set " \
306
+ "'APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR=1' in your system " \
307
+ "environment.\n" \
308
+ "File: #{File.join(config_path, "config", "appsignal.yml").inspect}\n" \
309
+ "KeyError: key not found"
310
+ expect(log).to contains_log :error, message
311
+ expect(log).to include("/appsignal/config.rb:") # Backtrace
312
+ expect(stdout.read).to_not include("appsignal:")
313
+ expect(stderr.read).to include "appsignal: #{message}"
314
+ expect(config.file_config).to eql({})
315
+ end
316
+ end
317
+
318
+ context "when APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR=1 is set" do
319
+ it "does not start AppSignal, logs & prints an error" do
320
+ stdout = std_stream
321
+ stderr = std_stream
322
+ ENV["APPSIGNAL_ACTIVE"] = "true"
323
+ ENV["APPSIGNAL_APP_NAME"] = "My app"
324
+ ENV["APPSIGNAL_APP_ENV"] = "dev"
325
+ ENV["APPSIGNAL_PUSH_API_KEY"] = "something valid"
326
+ ENV["APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR"] = "1"
327
+ log = capture_logs { capture_std_streams(stdout, stderr) { config } }
328
+ message = "An error occured while loading the AppSignal config file. " \
329
+ "Not starting AppSignal because APPSIGNAL_INACTIVE_ON_CONFIG_FILE_ERROR is set.\n" \
330
+ "File: #{File.join(config_path, "config", "appsignal.yml").inspect}\n" \
331
+ "KeyError: key not found"
332
+ expect(log).to contains_log :error, message
333
+ expect(log).to include("/appsignal/config.rb:") # Backtrace
334
+ expect(stdout.read).to_not include("appsignal:")
335
+ expect(stderr.read).to include "appsignal: #{message}"
336
+ expect(config.file_config).to eql({})
337
+ expect(config.active?).to be(false)
338
+ end
310
339
  end
311
340
  end
312
341
 
@@ -688,6 +688,8 @@ describe Appsignal::Transaction do
688
688
  transaction.set_sample_data("params", "string")
689
689
 
690
690
  expect(transaction.to_h["sample_data"]).to eq({})
691
+ expect(log_contents(log)).to contains_log :error,
692
+ %(Invalid sample data for 'params'. Value is not an Array or Hash: '"string"')
691
693
  end
692
694
  end
693
695
 
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: 3.4.11
4
+ version: 3.4.12
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: 2023-08-25 00:00:00.000000000 Z
13
+ date: 2023-08-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack