logjam_agent 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.rdoc +1 -1
- data/lib/logjam_agent.rb +12 -1
- data/lib/logjam_agent/amqp_forwarder.rb +5 -5
- data/lib/logjam_agent/request.rb +1 -1
- data/lib/logjam_agent/version.rb +1 -1
- data/logjam_agent.gemspec +1 -2
- metadata +13 -27
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGVlMTVjMWMzMTI1YzcxNzM3NTExZTc1MjQ3NmJkOTcxN2VhOTcyYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWI2N2Q1NTFkOTMxMTRlZWQwMjNlYWVlZGZmZGI1YjhmZGE4NDQwZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWEzMTVkNTUyNDUxMTZmZDUyNTY3YTNlMDI2NmI2YzgzMjM1NDI1ZWU0MmEz
|
10
|
+
MzdjZTA4ZmVjZTZiNjVkNTliOGU3ZmFhMTEzOTRkNGI1NzYyNmNlNTdkNWYw
|
11
|
+
ZTdkNjNjNjdlNWMxMjA4MmYwY2JmYmZmOTdiZGE5ZjAxNGZkMTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDFlYTczMzNjMThlNDlmNTE0OTJmZTdlNzE4MTdmMzQ1OWU0MTRmYmEyODA0
|
14
|
+
ODkzOTJjOTZmZTA4NThmZjBkZTk0YjM5ZmRjNTUyNWMwZmNkMDI1OWJlZjM5
|
15
|
+
NzYwY2VhMTlhNjQwYTQ5NDUxZTU1MjQ3NjBlNzczZThkM2ZlODM=
|
data/README.rdoc
CHANGED
data/lib/logjam_agent.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "socket"
|
2
|
-
require "uuid4r"
|
3
2
|
require "time_bandits"
|
4
3
|
|
5
4
|
module LogjamAgent
|
@@ -119,6 +118,18 @@ module LogjamAgent
|
|
119
118
|
EOS
|
120
119
|
end
|
121
120
|
|
121
|
+
# setup uuid generation
|
122
|
+
begin
|
123
|
+
require "uuid4r"
|
124
|
+
def self.generate_uuid
|
125
|
+
UUID4R::uuid(1).gsub('-','')
|
126
|
+
end
|
127
|
+
rescue LoadError
|
128
|
+
def self.generate_uuid
|
129
|
+
SecureRandom.uuid.gsub('-','')
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
122
133
|
# setup json encoding
|
123
134
|
begin
|
124
135
|
require "oj"
|
@@ -10,6 +10,7 @@ module LogjamAgent
|
|
10
10
|
@env = env
|
11
11
|
@config = default_options(app, env).merge!(opts)
|
12
12
|
@exchange = @bunny = nil
|
13
|
+
ensure_bunny_gem_is_available
|
13
14
|
end
|
14
15
|
|
15
16
|
def default_options(app, env)
|
@@ -88,12 +89,11 @@ module LogjamAgent
|
|
88
89
|
|
89
90
|
#TODO: verify socket_timout for ruby 1.9
|
90
91
|
def bunny
|
91
|
-
@bunny ||=
|
92
|
-
begin
|
93
|
-
require "bunny" unless defined?(Bunny)
|
94
|
-
Bunny.new(:host => @config[:host], :socket_timeout => 1.0)
|
95
|
-
end
|
92
|
+
@bunny ||= Bunny.new(:host => @config[:host], :socket_timeout => 1.0)
|
96
93
|
end
|
97
94
|
|
95
|
+
def ensure_bunny_gem_is_available
|
96
|
+
require "bunny" unless defined?(Bunny)
|
97
|
+
end
|
98
98
|
end
|
99
99
|
end
|
data/lib/logjam_agent/request.rb
CHANGED
@@ -13,7 +13,7 @@ module LogjamAgent
|
|
13
13
|
@env = env
|
14
14
|
@forwarder = Forwarders.get(app, env)
|
15
15
|
@lines = []
|
16
|
-
@uuid =
|
16
|
+
@uuid = LogjamAgent.generate_uuid
|
17
17
|
@fields = initial_fields.merge(:request_id => @uuid, :host => LogjamAgent.hostname, :process_id => Process.pid, :lines => @lines)
|
18
18
|
@mutex = Mutex.new
|
19
19
|
end
|
data/lib/logjam_agent/version.rb
CHANGED
data/logjam_agent.gemspec
CHANGED
@@ -22,6 +22,5 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency "i18n"
|
23
23
|
|
24
24
|
s.add_runtime_dependency "activesupport"
|
25
|
-
s.add_runtime_dependency "
|
26
|
-
s.add_runtime_dependency "time_bandits", [">= 0.4"]
|
25
|
+
s.add_runtime_dependency "time_bandits", [">= 0.6.0"]
|
27
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Kaes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -16,70 +16,56 @@ dependencies:
|
|
16
16
|
- - ! '>='
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '0'
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ! '>='
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: '0'
|
24
19
|
type: :development
|
25
20
|
prerelease: false
|
26
21
|
name: rake
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
22
|
version_requirements: !ruby/object:Gem::Requirement
|
34
23
|
requirements:
|
35
24
|
- - ! '>='
|
36
25
|
- !ruby/object:Gem::Version
|
37
26
|
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
name: i18n
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
requirement: !ruby/object:Gem::Requirement
|
43
29
|
requirements:
|
44
30
|
- - ! '>='
|
45
31
|
- !ruby/object:Gem::Version
|
46
32
|
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
name: i18n
|
47
36
|
version_requirements: !ruby/object:Gem::Requirement
|
48
37
|
requirements:
|
49
38
|
- - ! '>='
|
50
39
|
- !ruby/object:Gem::Version
|
51
40
|
version: '0'
|
52
|
-
type: :runtime
|
53
|
-
prerelease: false
|
54
|
-
name: activesupport
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
requirement: !ruby/object:Gem::Requirement
|
57
43
|
requirements:
|
58
44
|
- - ! '>='
|
59
45
|
- !ruby/object:Gem::Version
|
60
46
|
version: '0'
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
name: activesupport
|
61
50
|
version_requirements: !ruby/object:Gem::Requirement
|
62
51
|
requirements:
|
63
52
|
- - ! '>='
|
64
53
|
- !ruby/object:Gem::Version
|
65
54
|
version: '0'
|
66
|
-
type: :runtime
|
67
|
-
prerelease: false
|
68
|
-
name: uuid4r
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
requirement: !ruby/object:Gem::Requirement
|
71
57
|
requirements:
|
72
58
|
- - ! '>='
|
73
59
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
60
|
+
version: 0.6.0
|
61
|
+
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
name: time_bandits
|
75
64
|
version_requirements: !ruby/object:Gem::Requirement
|
76
65
|
requirements:
|
77
66
|
- - ! '>='
|
78
67
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
80
|
-
type: :runtime
|
81
|
-
prerelease: false
|
82
|
-
name: time_bandits
|
68
|
+
version: 0.6.0
|
83
69
|
description: Logjam logger and request information forwarding
|
84
70
|
email:
|
85
71
|
- stefan.kaes@xing.com
|