appsignal 1.3.6 → 1.4.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rspec +1 -3
  4. data/CHANGELOG.md +2 -28
  5. data/Rakefile +2 -2
  6. data/benchmark.rake +4 -0
  7. data/circle.yml +12 -0
  8. data/ext/agent.yml +11 -11
  9. data/ext/appsignal_extension.c +3 -3
  10. data/ext/extconf.rb +4 -4
  11. data/lib/appsignal.rb +10 -27
  12. data/lib/appsignal/cli/diagnose.rb +3 -4
  13. data/lib/appsignal/cli/install.rb +15 -16
  14. data/lib/appsignal/config.rb +7 -18
  15. data/lib/appsignal/event_formatter.rb +1 -1
  16. data/lib/appsignal/integrations/capistrano/appsignal.cap +1 -1
  17. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +2 -2
  18. data/lib/appsignal/integrations/object.rb +4 -4
  19. data/lib/appsignal/integrations/sinatra.rb +1 -1
  20. data/lib/appsignal/integrations/webmachine.rb +1 -1
  21. data/lib/appsignal/js_exception_transaction.rb +0 -1
  22. data/lib/appsignal/marker.rb +2 -3
  23. data/lib/appsignal/rack/sinatra_instrumentation.rb +5 -12
  24. data/lib/appsignal/rack/streaming_listener.rb +2 -4
  25. data/lib/appsignal/transaction.rb +3 -3
  26. data/lib/appsignal/transmitter.rb +7 -11
  27. data/lib/appsignal/utils.rb +0 -6
  28. data/lib/appsignal/version.rb +1 -1
  29. data/spec/lib/appsignal/auth_check_spec.rb +2 -0
  30. data/spec/lib/appsignal/capistrano2_spec.rb +78 -98
  31. data/spec/lib/appsignal/capistrano3_spec.rb +77 -56
  32. data/spec/lib/appsignal/cli/diagnose_spec.rb +13 -12
  33. data/spec/lib/appsignal/cli/install_spec.rb +15 -38
  34. data/spec/lib/appsignal/cli/notify_of_deploy_spec.rb +5 -2
  35. data/spec/lib/appsignal/cli_spec.rb +5 -2
  36. data/spec/lib/appsignal/config_spec.rb +17 -131
  37. data/spec/lib/appsignal/event_formatter/action_view/render_formatter_spec.rb +2 -0
  38. data/spec/lib/appsignal/event_formatter/active_record/instantiation_formatter_spec.rb +2 -0
  39. data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +2 -0
  40. data/spec/lib/appsignal/event_formatter/elastic_search/search_formatter_spec.rb +2 -0
  41. data/spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb +2 -0
  42. data/spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb +2 -0
  43. data/spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb +2 -0
  44. data/spec/lib/appsignal/event_formatter_spec.rb +2 -0
  45. data/spec/lib/appsignal/extension_spec.rb +1 -0
  46. data/spec/lib/appsignal/hooks/celluloid_spec.rb +2 -0
  47. data/spec/lib/appsignal/hooks/data_mapper_spec.rb +2 -0
  48. data/spec/lib/appsignal/hooks/delayed_job_spec.rb +2 -0
  49. data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +2 -0
  50. data/spec/lib/appsignal/hooks/net_http_spec.rb +2 -0
  51. data/spec/lib/appsignal/hooks/passenger_spec.rb +2 -0
  52. data/spec/lib/appsignal/hooks/puma_spec.rb +2 -0
  53. data/spec/lib/appsignal/hooks/rake_spec.rb +1 -0
  54. data/spec/lib/appsignal/hooks/redis_spec.rb +2 -0
  55. data/spec/lib/appsignal/hooks/sequel_spec.rb +2 -0
  56. data/spec/lib/appsignal/hooks/shoryuken_spec.rb +4 -1
  57. data/spec/lib/appsignal/hooks/sidekiq_spec.rb +3 -2
  58. data/spec/lib/appsignal/hooks/unicorn_spec.rb +2 -0
  59. data/spec/lib/appsignal/hooks/webmachine_spec.rb +8 -2
  60. data/spec/lib/appsignal/hooks_spec.rb +2 -0
  61. data/spec/lib/appsignal/integrations/data_mapper_spec.rb +1 -0
  62. data/spec/lib/appsignal/integrations/grape_spec.rb +2 -0
  63. data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +1 -0
  64. data/spec/lib/appsignal/integrations/object_spec.rb +1 -30
  65. data/spec/lib/appsignal/integrations/padrino_spec.rb +2 -0
  66. data/spec/lib/appsignal/integrations/railtie_spec.rb +2 -0
  67. data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +2 -0
  68. data/spec/lib/appsignal/integrations/resque_spec.rb +3 -1
  69. data/spec/lib/appsignal/integrations/sinatra_spec.rb +7 -32
  70. data/spec/lib/appsignal/integrations/webmachine_spec.rb +11 -4
  71. data/spec/lib/appsignal/js_exception_transaction_spec.rb +2 -0
  72. data/spec/lib/appsignal/marker_spec.rb +48 -35
  73. data/spec/lib/appsignal/minutely_spec.rb +2 -0
  74. data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +2 -0
  75. data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +2 -0
  76. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +2 -0
  77. data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +6 -46
  78. data/spec/lib/appsignal/rack/streaming_listener_spec.rb +4 -3
  79. data/spec/lib/appsignal/subscriber_spec.rb +2 -0
  80. data/spec/lib/appsignal/transaction_spec.rb +3 -2
  81. data/spec/lib/appsignal/transmitter_spec.rb +20 -53
  82. data/spec/lib/appsignal/update_active_support_spec.rb +2 -0
  83. data/spec/lib/appsignal/utils/params_sanitizer_spec.rb +2 -0
  84. data/spec/lib/appsignal/utils/query_params_sanitizer_spec.rb +2 -0
  85. data/spec/lib/appsignal/utils_spec.rb +2 -0
  86. data/spec/lib/appsignal_spec.rb +37 -91
  87. data/spec/spec_helper.rb +28 -22
  88. metadata +5 -14
  89. data/spec/lib/appsignal/utils/gzip_spec.rb +0 -10
  90. data/spec/support/helpers/api_request_helper.rb +0 -19
  91. data/spec/support/helpers/directory_helper.rb +0 -25
  92. data/spec/support/helpers/std_streams_helper.rb +0 -35
  93. data/spec/support/helpers/very_specific_error.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66a5631dc247e540f18fdb0d2e212d3c8125fd95
4
- data.tar.gz: b6aad615e011a4bdd7392f5ea9d0c528f0432d2b
3
+ metadata.gz: d7e0714208d16378116ca1e5b526c1d1e86622ab
4
+ data.tar.gz: 17296a5f5358675b963682c8e683ede088fa4a13
5
5
  SHA512:
6
- metadata.gz: 658ef073b6ba0ed43d3cef4f1ea110a22cdbf048985e514f3f0111b7d084df8dccfe6272f95cb5ca4aa1e976f9f8c60788157ee2796dcb5416ec4aaef8a21a70
7
- data.tar.gz: abf3ae40acc98613930b7b05d1b42a130defcca4e1fdcb2e4a1a9b6e871d4f92de625d54a0b65de9a957edbca6bce396c6b605045ac6fe9d32f93f5da1eba832
6
+ metadata.gz: 4eb6ce393a25fd6ba0cfcb1e76ff479c6422b66a247a7238e61caab9c8fee2d7a886a6797d19f5a220ceff6c5c064a2be5db240543d73b970ff7133ce8fafdb0
7
+ data.tar.gz: e0f042f305a39b7e954f6130b0a08cf540549683e277d5aab60f859e8cb6c61cfc1d7a382d04e1b39be253e2e45e1dd487b2082cbeedfdebd3f701fdee3af002
data/.gitignore CHANGED
@@ -23,7 +23,7 @@ bundle_and_spec_all_rbenv
23
23
  bundle_and_spec_all_rvm
24
24
  ext/libappsignal.*
25
25
  ext/appsignal-agent
26
- ext/appsignal_extension.h
26
+ ext/appsignal.h
27
27
  ext/Makefile
28
28
  ext/*.bundle
29
29
  ext/*.o
data/.rspec CHANGED
@@ -1,3 +1 @@
1
- --order default
2
- --warnings
3
- --require spec_helper
1
+ --order default --warnings
@@ -1,29 +1,5 @@
1
- # 1.3.6
2
- * Support blocks arguments on method instrumentation
3
- * Support `APPSIGNAL_APP_ENV` for Sinatra
4
- * Minor improvements to installer
5
- * More robust handing of non-writable log files
6
- * Cleaner internal exception handling
7
- * Support for mixed case keywords in sql lexing
8
- * Support for inserting multiple rows in sql lexing
9
-
10
- # 1.3.5
11
-
12
- * Fix SSL certificate config in appsignal-agent. PR #151
13
- * Remove mounted_at Sinatra middleware option. Now detected by default. PR #146
14
- * Sinatra applications with middleware loading before AppSignal's middleware
15
- would crash a request. Fixed in PR #156
16
-
17
- # 1.3.4
18
-
19
- * Fix argument order for `record_event` in the AppSignal extension
20
-
21
- # 1.3.3
22
-
23
- * Output AppSignal environment on `appsignal diagnose`
24
- * Prevent transaction crashes on Sinatra routes with optional parameters
25
- * Listen to `stage` option to Capistrano 2 for automatic environment detection
26
- * Add `appsignal_env` option to Capistrano 2 to set a custom environment
1
+ # 1.4.0
2
+ * Support for a wider range of Linux versions, including Alpine
27
3
 
28
4
  # 1.3.2
29
5
  * Add method to discard a transaction
@@ -50,8 +26,6 @@
50
26
  * Allow overriding Padrino environment with APPSIGNAL_APP_ENV
51
27
  * Add mkmf.log to diagnose command
52
28
  * Allow for local install with bundler `bundle exec rake install`
53
- * Listen to `stage` option to Capistrano 3 for automatic environment detection
54
- * Add `appsignal_env` option to Capistrano 3 to set a custom environment
55
29
 
56
30
  # 1.2.5
57
31
  * Bugfix in CPU utilization calculation for host metrics
data/Rakefile CHANGED
@@ -104,7 +104,7 @@ task :publish do
104
104
  end
105
105
 
106
106
  task :install do
107
- system 'cd ext && rm -f libappsignal.a appsignal-agent appsignal_extension.h Makefile appsignal_extension.bundle && ruby extconf.rb && make && cd ..'
107
+ system 'cd ext && rm -f libappsignal.a appsignal-agent appsignal_extension.h Makefile appsignal.bundle && ruby extconf.rb && make && cd ..'
108
108
  Bundler.with_clean_env do
109
109
  GEMFILES.each do |gemfile|
110
110
  system "bundle --gemfile gemfiles/#{gemfile}.gemfile"
@@ -135,7 +135,7 @@ task :generate_bundle_and_spec_all do
135
135
  out << "#{switch_command.call(version)} || { echo 'Switching Ruby failed'; exit 1; }"
136
136
  out << "ruby -v"
137
137
  out << "echo 'Compiling extension'"
138
- out << 'cd ext && rm -f appsignal-agent appsignal_extension.bundle appsignal_extension.h libappsignal.a Makefile && ruby extconf.rb && make && cd ..'
138
+ out << 'cd ext && rm -f appsignal-agent appsignal_extension.bundle appsignal.h libappsignal.a Makefile && ruby extconf.rb && make && cd ..'
139
139
  GEMFILES.each do |gemfile|
140
140
  unless EXCLUSIONS[gemfile] && EXCLUSIONS[gemfile].include?(short_version)
141
141
  out << "echo 'Bundling #{gemfile} in #{short_version}'"
@@ -1,6 +1,10 @@
1
1
  require 'appsignal'
2
2
  require 'benchmark'
3
3
 
4
+ class ::Appsignal::EventFormatter::ActiveRecord::SqlFormatter
5
+ def connection_config; {:adapter => 'mysql'}; end
6
+ end
7
+
4
8
  GC.disable
5
9
 
6
10
  task :default => :'benchmark:all'
@@ -0,0 +1,12 @@
1
+ machine:
2
+ ruby:
3
+ version: 2.3.0
4
+
5
+ dependencies:
6
+ override:
7
+ - bundle
8
+ - bundle exec rake generate_bundle_and_spec_all
9
+
10
+ test:
11
+ override:
12
+ - ./bundle_and_spec_all_rvm
@@ -1,18 +1,18 @@
1
1
  ---
2
- version: 220a888
2
+ version: 9e60c7f
3
3
  triples:
4
4
  x86_64-linux:
5
- checksum: 5e313156339389b339c289592327ac1c3d57999df93cd31ce9c69fa4ede1e38f
6
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/220a888/appsignal-x86_64-linux-all-static.tar.gz
5
+ checksum: e29c92ff06c7c6aa3f18a49133d3695d64fff2b55bfdabb1721fe8348a369a9f
6
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9e60c7f/appsignal-x86_64-linux-all-static.tar.gz
7
7
  i686-linux:
8
- checksum: caeac8747e368bc122e56fdebd498b8c381a6d19d2b2dfaf01b648a6a973b28d
9
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/220a888/appsignal-i686-linux-all-static.tar.gz
8
+ checksum: 4157ef168a03093215b8adc7c61b52740d08ac54d031dc1579741a792250e94d
9
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9e60c7f/appsignal-i686-linux-all-static.tar.gz
10
10
  x86-linux:
11
- checksum: caeac8747e368bc122e56fdebd498b8c381a6d19d2b2dfaf01b648a6a973b28d
12
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/220a888/appsignal-i686-linux-all-static.tar.gz
11
+ checksum: 4157ef168a03093215b8adc7c61b52740d08ac54d031dc1579741a792250e94d
12
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9e60c7f/appsignal-i686-linux-all-static.tar.gz
13
13
  x86_64-darwin:
14
- checksum: 949a325baf8b1a40978288082cf1689c22d48cdef6acbbc389d5613d670f6fb9
15
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/220a888/appsignal-x86_64-darwin-all-static.tar.gz
14
+ checksum: a82a7b551037a33d7570df9559ae80d593662f6c38ed30cc73733c6c7e6f63cc
15
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9e60c7f/appsignal-x86_64-darwin-all-static.tar.gz
16
16
  universal-darwin:
17
- checksum: 949a325baf8b1a40978288082cf1689c22d48cdef6acbbc389d5613d670f6fb9
18
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/220a888/appsignal-x86_64-darwin-all-static.tar.gz
17
+ checksum: a82a7b551037a33d7570df9559ae80d593662f6c38ed30cc73733c6c7e6f63cc
18
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/9e60c7f/appsignal-x86_64-darwin-all-static.tar.gz
@@ -1,6 +1,6 @@
1
1
  #include "ruby/ruby.h"
2
2
  #include "ruby/encoding.h"
3
- #include "appsignal_extension.h"
3
+ #include "appsignal.h"
4
4
 
5
5
  static inline appsignal_string_t make_appsignal_string(VALUE str) {
6
6
  return (appsignal_string_t) {
@@ -110,8 +110,8 @@ static VALUE record_event(VALUE self, VALUE name, VALUE title, VALUE body, VALUE
110
110
  make_appsignal_string(name),
111
111
  make_appsignal_string(title),
112
112
  make_appsignal_string(body),
113
- NUM2LONG(duration),
114
- FIX2INT(body_format)
113
+ FIX2INT(body_format),
114
+ NUM2LONG(duration)
115
115
  );
116
116
  return Qnil;
117
117
  }
@@ -49,7 +49,7 @@ def install
49
49
 
50
50
  unless File.exist?(ext_path('appsignal-agent')) &&
51
51
  File.exist?(ext_path('libappsignal.a')) &&
52
- File.exist?(ext_path('appsignal_extension.h'))
52
+ File.exist?(ext_path('appsignal.h'))
53
53
  logger.info "Downloading agent release from #{arch_config['download_url']}"
54
54
 
55
55
  archive = open(arch_config['download_url'], :ssl_ca_cert => CA_CERT_PATH)
@@ -82,11 +82,11 @@ def install
82
82
  installation_failed 'Aborting installation, libappsignal not found'
83
83
  elsif !find_executable('appsignal-agent', EXT_PATH)
84
84
  installation_failed 'Aborting installation, appsignal-agent not found'
85
- elsif !find_header('appsignal_extension.h', EXT_PATH)
86
- installation_failed 'Aborting installation, appsignal_extension.h not found'
85
+ elsif !find_header('appsignal.h', EXT_PATH)
86
+ installation_failed 'Aborting installation, appsignal.h not found'
87
87
  else
88
88
  create_makefile 'appsignal_extension'
89
- logger.info 'Successfully installed appsignal extension'
89
+ logger.info 'Successfully created Makefile for appsignal extension'
90
90
  end
91
91
  rescue => ex
92
92
  installation_failed "Exception while installing: #{ex}"
@@ -235,26 +235,22 @@ module Appsignal
235
235
  end
236
236
 
237
237
  def log_formatter
238
- proc do |severity, datetime, progname, msg|
239
- "[#{datetime.strftime('%Y-%m-%dT%H:%M:%S')} (process) ##{Process.pid}][#{severity}] #{msg}\n"
240
- end
238
+ proc do |severity, datetime, progname, msg|
239
+ "[#{datetime.strftime('%Y-%m-%dT%H:%M:%S')} (process) ##{Process.pid}][#{severity}] #{msg}\n"
240
+ end
241
241
  end
242
242
 
243
243
  def start_logger(path_arg=nil)
244
244
  path = Appsignal.config ? Appsignal.config.log_file_path : nil
245
- if path && !heroku?
246
- begin
247
- @logger = Logger.new(path)
248
- @logger.formatter = log_formatter
249
- rescue SystemCallError => error
250
- start_stdout_logger
251
- logger.warn "appsignal: Unable to start logger with log path '#{path}'."
252
- logger.warn "appsignal: #{error}"
253
- end
245
+ if path && !ENV['DYNO']
246
+ @logger = Logger.new(path)
247
+ @logger.formatter = log_formatter
254
248
  else
255
- start_stdout_logger
249
+ @logger = Logger.new($stdout)
250
+ @logger.formatter = lambda do |severity, datetime, progname, msg|
251
+ "appsignal: #{msg}\n"
252
+ end
256
253
  end
257
-
258
254
  if config && config[:debug]
259
255
  @logger.level = Logger::DEBUG
260
256
  else
@@ -296,19 +292,6 @@ module Appsignal
296
292
  ensure
297
293
  Appsignal::Transaction.current.resume! if Appsignal::Transaction.current
298
294
  end
299
-
300
- private
301
-
302
- def start_stdout_logger
303
- @logger = Logger.new($stdout)
304
- @logger.formatter = lambda do |severity, datetime, progname, msg|
305
- "appsignal: #{msg}\n"
306
- end
307
- end
308
-
309
- def heroku?
310
- ENV['DYNO']
311
- end
312
295
  end
313
296
  end
314
297
 
@@ -26,7 +26,6 @@ module Appsignal
26
26
 
27
27
  def config
28
28
  start_appsignal
29
- puts "Environment: #{Appsignal.config.env}"
30
29
  Appsignal.config.config_hash.each do |key, val|
31
30
  puts "Config #{key}: #{val}"
32
31
  end
@@ -61,12 +60,12 @@ module Appsignal
61
60
  def check_ext_install
62
61
  require 'bundler/cli'
63
62
  require "bundler/cli/common"
64
- path = Bundler::CLI::Common.select_spec('appsignal').full_gem_path.strip
65
- install_log_path = "#{path}/ext/install.log"
63
+ path = Bundler::CLI::Common.select_spec('appsignal').full_gem_path
64
+ install_log_path = "#{path.strip}/ext/install.log"
66
65
  puts "Showing last lines of extension install log: #{install_log_path}"
67
66
  puts File.read(install_log_path)
68
67
  puts "\n"
69
- mkmf_log_path = "#{path}/ext/mkmf.log"
68
+ mkmf_log_path = "#{path.strip}/ext/mkmf.log"
70
69
  if File.exist?(mkmf_log_path)
71
70
  puts "Showing last lines of extension compilation log: #{mkmf_log_path}"
72
71
  puts File.read(mkmf_log_path)
@@ -93,6 +93,11 @@ module Appsignal
93
93
  puts
94
94
  puts " require 'appsignal/integrations/sinatra'"
95
95
  press_any_key
96
+ puts "Configure subclass apps"
97
+ puts " If your app is a subclass of Sinatra::Base you need to use this middleware:"
98
+ puts
99
+ puts " use Appsignal::Rack::SinatraInstrumentation"
100
+ press_any_key
96
101
  done_notice
97
102
  end
98
103
 
@@ -131,21 +136,6 @@ module Appsignal
131
136
  done_notice
132
137
  end
133
138
 
134
- def install_for_capistrano
135
- capfile = File.join(Dir.pwd, 'Capfile')
136
- return unless File.exist?(capfile)
137
- return if File.read(capfile) =~ %r{require ['|"]appsignal/capistrano}
138
-
139
- puts 'Installing for Capistrano'
140
- print ' Adding AppSignal integration to Capfile'
141
- File.open(capfile, 'a') do |f|
142
- f.write "\nrequire 'appsignal/capistrano'\n"
143
- end
144
- periods
145
- puts
146
- puts
147
- end
148
-
149
139
  def colorize(text, color)
150
140
  return text if Gem.win_platform?
151
141
  color_code = case color
@@ -197,7 +187,16 @@ module Appsignal
197
187
  end
198
188
 
199
189
  def configure(config, environments, name_overwritten)
200
- install_for_capistrano
190
+ deploy_rb_file = File.join(Dir.pwd, 'config/deploy.rb')
191
+ if File.exist?(deploy_rb_file) && (File.read(deploy_rb_file) =~ /require (\'|\").\/appsignal\/capistrano/).nil?
192
+ print 'Adding AppSignal integration to deploy.rb'
193
+ File.open(deploy_rb_file, 'a') do |f|
194
+ f.write "\nrequire 'appsignal/capistrano'\n"
195
+ end
196
+ periods
197
+ puts
198
+ puts
199
+ end
201
200
 
202
201
  puts "How do you want to configure AppSignal?"
203
202
  puts " (1) a config file"
@@ -5,7 +5,6 @@ require 'socket'
5
5
 
6
6
  module Appsignal
7
7
  class Config
8
- SYSTEM_TMP_DIR = '/tmp'
9
8
  DEFAULT_CONFIG = {
10
9
  :debug => false,
11
10
  :ignore_errors => [],
@@ -24,8 +23,7 @@ module Appsignal
24
23
  :running_in_container => false,
25
24
  :enable_host_metrics => true,
26
25
  :enable_minutely_probes => false,
27
- :hostname => ::Socket.gethostname,
28
- :ca_file_path => File.expand_path(File.join('../../../resources/cacert.pem'), __FILE__)
26
+ :hostname => ::Socket.gethostname
29
27
  }.freeze
30
28
 
31
29
  ENV_TO_KEY_MAPPING = {
@@ -52,8 +50,7 @@ module Appsignal
52
50
  'APPSIGNAL_WORKING_DIR_PATH' => :working_dir_path,
53
51
  'APPSIGNAL_ENABLE_HOST_METRICS' => :enable_host_metrics,
54
52
  'APPSIGNAL_ENABLE_MINUTELY_PROBES' => :enable_minutely_probes,
55
- 'APPSIGNAL_HOSTNAME' => :hostname,
56
- 'APPSIGNAL_CA_FILE_PATH' => :ca_file_path
53
+ 'APPSIGNAL_HOSTNAME' => :hostname
57
54
  }.freeze
58
55
 
59
56
  attr_reader :root_path, :env, :initial_config, :config_hash
@@ -92,19 +89,12 @@ module Appsignal
92
89
  def log_file_path
93
90
  path = config_hash[:log_path] || root_path
94
91
  if path && File.writable?(path)
95
- return File.join(File.realpath(path), 'appsignal.log')
96
- end
97
-
98
- if File.writable? SYSTEM_TMP_DIR
99
- $stdout.puts "appsignal: Unable to log to '#{path}'. Logging to "\
100
- "'#{SYSTEM_TMP_DIR}' instead. Please check the "\
101
- "permissions for the application's log directory."
102
- File.join(SYSTEM_TMP_DIR, 'appsignal.log')
92
+ File.join(File.realpath(path), 'appsignal.log')
103
93
  else
104
- $stdout.puts "appsignal: Unable to log to '#{path}' or the "\
105
- "'#{SYSTEM_TMP_DIR}' fallback. Please check the permissions "\
106
- "for the application's (log) directory."
94
+ '/tmp/appsignal.log'
107
95
  end
96
+ rescue Errno::ENOENT
97
+ '/tmp/appsignal.log'
108
98
  end
109
99
 
110
100
  def valid?
@@ -137,7 +127,6 @@ module Appsignal
137
127
  ENV['APPSIGNAL_ENABLE_MINUTELY_PROBES'] = config_hash[:enable_minutely_probes].to_s
138
128
  ENV['APPSIGNAL_HOSTNAME'] = config_hash[:hostname].to_s
139
129
  ENV['APPSIGNAL_PROCESS_NAME'] = $0
140
- ENV['APPSIGNAL_CA_FILE_PATH'] = config_hash[:ca_file_path].to_s
141
130
  end
142
131
 
143
132
  protected
@@ -186,7 +175,7 @@ module Appsignal
186
175
  # Configuration with string type
187
176
  %w(APPSIGNAL_PUSH_API_KEY APPSIGNAL_APP_NAME APPSIGNAL_PUSH_API_ENDPOINT
188
177
  APPSIGNAL_FRONTEND_ERROR_CATCHING_PATH APPSIGNAL_HTTP_PROXY APPSIGNAL_LOG_PATH
189
- APPSIGNAL_WORKING_DIR_PATH APPSIGNAL_HOSTNAME APPSIGNAL_CA_FILE_PATH).each do |var|
178
+ APPSIGNAL_WORKING_DIR_PATH APPSIGNAL_HOSTNAME).each do |var|
190
179
  if env_var = ENV[var]
191
180
  config[ENV_TO_KEY_MAPPING[var]] = env_var
192
181
  end
@@ -46,7 +46,7 @@ module Appsignal
46
46
  else
47
47
  raise "#{f} does not have a format(payload) method"
48
48
  end
49
- rescue => ex
49
+ rescue Exception => ex
50
50
  formatter_classes.delete(name)
51
51
  formatters.delete(name)
52
52
  Appsignal.logger.debug("'#{ex.message}' when initializing #{name} event formatter")
@@ -20,7 +20,7 @@ namespace :appsignal do
20
20
  marker = Appsignal::Marker.new(marker_data, appsignal_config)
21
21
  marker.transmit
22
22
  else
23
- puts "Not notifying of deploy, config is not active for environment: #{env}"
23
+ puts 'Not notifying of deploy, config is not active'
24
24
  end
25
25
  end
26
26
  end
@@ -7,7 +7,7 @@ module Appsignal
7
7
 
8
8
  namespace :appsignal do
9
9
  task :deploy do
10
- env = fetch(:appsignal_env, fetch(:stage, fetch(:rails_env, fetch(:rack_env, 'production'))))
10
+ env = fetch(:rails_env, fetch(:rack_env, 'production'))
11
11
  user = ENV['USER'] || ENV['USERNAME']
12
12
  revision = fetch(:appsignal_revision, fetch(:current_revision))
13
13
 
@@ -31,7 +31,7 @@ module Appsignal
31
31
  marker.transmit
32
32
  end
33
33
  else
34
- puts "Not notifying of deploy, config is not active for environment: #{env}"
34
+ puts 'Not notifying of deploy, config is not active'
35
35
  end
36
36
  end
37
37
  end
@@ -2,24 +2,24 @@ class Object
2
2
  def self.appsignal_instrument_class_method(method_name, options = {})
3
3
  singleton_class.send \
4
4
  :alias_method, "appsignal_uninstrumented_#{method_name}", method_name
5
- singleton_class.send(:define_method, method_name) do |*args, &block|
5
+ singleton_class.send(:define_method, method_name) do |*args|
6
6
  name = options.fetch(:name) do
7
7
  "#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
8
8
  end
9
9
  Appsignal.instrument name do
10
- send "appsignal_uninstrumented_#{method_name}", *args, &block
10
+ send "appsignal_uninstrumented_#{method_name}", *args
11
11
  end
12
12
  end
13
13
  end
14
14
 
15
15
  def self.appsignal_instrument_method(method_name, options = {})
16
16
  alias_method "appsignal_uninstrumented_#{method_name}", method_name
17
- define_method method_name do |*args, &block|
17
+ define_method method_name do |*args|
18
18
  name = options.fetch(:name) do
19
19
  "#{method_name}.#{appsignal_reverse_class_name}.other"
20
20
  end
21
21
  Appsignal.instrument name do
22
- send "appsignal_uninstrumented_#{method_name}", *args, &block
22
+ send "appsignal_uninstrumented_#{method_name}", *args
23
23
  end
24
24
  end
25
25
  end