errplane 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmY2Y2IwOTFhYmRhYTRmNWFjNjhkMjljNGU4Yjc0ZDRmZWRmYTk1Yg==
4
+ YmJlM2RlNmMwMTc5OWJkNjMzZThlY2FiNTVlMzU0M2I2Y2Q1YWFkNQ==
5
5
  data.tar.gz: !binary |-
6
- Y2ZiYmM2MzVkYjY1ODBlZGJkZmQ4NDg0OGE3YTI1MmU4Y2RiNDM3Mw==
6
+ ZmMyNTNkNmRhZDliZWI2NzI0NjgzNDM1MGU2OTJiYmY0OTM1NWNjNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODE0NWJkM2YyOGE5ZDk3MWQzOTk1NzYyNDdiYzA0MTM1Y2VlNTI3NjEyMDU0
10
- YzNmM2Q3N2ZjOWE3NGUwZTY3ZTE0YjliMGE2YzZjNzhlNmFkOGVjZDM1NWY1
11
- N2MyODk3ZGI2ZWM2Y2I2MzFlYTU1ZTdhMTQyMzA5NWFkNGZiZjE=
9
+ NWNiNWZhMzUxZTQ2ZDcwZGZlM2Q5ZjQwM2QzMWY3M2ZkNmQxYmM4ZGUwMTA0
10
+ MWMzNTg3MmQ3MjljMjQ3ZTkxM2UzZjEzMjFiYmNjMzU4YzZjMWJiODAxYmI0
11
+ ZWNhYWI2OGUzOTgyZmU5YmU2MGYyMTNkMjkxNTY2MWI4MzViMTQ=
12
12
  data.tar.gz: !binary |-
13
- NTk3ODdkNjAzN2YwYjgwM2I5MWY5ZWNhYzI0NjZmMDYxMjZiOGFjN2FmM2Rj
14
- ODRjNzVlN2FlYTY3ODQ4MjEwNDE0ODliODczZTdjMmZiZWIzNDQ5Y2U3OGY3
15
- NTI5MzlmNjI3N2FiZDE2MmI3OTA0MzlmYmYyMmRiNjZhMjAzNGM=
13
+ OTlmMjc0ODEwMzdiZmRkMWQ5ZWM5ZTg0MzVlNWU1NjdhMmZiODIzY2ZhMjhi
14
+ MGNjNDAyZDJlOWM3MjU1MWM4ZWRjZGI4ZGU2MDQzMDdhZmExZGM1ZThmZTgy
15
+ NTgzNjUwMzQzMjI2YWM3MGE1NTZhOTY2ZWMxYzdhOWE0MmZmYTY=
data/Gemfile.lock CHANGED
@@ -1,56 +1,14 @@
1
- PATH
2
- remote: .
3
- specs:
4
- errplane (1.0.6)
5
- json
6
-
7
1
  GEM
8
2
  remote: https://rubygems.org/
9
3
  specs:
10
- coderay (1.0.8)
11
- diff-lcs (1.1.3)
12
- fakeweb (1.3.0)
13
- guard (1.5.4)
14
- listen (>= 0.4.2)
15
- lumberjack (>= 1.0.2)
16
- pry (>= 0.9.10)
17
- thor (>= 0.14.6)
18
- guard-rspec (2.3.1)
19
- guard (>= 1.1)
20
- rspec (~> 2.11)
21
- json (1.7.5)
22
- listen (0.6.0)
23
- lumberjack (1.0.2)
24
- method_source (0.8.1)
25
- pry (0.9.10)
26
- coderay (~> 1.0.5)
27
- method_source (~> 0.8)
28
- slop (~> 3.3.1)
29
- rake (10.0.2)
30
- rdoc (3.12)
31
- json (~> 1.4)
32
- rspec (2.12.0)
33
- rspec-core (~> 2.12.0)
34
- rspec-expectations (~> 2.12.0)
35
- rspec-mocks (~> 2.12.0)
36
- rspec-core (2.12.1)
37
- rspec-expectations (2.12.0)
38
- diff-lcs (~> 1.1.3)
39
- rspec-mocks (2.12.0)
40
- slop (3.3.3)
41
- thor (0.16.0)
42
- tzinfo (0.3.35)
4
+ errplane (1.0.8)
5
+ json
6
+ json (1.8.0)
7
+ rack (1.5.2)
43
8
 
44
9
  PLATFORMS
45
10
  ruby
46
11
 
47
12
  DEPENDENCIES
48
- bundler (>= 1.0.0)
49
- errplane!
50
- fakeweb
51
- guard
52
- guard-rspec
53
- rake
54
- rdoc
55
- rspec
56
- tzinfo
13
+ errplane
14
+ rack
data/lib/errplane/api.rb CHANGED
@@ -4,10 +4,6 @@ module Errplane
4
4
 
5
5
  attr_reader :last_response
6
6
 
7
- HTTPS_HOST = "w.apiv3.errplane.com"
8
- UDP_HOST = "udp.apiv3.errplane.com"
9
- UDP_PORT = 8126
10
-
11
7
  POST_RETRIES = 5
12
8
  READ_TIMEOUT = 3
13
9
  OPEN_TIMEOUT = 3
@@ -60,7 +56,7 @@ module Errplane
60
56
  log :debug, "Sending UDP Packet: #{packet.to_json}"
61
57
 
62
58
  begin
63
- udp_socket.send packet.to_json, 0, UDP_HOST, UDP_PORT
59
+ udp_socket.send packet.to_json, 0, Errplane.configuration.api_udp_host, Errplane.configuration.api_udp_port
64
60
  rescue => e
65
61
  log :error, "Failed to send data via UDP. Check your network settings and available file descriptors. #{e.class}: #{e.message}"
66
62
  end
@@ -79,7 +75,7 @@ module Errplane
79
75
  end
80
76
 
81
77
  def initialize_secure_connection
82
- connection = Net::HTTP.new(HTTPS_HOST, 443)
78
+ connection = Net::HTTP.new(Errplane.configuration.api_http_write_host, 443)
83
79
  connection.use_ssl = true
84
80
  connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
85
81
  connection.read_timeout = READ_TIMEOUT
@@ -1,8 +1,10 @@
1
1
  module Errplane
2
2
  class Configuration
3
3
  attr_accessor :api_key
4
- attr_accessor :api_host
5
- attr_accessor :api_host_port
4
+ attr_accessor :api_udp_host
5
+ attr_accessor :api_udp_port
6
+ attr_accessor :api_http_read_host
7
+ attr_accessor :api_http_write_host
6
8
  attr_accessor :app_host
7
9
  attr_accessor :application_id
8
10
  attr_accessor :application_name
@@ -34,10 +36,13 @@ module Errplane
34
36
  attr_accessor :queue_maximum_post
35
37
 
36
38
  DEFAULTS = {
37
- :api_host => "apiv2.errplane.com",
38
39
  :app_host => "app.errplane.com",
40
+ :api_udp_host => "udp.apiv3.errplane.com",
41
+ :api_udp_port => 8126,
42
+ :api_http_read_host => "r.apiv3.errplane.com",
43
+ :api_http_write_host => "w.apiv3.errplane.com",
39
44
  :ignored_exceptions => %w{ActiveRecord::RecordNotFound
40
- ActionController::RoutingError},
45
+ ActionController::RoutingError},
41
46
  :ignored_exception_messages => [],
42
47
  :ignored_reports => [],
43
48
  :ignored_environments => %w{test cucumber selenium},
@@ -66,8 +71,10 @@ module Errplane
66
71
  }
67
72
 
68
73
  def initialize
69
- @api_host = DEFAULTS[:api_host]
70
- @api_host_port = DEFAULTS[:api_host_port]
74
+ @api_udp_host = DEFAULTS[:api_udp_host]
75
+ @api_udp_port = DEFAULTS[:api_udp_port]
76
+ @api_http_read_host = DEFAULTS[:api_http_read_host]
77
+ @api_http_write_host = DEFAULTS[:api_http_write_host]
71
78
  @app_host = DEFAULTS[:app_host]
72
79
  @ignored_exceptions = DEFAULTS[:ignored_exceptions].dup
73
80
  @ignored_exception_messages = DEFAULTS[:ignored_exception_messages].dup
@@ -111,8 +118,8 @@ module Errplane
111
118
  @custom_exception_data_handler = block
112
119
  end
113
120
 
114
- def add_custom_exception_data(black_box)
115
- @custom_exception_data_handler.call(black_box) if @custom_exception_data_handler
121
+ def add_custom_exception_data(exception_presenter)
122
+ @custom_exception_data_handler.call(exception_presenter) if @custom_exception_data_handler
116
123
  end
117
124
 
118
125
  def database_name
@@ -30,6 +30,7 @@ module Errplane
30
30
  @referer = params[:referer]
31
31
  @custom_data = params[:custom_data] || {}
32
32
  @environment_variables = ENV.to_hash || {}
33
+ @dimensions = {}
33
34
  end
34
35
 
35
36
  def context
@@ -64,7 +65,7 @@ module Errplane
64
65
  :method => "#{@controller}##{@action}",
65
66
  :server => Socket.gethostname,
66
67
  :status => "open"
67
- }
68
+ }.merge(@dimensions)
68
69
  end
69
70
 
70
71
  def reporter
@@ -1,3 +1,3 @@
1
1
  module Errplane
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errplane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-09 00:00:00.000000000 Z
11
+ date: 2013-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json