appsignal 3.6.5 → 3.7.1
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/.semaphore/semaphore.yml +417 -0
 - data/CHANGELOG.md +57 -0
 - data/build_matrix.yml +8 -0
 - data/ext/agent.rb +27 -27
 - data/ext/base.rb +3 -0
 - data/lib/appsignal/config.rb +20 -7
 - data/lib/appsignal/event_formatter.rb +0 -2
 - data/lib/appsignal/heartbeat.rb +71 -0
 - data/lib/appsignal/helpers/instrumentation.rb +5 -5
 - data/lib/appsignal/helpers/metrics.rb +2 -2
 - data/lib/appsignal/hooks/gvl.rb +1 -1
 - data/lib/appsignal/hooks/mri.rb +1 -1
 - data/lib/appsignal/hooks/sidekiq.rb +1 -1
 - data/lib/appsignal/hooks.rb +1 -1
 - data/lib/appsignal/integrations/railtie.rb +1 -1
 - data/lib/appsignal/probes.rb +268 -0
 - data/lib/appsignal/utils/stdout_and_logger_message.rb +17 -0
 - data/lib/appsignal/utils.rb +1 -1
 - data/lib/appsignal/version.rb +1 -1
 - data/lib/appsignal.rb +24 -4
 - data/spec/lib/appsignal/config_spec.rb +37 -10
 - data/spec/lib/appsignal/heartbeat_spec.rb +89 -0
 - data/spec/lib/appsignal/hooks/gvl_spec.rb +1 -1
 - data/spec/lib/appsignal/hooks/mri_spec.rb +1 -1
 - data/spec/lib/appsignal/hooks/puma_spec.rb +1 -1
 - data/spec/lib/appsignal/{minutely_spec.rb → probes_spec.rb} +206 -57
 - data/spec/lib/appsignal_spec.rb +31 -5
 - data/spec/lib/puma/appsignal_spec.rb +8 -2
 - data/spec/spec_helper.rb +2 -2
 - metadata +7 -6
 - data/lib/appsignal/minutely.rb +0 -206
 - data/lib/appsignal/utils/deprecation_message.rb +0 -16
 
    
        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" => "0. 
     | 
| 
      
 9 
     | 
    
         
            +
              "version" => "0.35.5",
         
     | 
| 
       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" => " 
     | 
| 
      
 17 
     | 
    
         
            +
                    "checksum" => "3985b53b2a2814d44737182890e6fbe31b4b88361025140477a598e0e41fd948",
         
     | 
| 
       18 
18 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
         
     | 
| 
       19 
19 
     | 
    
         
             
                  },
         
     | 
| 
       20 
20 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       21 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 21 
     | 
    
         
            +
                    "checksum" => "d135e2daf5c041a4ce7a7ab720cfd977fbae8375a007995e33a96558d3635792",
         
     | 
| 
       22 
22 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
         
     | 
| 
       23 
23 
     | 
    
         
             
                  }
         
     | 
| 
       24 
24 
     | 
    
         
             
                },
         
     | 
| 
       25 
25 
     | 
    
         
             
                "universal-darwin" => {
         
     | 
| 
       26 
26 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       27 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 27 
     | 
    
         
            +
                    "checksum" => "3985b53b2a2814d44737182890e6fbe31b4b88361025140477a598e0e41fd948",
         
     | 
| 
       28 
28 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
         
     | 
| 
       29 
29 
     | 
    
         
             
                  },
         
     | 
| 
       30 
30 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       31 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 31 
     | 
    
         
            +
                    "checksum" => "d135e2daf5c041a4ce7a7ab720cfd977fbae8375a007995e33a96558d3635792",
         
     | 
| 
       32 
32 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
         
     | 
| 
       33 
33 
     | 
    
         
             
                  }
         
     | 
| 
       34 
34 
     | 
    
         
             
                },
         
     | 
| 
       35 
35 
     | 
    
         
             
                "aarch64-darwin" => {
         
     | 
| 
       36 
36 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       37 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 37 
     | 
    
         
            +
                    "checksum" => "79d22436bfe32dab4661f2a4149c6ab34c71e810c5d808ee3e60cd9f8a1395e4",
         
     | 
| 
       38 
38 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
         
     | 
| 
       39 
39 
     | 
    
         
             
                  },
         
     | 
| 
       40 
40 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       41 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 41 
     | 
    
         
            +
                    "checksum" => "2c49c8f24a9dd8f9d55c28015b3e1096180807e7b13d4a9cd8ed30f58bc6612f",
         
     | 
| 
       42 
42 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
         
     | 
| 
       43 
43 
     | 
    
         
             
                  }
         
     | 
| 
       44 
44 
     | 
    
         
             
                },
         
     | 
| 
       45 
45 
     | 
    
         
             
                "arm64-darwin" => {
         
     | 
| 
       46 
46 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       47 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 47 
     | 
    
         
            +
                    "checksum" => "79d22436bfe32dab4661f2a4149c6ab34c71e810c5d808ee3e60cd9f8a1395e4",
         
     | 
| 
       48 
48 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
         
     | 
| 
       49 
49 
     | 
    
         
             
                  },
         
     | 
| 
       50 
50 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       51 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 51 
     | 
    
         
            +
                    "checksum" => "2c49c8f24a9dd8f9d55c28015b3e1096180807e7b13d4a9cd8ed30f58bc6612f",
         
     | 
| 
       52 
52 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
         
     | 
| 
       53 
53 
     | 
    
         
             
                  }
         
     | 
| 
       54 
54 
     | 
    
         
             
                },
         
     | 
| 
       55 
55 
     | 
    
         
             
                "arm-darwin" => {
         
     | 
| 
       56 
56 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       57 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 57 
     | 
    
         
            +
                    "checksum" => "79d22436bfe32dab4661f2a4149c6ab34c71e810c5d808ee3e60cd9f8a1395e4",
         
     | 
| 
       58 
58 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
         
     | 
| 
       59 
59 
     | 
    
         
             
                  },
         
     | 
| 
       60 
60 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       61 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 61 
     | 
    
         
            +
                    "checksum" => "2c49c8f24a9dd8f9d55c28015b3e1096180807e7b13d4a9cd8ed30f58bc6612f",
         
     | 
| 
       62 
62 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
         
     | 
| 
       63 
63 
     | 
    
         
             
                  }
         
     | 
| 
       64 
64 
     | 
    
         
             
                },
         
     | 
| 
       65 
65 
     | 
    
         
             
                "aarch64-linux" => {
         
     | 
| 
       66 
66 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       67 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 67 
     | 
    
         
            +
                    "checksum" => "4a54587bb61f59d0b60032b2e0c1d14d2e726e20af049353c2ff279d07dd3028",
         
     | 
| 
       68 
68 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
         
     | 
| 
       69 
69 
     | 
    
         
             
                  },
         
     | 
| 
       70 
70 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       71 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 71 
     | 
    
         
            +
                    "checksum" => "aa2d011c538ce547c87110e7c8e49a24597d60ea2d1418032fc3db06267efba2",
         
     | 
| 
       72 
72 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
         
     | 
| 
       73 
73 
     | 
    
         
             
                  }
         
     | 
| 
       74 
74 
     | 
    
         
             
                },
         
     | 
| 
       75 
75 
     | 
    
         
             
                "i686-linux" => {
         
     | 
| 
       76 
76 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       77 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 77 
     | 
    
         
            +
                    "checksum" => "01e2237029c3af23cc6f348fb63f65a92b8caf8f4731b78d014bb4001559aad5",
         
     | 
| 
       78 
78 
     | 
    
         
             
                    "filename" => "appsignal-i686-linux-all-static.tar.gz"
         
     | 
| 
       79 
79 
     | 
    
         
             
                  },
         
     | 
| 
       80 
80 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       81 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 81 
     | 
    
         
            +
                    "checksum" => "c1043ac92b000a406d9afb77b6ec1d3ab6cfffd63c218a720c11daa3edb7fd1f",
         
     | 
| 
       82 
82 
     | 
    
         
             
                    "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
         
     | 
| 
       83 
83 
     | 
    
         
             
                  }
         
     | 
| 
       84 
84 
     | 
    
         
             
                },
         
     | 
| 
       85 
85 
     | 
    
         
             
                "x86-linux" => {
         
     | 
| 
       86 
86 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       87 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 87 
     | 
    
         
            +
                    "checksum" => "01e2237029c3af23cc6f348fb63f65a92b8caf8f4731b78d014bb4001559aad5",
         
     | 
| 
       88 
88 
     | 
    
         
             
                    "filename" => "appsignal-i686-linux-all-static.tar.gz"
         
     | 
| 
       89 
89 
     | 
    
         
             
                  },
         
     | 
| 
       90 
90 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       91 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 91 
     | 
    
         
            +
                    "checksum" => "c1043ac92b000a406d9afb77b6ec1d3ab6cfffd63c218a720c11daa3edb7fd1f",
         
     | 
| 
       92 
92 
     | 
    
         
             
                    "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
         
     | 
| 
       93 
93 
     | 
    
         
             
                  }
         
     | 
| 
       94 
94 
     | 
    
         
             
                },
         
     | 
| 
       95 
95 
     | 
    
         
             
                "x86_64-linux" => {
         
     | 
| 
       96 
96 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       97 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 97 
     | 
    
         
            +
                    "checksum" => "beae1db2c122eb579f1ccb450177b0c64d65569d774efc7a1ee72c42d3382d39",
         
     | 
| 
       98 
98 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
         
     | 
| 
       99 
99 
     | 
    
         
             
                  },
         
     | 
| 
       100 
100 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       101 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 101 
     | 
    
         
            +
                    "checksum" => "67650f59d2ea9c99cde7dfe44da65a506522a3cdccabe697931d89ebaea96d18",
         
     | 
| 
       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" => " 
     | 
| 
      
 107 
     | 
    
         
            +
                    "checksum" => "521c4486d10cdafa1f72103cc439d6f0e4f549f1522c4473bf43dc487ec42436",
         
     | 
| 
       108 
108 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
         
     | 
| 
       109 
109 
     | 
    
         
             
                  },
         
     | 
| 
       110 
110 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       111 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 111 
     | 
    
         
            +
                    "checksum" => "0a94fcee8eb1f8fd06fce3eacffbcf9f2a52f5cde040796e19a589176525db4b",
         
     | 
| 
       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" => " 
     | 
| 
      
 117 
     | 
    
         
            +
                    "checksum" => "c29aab31f4ca59efb1483f48c0cb3c27d799347b81655a28f24c146b55aa7db6",
         
     | 
| 
       118 
118 
     | 
    
         
             
                    "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
         
     | 
| 
       119 
119 
     | 
    
         
             
                  },
         
     | 
| 
       120 
120 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       121 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 121 
     | 
    
         
            +
                    "checksum" => "4b77ea0c1f50ada6e5f6ed693002e56db1e34e0e9d5fdb4ac80fc52fd51099b8",
         
     | 
| 
       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" => " 
     | 
| 
      
 127 
     | 
    
         
            +
                    "checksum" => "a3598e9df1b6b5970aabbbccbe4e77c2372d2320cd87bfa20f32fca53b8505e4",
         
     | 
| 
       128 
128 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
         
     | 
| 
       129 
129 
     | 
    
         
             
                  },
         
     | 
| 
       130 
130 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       131 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 131 
     | 
    
         
            +
                    "checksum" => "4cbfd5e16776c8ea4308ee7f3a096c5cc137f2506f8a05d9c8504e3483fcd8ac",
         
     | 
| 
       132 
132 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
         
     | 
| 
       133 
133 
     | 
    
         
             
                  }
         
     | 
| 
       134 
134 
     | 
    
         
             
                },
         
     | 
| 
       135 
135 
     | 
    
         
             
                "amd64-freebsd" => {
         
     | 
| 
       136 
136 
     | 
    
         
             
                  "static" => {
         
     | 
| 
       137 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 137 
     | 
    
         
            +
                    "checksum" => "a3598e9df1b6b5970aabbbccbe4e77c2372d2320cd87bfa20f32fca53b8505e4",
         
     | 
| 
       138 
138 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
         
     | 
| 
       139 
139 
     | 
    
         
             
                  },
         
     | 
| 
       140 
140 
     | 
    
         
             
                  "dynamic" => {
         
     | 
| 
       141 
     | 
    
         
            -
                    "checksum" => " 
     | 
| 
      
 141 
     | 
    
         
            +
                    "checksum" => "4cbfd5e16776c8ea4308ee7f3a096c5cc137f2506f8a05d9c8504e3483fcd8ac",
         
     | 
| 
       142 
142 
     | 
    
         
             
                    "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
         
     | 
| 
       143 
143 
     | 
    
         
             
                  }
         
     | 
| 
       144 
144 
     | 
    
         
             
                }
         
     | 
    
        data/ext/base.rb
    CHANGED
    
    | 
         @@ -190,6 +190,9 @@ def store_download_version_on_report 
     | 
|
| 
       190 
190 
     | 
    
         
             
            end
         
     | 
| 
       191 
191 
     | 
    
         | 
| 
       192 
192 
     | 
    
         
             
            def http_proxy
         
     | 
| 
      
 193 
     | 
    
         
            +
              proxy = try_http_proxy_value(ENV.fetch("APPSIGNAL_HTTP_PROXY", nil))
         
     | 
| 
      
 194 
     | 
    
         
            +
              return [proxy, nil] if proxy
         
     | 
| 
      
 195 
     | 
    
         
            +
             
     | 
| 
       193 
196 
     | 
    
         
             
              proxy, error =
         
     | 
| 
       194 
197 
     | 
    
         
             
                begin
         
     | 
| 
       195 
198 
     | 
    
         
             
                  [try_http_proxy_value(Gem.configuration[:http_proxy]), nil]
         
     | 
    
        data/lib/appsignal/config.rb
    CHANGED
    
    | 
         @@ -8,7 +8,7 @@ require "tmpdir" 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            module Appsignal
         
     | 
| 
       10 
10 
     | 
    
         
             
              class Config
         
     | 
| 
       11 
     | 
    
         
            -
                include Appsignal::Utils:: 
     | 
| 
      
 11 
     | 
    
         
            +
                include Appsignal::Utils::StdoutAndLoggerMessage
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                DEFAULT_CONFIG = {
         
     | 
| 
       14 
14 
     | 
    
         
             
                  :activejob_report_errors => "all",
         
     | 
| 
         @@ -30,6 +30,7 @@ module Appsignal 
     | 
|
| 
       30 
30 
     | 
    
         
             
                  :filter_session_data => [],
         
     | 
| 
       31 
31 
     | 
    
         
             
                  :ignore_actions => [],
         
     | 
| 
       32 
32 
     | 
    
         
             
                  :ignore_errors => [],
         
     | 
| 
      
 33 
     | 
    
         
            +
                  :ignore_logs => [],
         
     | 
| 
       33 
34 
     | 
    
         
             
                  :ignore_namespaces => [],
         
     | 
| 
       34 
35 
     | 
    
         
             
                  :instrument_http_rb => true,
         
     | 
| 
       35 
36 
     | 
    
         
             
                  :instrument_net_http => true,
         
     | 
| 
         @@ -90,6 +91,7 @@ module Appsignal 
     | 
|
| 
       90 
91 
     | 
    
         
             
                  "APPSIGNAL_HTTP_PROXY" => :http_proxy,
         
     | 
| 
       91 
92 
     | 
    
         
             
                  "APPSIGNAL_IGNORE_ACTIONS" => :ignore_actions,
         
     | 
| 
       92 
93 
     | 
    
         
             
                  "APPSIGNAL_IGNORE_ERRORS" => :ignore_errors,
         
     | 
| 
      
 94 
     | 
    
         
            +
                  "APPSIGNAL_IGNORE_LOGS" => :ignore_logs,
         
     | 
| 
       93 
95 
     | 
    
         
             
                  "APPSIGNAL_IGNORE_NAMESPACES" => :ignore_namespaces,
         
     | 
| 
       94 
96 
     | 
    
         
             
                  "APPSIGNAL_INSTRUMENT_HTTP_RB" => :instrument_http_rb,
         
     | 
| 
       95 
97 
     | 
    
         
             
                  "APPSIGNAL_INSTRUMENT_NET_HTTP" => :instrument_net_http,
         
     | 
| 
         @@ -165,6 +167,7 @@ module Appsignal 
     | 
|
| 
       165 
167 
     | 
    
         
             
                  APPSIGNAL_FILTER_SESSION_DATA
         
     | 
| 
       166 
168 
     | 
    
         
             
                  APPSIGNAL_IGNORE_ACTIONS
         
     | 
| 
       167 
169 
     | 
    
         
             
                  APPSIGNAL_IGNORE_ERRORS
         
     | 
| 
      
 170 
     | 
    
         
            +
                  APPSIGNAL_IGNORE_LOGS
         
     | 
| 
       168 
171 
     | 
    
         
             
                  APPSIGNAL_IGNORE_NAMESPACES
         
     | 
| 
       169 
172 
     | 
    
         
             
                  APPSIGNAL_REQUEST_HEADERS
         
     | 
| 
       170 
173 
     | 
    
         
             
                ].freeze
         
     | 
| 
         @@ -317,20 +320,29 @@ module Appsignal 
     | 
|
| 
       317 
320 
     | 
    
         
             
                end
         
     | 
| 
       318 
321 
     | 
    
         | 
| 
       319 
322 
     | 
    
         
             
                def log_file_path
         
     | 
| 
      
 323 
     | 
    
         
            +
                  return @log_file_path if defined? @log_file_path
         
     | 
| 
      
 324 
     | 
    
         
            +
             
     | 
| 
       320 
325 
     | 
    
         
             
                  path = config_hash[:log_path] || (root_path && File.join(root_path, "log"))
         
     | 
| 
       321 
     | 
    
         
            -
                   
     | 
| 
      
 326 
     | 
    
         
            +
                  if path && File.writable?(path)
         
     | 
| 
      
 327 
     | 
    
         
            +
                    @log_file_path = File.join(File.realpath(path), "appsignal.log")
         
     | 
| 
      
 328 
     | 
    
         
            +
                    return @log_file_path
         
     | 
| 
      
 329 
     | 
    
         
            +
                  end
         
     | 
| 
       322 
330 
     | 
    
         | 
| 
       323 
331 
     | 
    
         
             
                  system_tmp_dir = self.class.system_tmp_dir
         
     | 
| 
       324 
332 
     | 
    
         
             
                  if File.writable? system_tmp_dir
         
     | 
| 
       325 
333 
     | 
    
         
             
                    $stdout.puts "appsignal: Unable to log to '#{path}'. Logging to " \
         
     | 
| 
       326 
     | 
    
         
            -
                      "'#{system_tmp_dir}' instead.  
     | 
| 
       327 
     | 
    
         
            -
                      "permissions for the application's (log)  
     | 
| 
       328 
     | 
    
         
            -
             
     | 
| 
      
 334 
     | 
    
         
            +
                      "'#{system_tmp_dir}' instead. " \
         
     | 
| 
      
 335 
     | 
    
         
            +
                      "Please check the permissions for the application's (log) " \
         
     | 
| 
      
 336 
     | 
    
         
            +
                      "directory."
         
     | 
| 
      
 337 
     | 
    
         
            +
                    @log_file_path = File.join(system_tmp_dir, "appsignal.log")
         
     | 
| 
       329 
338 
     | 
    
         
             
                  else
         
     | 
| 
       330 
339 
     | 
    
         
             
                    $stdout.puts "appsignal: Unable to log to '#{path}' or the " \
         
     | 
| 
       331 
340 
     | 
    
         
             
                      "'#{system_tmp_dir}' fallback. Please check the permissions " \
         
     | 
| 
       332 
341 
     | 
    
         
             
                      "for the application's (log) directory."
         
     | 
| 
      
 342 
     | 
    
         
            +
                    @log_file_path = nil
         
     | 
| 
       333 
343 
     | 
    
         
             
                  end
         
     | 
| 
      
 344 
     | 
    
         
            +
             
     | 
| 
      
 345 
     | 
    
         
            +
                  @log_file_path
         
     | 
| 
       334 
346 
     | 
    
         
             
                end
         
     | 
| 
       335 
347 
     | 
    
         | 
| 
       336 
348 
     | 
    
         
             
                def valid?
         
     | 
| 
         @@ -363,6 +375,7 @@ module Appsignal 
     | 
|
| 
       363 
375 
     | 
    
         
             
                  ENV["_APPSIGNAL_HTTP_PROXY"]                   = config_hash[:http_proxy]
         
     | 
| 
       364 
376 
     | 
    
         
             
                  ENV["_APPSIGNAL_IGNORE_ACTIONS"]               = config_hash[:ignore_actions].join(",")
         
     | 
| 
       365 
377 
     | 
    
         
             
                  ENV["_APPSIGNAL_IGNORE_ERRORS"]                = config_hash[:ignore_errors].join(",")
         
     | 
| 
      
 378 
     | 
    
         
            +
                  ENV["_APPSIGNAL_IGNORE_LOGS"]                  = config_hash[:ignore_logs].join(",")
         
     | 
| 
       366 
379 
     | 
    
         
             
                  ENV["_APPSIGNAL_IGNORE_NAMESPACES"]            = config_hash[:ignore_namespaces].join(",")
         
     | 
| 
       367 
380 
     | 
    
         
             
                  ENV["_APPSIGNAL_LANGUAGE_INTEGRATION_VERSION"] = "ruby-#{Appsignal::VERSION}"
         
     | 
| 
       368 
381 
     | 
    
         
             
                  ENV["_APPSIGNAL_LOG"]                          = config_hash[:log]
         
     | 
| 
         @@ -472,7 +485,7 @@ module Appsignal 
     | 
|
| 
       472 
485 
     | 
    
         
             
                def maintain_backwards_compatibility
         
     | 
| 
       473 
486 
     | 
    
         
             
                  return unless config_hash.key?(:working_dir_path)
         
     | 
| 
       474 
487 
     | 
    
         | 
| 
       475 
     | 
    
         
            -
                   
     | 
| 
      
 488 
     | 
    
         
            +
                  stdout_and_logger_warning \
         
     | 
| 
       476 
489 
     | 
    
         
             
                    "The `working_dir_path` option is deprecated, please use " \
         
     | 
| 
       477 
490 
     | 
    
         
             
                      "`working_directory_path` instead and specify the " \
         
     | 
| 
       478 
491 
     | 
    
         
             
                      "full path to the working directory",
         
     | 
| 
         @@ -538,7 +551,7 @@ module Appsignal 
     | 
|
| 
       538 
551 
     | 
    
         
             
                      config[:send_session_data] = true # Set default value
         
     | 
| 
       539 
552 
     | 
    
         
             
                    end
         
     | 
| 
       540 
553 
     | 
    
         
             
                  else
         
     | 
| 
       541 
     | 
    
         
            -
                     
     | 
| 
      
 554 
     | 
    
         
            +
                    stdout_and_logger_warning "The `skip_session_data` config option is " \
         
     | 
| 
       542 
555 
     | 
    
         
             
                      "deprecated. Please use `send_session_data` instead.",
         
     | 
| 
       543 
556 
     | 
    
         
             
                      logger
         
     | 
| 
       544 
557 
     | 
    
         
             
                    # Not configured by user
         
     | 
| 
         @@ -0,0 +1,71 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Appsignal
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Heartbeat
         
     | 
| 
      
 5 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def transmitter
         
     | 
| 
      
 7 
     | 
    
         
            +
                    @transmitter ||= Appsignal::Transmitter.new(
         
     | 
| 
      
 8 
     | 
    
         
            +
                      "#{Appsignal.config[:logging_endpoint]}/heartbeats/json"
         
     | 
| 
      
 9 
     | 
    
         
            +
                    )
         
     | 
| 
      
 10 
     | 
    
         
            +
                  end
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                attr_reader :name, :id
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                def initialize(name:)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @name = name
         
     | 
| 
      
 17 
     | 
    
         
            +
                  @id = SecureRandom.hex(8)
         
     | 
| 
      
 18 
     | 
    
         
            +
                end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                def start
         
     | 
| 
      
 21 
     | 
    
         
            +
                  transmit_event("start")
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                def finish
         
     | 
| 
      
 25 
     | 
    
         
            +
                  transmit_event("finish")
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                private
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                def event(kind)
         
     | 
| 
      
 31 
     | 
    
         
            +
                  {
         
     | 
| 
      
 32 
     | 
    
         
            +
                    :name => name,
         
     | 
| 
      
 33 
     | 
    
         
            +
                    :id => @id,
         
     | 
| 
      
 34 
     | 
    
         
            +
                    :kind => kind,
         
     | 
| 
      
 35 
     | 
    
         
            +
                    :timestamp => Time.now.utc.to_i
         
     | 
| 
      
 36 
     | 
    
         
            +
                  }
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                def transmit_event(kind)
         
     | 
| 
      
 40 
     | 
    
         
            +
                  unless Appsignal.active?
         
     | 
| 
      
 41 
     | 
    
         
            +
                    Appsignal.internal_logger.debug("AppSignal not active, not transmitting heartbeat event")
         
     | 
| 
      
 42 
     | 
    
         
            +
                    return
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  response = self.class.transmitter.transmit(event(kind))
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
                  if response.code.to_i >= 200 && response.code.to_i < 300
         
     | 
| 
      
 48 
     | 
    
         
            +
                    Appsignal.internal_logger.trace("Transmitted heartbeat `#{name}` (#{id}) #{kind} event")
         
     | 
| 
      
 49 
     | 
    
         
            +
                  else
         
     | 
| 
      
 50 
     | 
    
         
            +
                    Appsignal.internal_logger.error(
         
     | 
| 
      
 51 
     | 
    
         
            +
                      "Failed to transmit heartbeat event: status code was #{response.code}"
         
     | 
| 
      
 52 
     | 
    
         
            +
                    )
         
     | 
| 
      
 53 
     | 
    
         
            +
                  end
         
     | 
| 
      
 54 
     | 
    
         
            +
                rescue => e
         
     | 
| 
      
 55 
     | 
    
         
            +
                  Appsignal.internal_logger.error("Failed to transmit heartbeat event: #{e}")
         
     | 
| 
      
 56 
     | 
    
         
            +
                end
         
     | 
| 
      
 57 
     | 
    
         
            +
              end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
              def self.heartbeat(name)
         
     | 
| 
      
 60 
     | 
    
         
            +
                heartbeat = Appsignal::Heartbeat.new(:name => name)
         
     | 
| 
      
 61 
     | 
    
         
            +
                output = nil
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                if block_given?
         
     | 
| 
      
 64 
     | 
    
         
            +
                  heartbeat.start
         
     | 
| 
      
 65 
     | 
    
         
            +
                  output = yield
         
     | 
| 
      
 66 
     | 
    
         
            +
                end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                heartbeat.finish
         
     | 
| 
      
 69 
     | 
    
         
            +
                output
         
     | 
| 
      
 70 
     | 
    
         
            +
              end
         
     | 
| 
      
 71 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -3,7 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Appsignal
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Helpers
         
     | 
| 
       5 
5 
     | 
    
         
             
                module Instrumentation # rubocop:disable Metrics/ModuleLength
         
     | 
| 
       6 
     | 
    
         
            -
                  include Appsignal::Utils:: 
     | 
| 
      
 6 
     | 
    
         
            +
                  include Appsignal::Utils::StdoutAndLoggerMessage
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
                  # Creates an AppSignal transaction for the given block.
         
     | 
| 
       9 
9 
     | 
    
         
             
                  #
         
     | 
| 
         @@ -207,7 +207,7 @@ module Appsignal 
     | 
|
| 
       207 
207 
     | 
    
         
             
                  )
         
     | 
| 
       208 
208 
     | 
    
         
             
                    if tags
         
     | 
| 
       209 
209 
     | 
    
         
             
                      call_location = caller(1..1).first
         
     | 
| 
       210 
     | 
    
         
            -
                       
     | 
| 
      
 210 
     | 
    
         
            +
                      stdout_and_logger_warning \
         
     | 
| 
       211 
211 
     | 
    
         
             
                        "The tags argument for `Appsignal.send_error` is deprecated. " \
         
     | 
| 
       212 
212 
     | 
    
         
             
                          "Please use the block method to set tags instead.\n\n" \
         
     | 
| 
       213 
213 
     | 
    
         
             
                          "  Appsignal.send_error(error) do |transaction|\n" \
         
     | 
| 
         @@ -217,7 +217,7 @@ module Appsignal 
     | 
|
| 
       217 
217 
     | 
    
         
             
                    end
         
     | 
| 
       218 
218 
     | 
    
         
             
                    if namespace
         
     | 
| 
       219 
219 
     | 
    
         
             
                      call_location = caller(1..1).first
         
     | 
| 
       220 
     | 
    
         
            -
                       
     | 
| 
      
 220 
     | 
    
         
            +
                      stdout_and_logger_warning \
         
     | 
| 
       221 
221 
     | 
    
         
             
                        "The namespace argument for `Appsignal.send_error` is deprecated. " \
         
     | 
| 
       222 
222 
     | 
    
         
             
                          "Please use the block method to set the namespace instead.\n\n" \
         
     | 
| 
       223 
223 
     | 
    
         
             
                          "  Appsignal.send_error(error) do |transaction|\n" \
         
     | 
| 
         @@ -300,7 +300,7 @@ module Appsignal 
     | 
|
| 
       300 
300 
     | 
    
         
             
                  def set_error(exception, tags = nil, namespace = nil)
         
     | 
| 
       301 
301 
     | 
    
         
             
                    if tags
         
     | 
| 
       302 
302 
     | 
    
         
             
                      call_location = caller(1..1).first
         
     | 
| 
       303 
     | 
    
         
            -
                       
     | 
| 
      
 303 
     | 
    
         
            +
                      stdout_and_logger_warning \
         
     | 
| 
       304 
304 
     | 
    
         
             
                        "The tags argument for `Appsignal.set_error` is deprecated. " \
         
     | 
| 
       305 
305 
     | 
    
         
             
                          "Please use the block method to set tags instead.\n\n" \
         
     | 
| 
       306 
306 
     | 
    
         
             
                          "  Appsignal.set_error(error) do |transaction|\n" \
         
     | 
| 
         @@ -310,7 +310,7 @@ module Appsignal 
     | 
|
| 
       310 
310 
     | 
    
         
             
                    end
         
     | 
| 
       311 
311 
     | 
    
         
             
                    if namespace
         
     | 
| 
       312 
312 
     | 
    
         
             
                      call_location = caller(1..1).first
         
     | 
| 
       313 
     | 
    
         
            -
                       
     | 
| 
      
 313 
     | 
    
         
            +
                      stdout_and_logger_warning \
         
     | 
| 
       314 
314 
     | 
    
         
             
                        "The namespace argument for `Appsignal.set_error` is deprecated. " \
         
     | 
| 
       315 
315 
     | 
    
         
             
                          "Please use the block method to set the namespace instead.\n\n" \
         
     | 
| 
       316 
316 
     | 
    
         
             
                          "  Appsignal.set_error(error) do |transaction|\n" \
         
     | 
| 
         @@ -15,7 +15,7 @@ module Appsignal 
     | 
|
| 
       15 
15 
     | 
    
         
             
                  end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                  def set_host_gauge(_key, _value)
         
     | 
| 
       18 
     | 
    
         
            -
                    Appsignal::Utils:: 
     | 
| 
      
 18 
     | 
    
         
            +
                    Appsignal::Utils::StdoutAndLoggerMessage.warning \
         
     | 
| 
       19 
19 
     | 
    
         
             
                      "The `set_host_gauge` method has been deprecated. " \
         
     | 
| 
       20 
20 
     | 
    
         
             
                        "Calling this method has no effect. " \
         
     | 
| 
       21 
21 
     | 
    
         
             
                        "Please remove method call in the following file to remove " \
         
     | 
| 
         @@ -23,7 +23,7 @@ module Appsignal 
     | 
|
| 
       23 
23 
     | 
    
         
             
                  end
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
                  def set_process_gauge(_key, _value)
         
     | 
| 
       26 
     | 
    
         
            -
                    Appsignal::Utils:: 
     | 
| 
      
 26 
     | 
    
         
            +
                    Appsignal::Utils::StdoutAndLoggerMessage.warning \
         
     | 
| 
       27 
27 
     | 
    
         
             
                      "The `set_process_gauge` method has been deprecated. " \
         
     | 
| 
       28 
28 
     | 
    
         
             
                        "Calling this method has no effect. " \
         
     | 
| 
       29 
29 
     | 
    
         
             
                        "Please remove method call in the following file to remove " \
         
     | 
    
        data/lib/appsignal/hooks/gvl.rb
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ module Appsignal 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                  def install
         
     | 
| 
       19 
     | 
    
         
            -
                    Appsignal:: 
     | 
| 
      
 19 
     | 
    
         
            +
                    Appsignal::Probes.probes.register :gvl, Appsignal::Probes::GvlProbe
         
     | 
| 
       20 
20 
     | 
    
         
             
                    ::GVLTools::GlobalTimer.enable if Appsignal.config[:enable_gvl_global_timer]
         
     | 
| 
       21 
21 
     | 
    
         
             
                    ::GVLTools::WaitingThreads.enable if Appsignal.config[:enable_gvl_waiting_threads]
         
     | 
| 
       22 
22 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/appsignal/hooks/mri.rb
    CHANGED
    
    
| 
         @@ -11,7 +11,7 @@ module Appsignal 
     | 
|
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                  def install
         
     | 
| 
       13 
13 
     | 
    
         
             
                    require "appsignal/integrations/sidekiq"
         
     | 
| 
       14 
     | 
    
         
            -
                    Appsignal:: 
     | 
| 
      
 14 
     | 
    
         
            +
                    Appsignal::Probes.probes.register :sidekiq, Appsignal::Probes::SidekiqProbe
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                    ::Sidekiq.configure_server do |config|
         
     | 
| 
       17 
17 
     | 
    
         
             
                      config.error_handlers <<
         
     | 
    
        data/lib/appsignal/hooks.rb
    CHANGED
    
    | 
         @@ -76,7 +76,7 @@ module Appsignal 
     | 
|
| 
       76 
76 
     | 
    
         
             
                  when :SidekiqPlugin
         
     | 
| 
       77 
77 
     | 
    
         
             
                    require "appsignal/integrations/sidekiq"
         
     | 
| 
       78 
78 
     | 
    
         
             
                    callers = caller
         
     | 
| 
       79 
     | 
    
         
            -
                    Appsignal::Utils:: 
     | 
| 
      
 79 
     | 
    
         
            +
                    Appsignal::Utils::StdoutAndLoggerMessage.warning \
         
     | 
| 
       80 
80 
     | 
    
         
             
                      "The constant Appsignal::Hooks::SidekiqPlugin has been deprecated. " \
         
     | 
| 
       81 
81 
     | 
    
         
             
                        "Please update the constant name to Appsignal::Integrations::SidekiqMiddleware " \
         
     | 
| 
       82 
82 
     | 
    
         
             
                        "in the following file to remove this message.\n#{callers.first}"
         
     |