appsignal 1.4.0.beta.1 → 2.0.0.beta.1

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
  SHA1:
3
- metadata.gz: 596cead7e715bf92192c49a6a74a452836a72d2e
4
- data.tar.gz: 08bbd29e1f602c14aaaf934284ab37f084d0879e
3
+ metadata.gz: 8bd8b67588b72996acb6016ff9a28589ab689b5a
4
+ data.tar.gz: e0ec44916657760600ecf1651c155357c1e67ecf
5
5
  SHA512:
6
- metadata.gz: 303d79b2ba2a59165230a1462c53bc2e259438055319ce505d3b007a3825d8ddbcc2d9a78a3d1d77631e35ef425916fb412df085296cfe1ed22eb609444665d2
7
- data.tar.gz: d95b49731fe7838487773f772b02a2c8da3d687df4be19e95b4c52d19c36090afba4c3b85bf7a4fd21ccd10f3ee1ddcfc2a7fd9cf10b301626463881ade5a0f6
6
+ metadata.gz: 42daf7247c1e35d895d639f3a783ffc607bd546a982e5538bbbbb19f946a01d102eee6c34e8dd409488428df3c4daf4df88f92eb2982de14c2c0a4fea1faef47
7
+ data.tar.gz: 500b07c6fb90f6d01320ee14ecad8c1d43cf9182b1bec88b92dbc7b55c1992ab503834930e52720d7665503b13025546e9b3564776e8ff7eaffff956aed2fb43
@@ -1,22 +1,45 @@
1
- # 1.4.0
2
- * Add Appsignal.instrument_sql convenience methods
3
- * Use Appsignal.instrument internally instead of AS instrument
4
- * Override AS instrument instead of subscribing
5
- * Use have_library to link libappsignal
6
- * Refactor rescueing of exceptions
7
- * Use GC::Profiler to track garbage collection time
8
- * Recognize wether we're running in container
9
- * Change load order to set system config first
10
- * Remove unused config method
1
+ # 2.0.0
2
+ * Add `Appsignal.instrument_sql` convenience methods. PR #136
3
+ * Use `Appsignal.instrument` internally instead of ActiveSupport
4
+ instrumentation. PR #142
5
+ * Override ActiveSupport instrument instead of subscribing. PR #150
6
+ * Remove required dependency on ActiveSupport. Recommended you use
7
+ `Appsignal.instrument` if you don't need `ActiveSupport`. PR #150 #142
8
+ * Use have_library to link the AppSignal extension `libappsignal`. PR #148
9
+ * Rename `appsignal_extension.h` to `appsignal.h`.
10
+ Commit 9ed7c8d83f622d5a79c5c21d352b3360fd7e8113
11
+ * Refactor rescuing of Exception. PR #173
12
+ * Use GC::Profiler to track garbage collection time. PR #134
13
+ * Detect if AppSignal is running in a container or Heroku. PR #177 #178
14
+ * Change configuration load order to load environment settings after
15
+ `appsignal.yml`. PR #178
16
+ * Speed up payload generation by letting the extension handle it. PR #175
17
+ * Improve `appsignal diagnose` formatting and output more data. PR #187
18
+ * Remove outdated `appsignal:diagnose` rake tasks. Use `appsignal diagnose`
19
+ instead. PR #193
20
+ * Fix JavaScript exception without names resulting in errors themselves. PR #188
21
+ * Support namespaces in Grape routes. PR #189
22
+ * Change STDOUT output to always mention "AppSignal", not "Appsignal". PR #192
23
+ * `appsignal notify_of_deploy` refactor. `--name` will override any
24
+ other `name` config. `--environment` is only required if it's not set in the
25
+ environment. PR #194
26
+ * Allow logging to STDOUT. Available for the Ruby gem and C extension. The
27
+ `appsignal-agent` process will continue log to file. PR #190
28
+ * Remove deprecated methods. PR #191
29
+ * Send "ruby" implementation name with version number for better identifying
30
+ different language implementations. PR #198
11
31
 
12
32
  # 1.3.6
13
- * Support blocks arguments on method instrumentation
14
- * Support `APPSIGNAL_APP_ENV` for Sinatra
15
- * Minor improvements to installer
16
- * More robust handing of non-writable log files
17
- * Cleaner internal exception handling
18
- * Support for mixed case keywords in sql lexing
19
- * Support for inserting multiple rows in sql lexing
33
+ * Support blocks arguments on method instrumentation. PR #163
34
+ * Support `APPSIGNAL_APP_ENV` for Sinatra. PR #164
35
+ * Remove Sinatra install step from "appsignal install". PR #165
36
+ * Install Capistrano integration in `Capfile` instead of `deploy.rb`. #166
37
+ * More robust handing of non-writable log files. PR #160 #158
38
+ * Cleaner internal exception handling. PR #169 #170 #171 #172 #173
39
+ * Support for mixed case keywords in sql lexing. appsignal/sql_lexer#8
40
+ * Support for inserting multiple rows in sql lexing. appsignal/sql_lexer#9
41
+ * Add session_overview to JS transaction data.
42
+ Commit af2d365bc124c01d7e9363e8d825404027835765
20
43
 
21
44
  # 1.3.5
22
45
 
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
- AppSignal agent
2
- =================
1
+ # AppSignal agent
3
2
 
4
- This gem collects error and performance data from your Rails
5
- applications and sends it to [AppSignal](https://appsignal.com)
3
+ This gem collects error and performance data from your Ruby
4
+ applications and sends it to [AppSignal](https://appsignal.com).
5
+
6
+ - [Documentation](http://docs.appsignal.com/)
6
7
 
7
8
  [![Build Status](https://travis-ci.org/appsignal/appsignal-ruby.png?branch=master)](https://travis-ci.org/appsignal/appsignal-ruby)
8
9
  [![Gem Version](https://badge.fury.io/rb/appsignal.svg)](http://badge.fury.io/rb/appsignal)
@@ -43,7 +44,7 @@ If you have either Rvm or Rbenv installed you can also use
43
44
  `rake generate_bundle_and_spec_all` to generate a script that runs specs for
44
45
  all Ruby versions and gem combinations we support.
45
46
 
46
- On Travis we run the suite against all of the Gemfiles mentioned above and on
47
+ We run the suite against all of the Gemfiles mentioned above and on
47
48
  a number of different Ruby versions.
48
49
 
49
50
  ## Branches and versions
@@ -1,18 +1,18 @@
1
1
  ---
2
- version: 61c23ea
2
+ version: f727d42
3
3
  triples:
4
4
  x86_64-linux:
5
- checksum: 6a0a1ebf6a1a9c7d2ac939f9077fd279155359ed72c74284d70daf0f53b27b10
6
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/61c23ea/appsignal-x86_64-linux-all-static.tar.gz
5
+ checksum: 9dd455ca74b1785b3e84b8c76f8e1c111a5f0c46395952521a092dee4e2990cf
6
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f727d42/appsignal-x86_64-linux-all-static.tar.gz
7
7
  i686-linux:
8
- checksum: 498e11631eae3418a55a733ac13b993c35afb782be9fb5c4e5b6be0f52f4f76c
9
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/61c23ea/appsignal-i686-linux-all-static.tar.gz
8
+ checksum: 9404f8af277271d67f82fc6b4662b8c41a06c49199673a419d4ef89e154bc3e7
9
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f727d42/appsignal-i686-linux-all-static.tar.gz
10
10
  x86-linux:
11
- checksum: 498e11631eae3418a55a733ac13b993c35afb782be9fb5c4e5b6be0f52f4f76c
12
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/61c23ea/appsignal-i686-linux-all-static.tar.gz
11
+ checksum: 9404f8af277271d67f82fc6b4662b8c41a06c49199673a419d4ef89e154bc3e7
12
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f727d42/appsignal-i686-linux-all-static.tar.gz
13
13
  x86_64-darwin:
14
- checksum: 62a6ffc8d379bcba0cf7e48f92690b62ffacee81f3e996ace215f56eb03d2be6
15
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/61c23ea/appsignal-x86_64-darwin-all-static.tar.gz
14
+ checksum: feba9c23da6a7121679c992f5c542fe22e39e83985870c4f6f69e5841c0afeb8
15
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f727d42/appsignal-x86_64-darwin-all-static.tar.gz
16
16
  universal-darwin:
17
- checksum: 62a6ffc8d379bcba0cf7e48f92690b62ffacee81f3e996ace215f56eb03d2be6
18
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/61c23ea/appsignal-x86_64-darwin-all-static.tar.gz
17
+ checksum: feba9c23da6a7121679c992f5c542fe22e39e83985870c4f6f69e5841c0afeb8
18
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f727d42/appsignal-x86_64-darwin-all-static.tar.gz
@@ -236,33 +236,26 @@ module Appsignal
236
236
  end
237
237
  end
238
238
 
239
- def start_logger(path_arg=nil)
240
- path = Appsignal.config ? Appsignal.config.log_file_path : nil
241
- if path && !Appsignal::System.heroku?
242
- begin
243
- @logger = Logger.new(path)
244
- @logger.formatter = log_formatter
245
- rescue SystemCallError => error
246
- start_stdout_logger
247
- logger.warn "appsignal: Unable to start logger with log path '#{path}'."
248
- logger.warn "appsignal: #{error}"
249
- end
239
+ def start_logger(path_arg = nil)
240
+ if config && config[:log] == "file" && config.log_file_path
241
+ start_file_logger(config.log_file_path)
250
242
  else
251
243
  start_stdout_logger
252
244
  end
253
245
 
254
- if config && config[:debug]
255
- @logger.level = Logger::DEBUG
256
- else
257
- @logger.level = Logger::INFO
258
- end
246
+ logger.level =
247
+ if config && config[:debug]
248
+ Logger::DEBUG
249
+ else
250
+ Logger::INFO
251
+ end
259
252
 
260
253
  if in_memory_log
261
- @logger << in_memory_log.string
254
+ logger << in_memory_log.string
262
255
  end
263
256
 
264
257
  if path_arg
265
- @logger.info('Setting the path in start_logger has no effect anymore, set it in the config instead')
258
+ logger.info('Setting the path in start_logger has no effect anymore, set it in the config instead')
266
259
  end
267
260
  end
268
261
 
@@ -301,6 +294,15 @@ module Appsignal
301
294
  "appsignal: #{msg}\n"
302
295
  end
303
296
  end
297
+
298
+ def start_file_logger(path)
299
+ @logger = Logger.new(path)
300
+ @logger.formatter = log_formatter
301
+ rescue SystemCallError => error
302
+ start_stdout_logger
303
+ logger.warn "appsignal: Unable to start logger with log path '#{path}'."
304
+ logger.warn "appsignal: #{error}"
305
+ end
304
306
  end
305
307
  end
306
308
 
@@ -312,7 +314,6 @@ require 'appsignal/event_formatter'
312
314
  require 'appsignal/hooks'
313
315
  require 'appsignal/marker'
314
316
  require 'appsignal/minutely'
315
- require 'appsignal/params_sanitizer'
316
317
  require 'appsignal/garbage_collection_profiler'
317
318
  require 'appsignal/integrations/railtie' if defined?(::Rails)
318
319
  require 'appsignal/integrations/resque'
@@ -11,12 +11,10 @@ module Appsignal
11
11
  AVAILABLE_COMMANDS = %w(diagnose install notify_of_deploy).freeze
12
12
 
13
13
  class << self
14
- attr_accessor :options, :initial_config
15
- attr_writer :config
14
+ attr_accessor :options
16
15
 
17
16
  def run(argv=ARGV)
18
17
  @options = {}
19
- @initial_config = {}
20
18
  global = global_option_parser
21
19
  commands = command_option_parser
22
20
  global.order!(argv)
@@ -30,7 +28,7 @@ module Appsignal
30
28
  when :install
31
29
  Appsignal::CLI::Install.run(argv.shift, config)
32
30
  when :notify_of_deploy
33
- Appsignal::CLI::NotifyOfDeploy.run(options, config)
31
+ Appsignal::CLI::NotifyOfDeploy.run(options)
34
32
  end
35
33
  else
36
34
  puts "Command '#{command}' does not exist, run appsignal -h to "\
@@ -48,7 +46,7 @@ module Appsignal
48
46
  Appsignal::Config.new(
49
47
  Dir.pwd,
50
48
  options[:environment],
51
- initial_config,
49
+ {},
52
50
  Logger.new(StringIO.new)
53
51
  )
54
52
  end
@@ -58,7 +56,7 @@ module Appsignal
58
56
  o.banner = 'Usage: appsignal <command> [options]'
59
57
 
60
58
  o.on '-v', '--version', "Print version and exit" do |arg|
61
- puts "Appsignal #{Appsignal::VERSION}"
59
+ puts "AppSignal #{Appsignal::VERSION}"
62
60
  exit(0)
63
61
  end
64
62
 
@@ -92,7 +90,7 @@ module Appsignal
92
90
  end
93
91
 
94
92
  o.on '--name=<name>', "The name of the app (optional)" do |arg|
95
- initial_config[:name] = arg
93
+ options[:name] = arg
96
94
  end
97
95
  end
98
96
  }
@@ -1,80 +1,172 @@
1
+ require "rbconfig"
2
+ require "bundler/cli"
3
+ require "bundler/cli/common"
4
+
1
5
  module Appsignal
2
6
  class CLI
3
7
  class Diagnose
4
8
  class << self
5
9
  def run
6
- gem_version
10
+ header
11
+ empty_line
12
+
7
13
  agent_version
14
+ empty_line
15
+
16
+ host_information
17
+ empty_line
18
+
8
19
  start_appsignal
9
20
  config
21
+ empty_line
22
+
10
23
  check_api_key
24
+ empty_line
25
+
11
26
  paths_writable
12
- check_ext_install
13
- end
27
+ empty_line
14
28
 
15
- def gem_version
16
- puts "Gem version: #{Appsignal::VERSION}"
29
+ log_files
17
30
  end
18
31
 
19
- def agent_version
20
- puts "Agent version: #{Appsignal::Extension.agent_version}"
32
+ private
33
+
34
+ def empty_line
35
+ puts "\n"
21
36
  end
22
37
 
23
38
  def start_appsignal
24
39
  Appsignal.start
40
+ return if config?
41
+
42
+ puts "Error: No config found!"
43
+ puts "Could not start AppSignal."
44
+ end
45
+
46
+ def header
47
+ puts "AppSignal diagnose"
48
+ puts "=" * 80
49
+ puts "Use this information to debug your configuration."
50
+ puts "More information is available on the documentation site."
51
+ puts "http://docs.appsignal.com/"
52
+ puts "Send this output to support@appsignal.com if you need help."
53
+ puts "=" * 80
54
+ end
55
+
56
+ def agent_version
57
+ puts "AppSignal agent"
58
+ puts " Gem version: #{Appsignal::VERSION}"
59
+ puts " Agent version: #{Appsignal::Extension.agent_version}"
60
+ puts " Gem install path: #{gem_path}"
61
+ end
62
+
63
+ def host_information
64
+ rbconfig = RbConfig::CONFIG
65
+ puts "Host information"
66
+ puts " Architecture: #{rbconfig["host_cpu"]}"
67
+ puts " Operating System: #{rbconfig["host_os"]}"
68
+ puts " Ruby version: #{rbconfig["RUBY_VERSION_NAME"]}"
69
+ puts " Heroku: true" if Appsignal::System.heroku?
70
+ if Appsignal::System.container?
71
+ puts " Container id: #{Appsignal::System::Container.id}"
72
+ end
25
73
  end
26
74
 
27
75
  def config
28
- start_appsignal
29
- puts "Environment: #{Appsignal.config.env}"
30
- Appsignal.config.config_hash.each do |key, val|
31
- puts "Config #{key}: #{val}"
76
+ puts "Configuration"
77
+ return unless config?
78
+ environment
79
+
80
+ Appsignal.config.config_hash.each do |key, value|
81
+ puts " #{key}: #{value}"
82
+ end
83
+ end
84
+
85
+ def environment
86
+ env = Appsignal.config.env
87
+ puts " Environment: #{env}"
88
+ if env == ""
89
+ puts " Warning: No environment set, no config loaded!"
90
+ puts " Please make sure appsignal diagnose is run within your "
91
+ puts " project directory with an environment."
92
+ puts " APPSIGNAL_APP_ENV=production appsignal diagnose"
32
93
  end
33
94
  end
34
95
 
35
96
  def paths_writable
36
- start_appsignal
37
- possible_paths = [
38
- Appsignal.config.root_path,
39
- Appsignal.config.log_file_path
40
- ]
41
-
42
- puts "Checking if required paths are writable:"
43
- possible_paths.each do |path|
44
- result = File.writable?(path) ? 'Ok' : 'Failed'
45
- puts "#{path} ...#{result}"
97
+ puts "Required paths"
98
+ return unless config?
99
+
100
+ possible_paths = {
101
+ :root_path => Appsignal.config.root_path,
102
+ :log_file_path => Appsignal.config.log_file_path
103
+ }
104
+
105
+ possible_paths.each do |name, path|
106
+ result = "Not writable"
107
+ if path
108
+ if !File.exist? path
109
+ result = "Does not exist"
110
+ elsif File.writable? path
111
+ result = "Writable"
112
+ end
113
+ end
114
+ puts " #{name}: #{path.to_s.inspect} - #{result}"
46
115
  end
47
- puts "\n"
48
116
  end
49
117
 
50
118
  def check_api_key
51
- start_appsignal
52
119
  auth_check = ::Appsignal::AuthCheck.new(Appsignal.config, Appsignal.logger)
53
- status, _ = auth_check.perform_with_result
54
- if status == '200'
55
- puts "Checking API key: Ok"
120
+ print "Validating API key: "
121
+ status, error = auth_check.perform_with_result
122
+ case status
123
+ when "200"
124
+ print "Valid"
125
+ when "401"
126
+ print "Invalid"
56
127
  else
57
- puts "Checking API key: Failed"
128
+ print "Failed with status #{status}\n"
129
+ puts error if error
58
130
  end
131
+ empty_line
59
132
  end
60
133
 
61
- def check_ext_install
62
- require 'bundler/cli'
63
- require "bundler/cli/common"
64
- path = Bundler::CLI::Common.select_spec('appsignal').full_gem_path.strip
65
- install_log_path = "#{path}/ext/install.log"
66
- puts "Showing last lines of extension install log: #{install_log_path}"
67
- puts File.read(install_log_path)
68
- puts "\n"
69
- mkmf_log_path = "#{path}/ext/mkmf.log"
70
- if File.exist?(mkmf_log_path)
71
- puts "Showing last lines of extension compilation log: #{mkmf_log_path}"
72
- puts File.read(mkmf_log_path)
73
- puts "\n"
134
+ def log_files
135
+ install_log
136
+ empty_line
137
+ mkmf_log
138
+ end
139
+
140
+ def install_log
141
+ install_log_path = File.join(gem_path, "ext", "install.log")
142
+ puts "Extension install log"
143
+ output_log_file install_log_path
144
+ end
145
+
146
+ def mkmf_log
147
+ mkmf_log_path = File.join(gem_path, "ext", "mkmf.log")
148
+ puts "Makefile install log"
149
+ output_log_file mkmf_log_path
150
+ end
151
+
152
+ def output_log_file(log_file)
153
+ puts " Path: #{log_file.to_s.inspect}"
154
+ if File.exist? log_file
155
+ puts " Contents:"
156
+ puts File.read(log_file)
74
157
  else
75
- puts "#{mkmf_log_path} not present"
158
+ puts " File not found."
76
159
  end
77
160
  end
161
+
162
+ def gem_path
163
+ @gem_path ||= \
164
+ Bundler::CLI::Common.select_spec("appsignal").full_gem_path.strip
165
+ end
166
+
167
+ def config?
168
+ Appsignal.config
169
+ end
78
170
  end
79
171
  end
80
172
  end