opbeat 0.5.1 → 0.5.2
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/README.md +1 -1
- data/lib/opbeat/client.rb +12 -2
- data/lib/opbeat/processors/sanitizedata.rb +1 -1
- data/lib/opbeat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfe15681e252c3094e3511bf20dbafe757f9e342
|
4
|
+
data.tar.gz: b8c85cf5621ca9e675f56480416d661773569adc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 219eddda6bdccc4a1e4eb52c292c527c650c7fdab9f53db68388a24a8f64aee5dbae331fa9ab15f67a97b6cdba4c89f669ab42eea1c56788afd5c9b4f1bb88df
|
7
|
+
data.tar.gz: b788d34646fb4cbb258a9fbd4cff8bb23723e9803553e6af51112adf3a3888f7975c2d072268a587c5daa6e621f7bb130113d09c185de148872a7fd5f2c034ce
|
data/README.md
CHANGED
@@ -153,7 +153,7 @@ Opbeat.configure do |config|
|
|
153
153
|
config.app_id = '094e250818'
|
154
154
|
config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
|
155
155
|
|
156
|
-
config.processors = [Opbeat::
|
156
|
+
config.processors = [Opbeat::Processor::SanitizeData]
|
157
157
|
end
|
158
158
|
```
|
159
159
|
|
data/lib/opbeat/client.rb
CHANGED
@@ -19,7 +19,6 @@ module Opbeat
|
|
19
19
|
return true if @status == :online
|
20
20
|
|
21
21
|
interval = ([@retry_number, 6].min() ** 2) * @configuration[:backoff_multiplier]
|
22
|
-
puts interval
|
23
22
|
return true if Time.now - @last_check > interval
|
24
23
|
|
25
24
|
false
|
@@ -50,6 +49,7 @@ module Opbeat
|
|
50
49
|
def initialize(configuration)
|
51
50
|
@configuration = configuration
|
52
51
|
@state = ClientState.new configuration
|
52
|
+
@processors = configuration.processors.map { |p| p.new(self) }
|
53
53
|
end
|
54
54
|
|
55
55
|
def conn
|
@@ -74,6 +74,16 @@ module Opbeat
|
|
74
74
|
'Bearer ' + self.configuration[:secret_token]
|
75
75
|
end
|
76
76
|
|
77
|
+
def encode(event)
|
78
|
+
event_hash = event.to_hash
|
79
|
+
|
80
|
+
@processors.each do |p|
|
81
|
+
event_hash = p.process(event_hash)
|
82
|
+
end
|
83
|
+
|
84
|
+
return MultiJson.encode(event_hash)
|
85
|
+
end
|
86
|
+
|
77
87
|
def send(event)
|
78
88
|
return unless configuration.send_in_current_environment?
|
79
89
|
return unless state.should_try?
|
@@ -86,7 +96,7 @@ module Opbeat
|
|
86
96
|
begin
|
87
97
|
response = self.conn.post @url do |req|
|
88
98
|
req.headers['Content-Type'] = 'application/json'
|
89
|
-
req.body =
|
99
|
+
req.body = self.encode(event)
|
90
100
|
req.headers[AUTH_HEADER_KEY] = self.generate_auth_header(req.body)
|
91
101
|
req.headers["User-Agent"] = USER_AGENT
|
92
102
|
end
|
data/lib/opbeat/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opbeat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Kantrowitz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|