bosh-monitor 1.3184.1.0 → 1.3189.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bosh/monitor/agent.rb +3 -2
- data/lib/bosh/monitor/agent_manager.rb +8 -8
- data/lib/bosh/monitor/config.rb +3 -0
- data/lib/bosh/monitor/plugins/consul_event_forwarder.rb +1 -1
- data/lib/bosh/monitor/plugins/resurrector.rb +7 -7
- data/lib/bosh/monitor/plugins/resurrector_helper.rb +7 -7
- data/lib/bosh/monitor/runner.rb +1 -0
- data/lib/bosh/monitor/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 683401e4f5924206ec23df062b5bbbe67edd11e7
|
4
|
+
data.tar.gz: 3c19755f34e2c3f1a14f65d6fab057cad0b3b87d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93f9db184bf68cfb91b04d57011b083f5a7b57aded228a4a260ed77e870127f61c7669e3f7ddb5b9f862f0869e9233c31e4828b385c2fb0084ffe0e6e3e05233
|
7
|
+
data.tar.gz: ed368e07fb7c91b544b404bb0e1672420dd3a0698f4e3f96e93aa0673271ece6787f065bd2ed92544c6ea4ca8ba5b91c793a3dc149f991ab7eb71e8cb7fd3ba4
|
data/lib/bosh/monitor/agent.rb
CHANGED
@@ -5,7 +5,7 @@ module Bosh::Monitor
|
|
5
5
|
attr_reader :discovered_at
|
6
6
|
attr_accessor :updated_at
|
7
7
|
|
8
|
-
ATTRIBUTES = [ :deployment, :job, :index, :cid ]
|
8
|
+
ATTRIBUTES = [ :deployment, :job, :index, :instance_id, :cid ]
|
9
9
|
|
10
10
|
ATTRIBUTES.each do |attribute|
|
11
11
|
attr_accessor attribute
|
@@ -24,11 +24,12 @@ module Bosh::Monitor
|
|
24
24
|
@job = opts[:job]
|
25
25
|
@index = opts[:index]
|
26
26
|
@cid = opts[:cid]
|
27
|
+
@instance_id = opts[:instance_id]
|
27
28
|
end
|
28
29
|
|
29
30
|
def name
|
30
31
|
if @deployment && @job && @index
|
31
|
-
"#{@deployment}: #{@job}(#{@index}) [id=#{@id}, cid=#{@cid}]"
|
32
|
+
"#{@deployment}: #{@job}(#{@index}) [id=#{@id}, instance_id=#{@instance_id}, cid=#{@cid}]"
|
32
33
|
else
|
33
34
|
state = ATTRIBUTES.inject([]) do |acc, attribute|
|
34
35
|
value = send(attribute)
|
@@ -124,10 +124,9 @@ module Bosh::Monitor
|
|
124
124
|
return false
|
125
125
|
end
|
126
126
|
|
127
|
-
@logger.info("Adding agent #{vm_data[
|
127
|
+
@logger.info("Adding agent #{vm_data['agent_id']} (#{vm_data['job']}/#{vm_data['index']}) to #{deployment_name}...")
|
128
128
|
|
129
|
-
agent_id = vm_data[
|
130
|
-
agent_cid = vm_data["cid"]
|
129
|
+
agent_id = vm_data['agent_id']
|
131
130
|
|
132
131
|
if agent_id.nil?
|
133
132
|
@logger.warn("No agent id for VM: #{vm_data}")
|
@@ -135,7 +134,7 @@ module Bosh::Monitor
|
|
135
134
|
end
|
136
135
|
|
137
136
|
# Idle VMs, we don't care about them, but we still want to track them
|
138
|
-
if vm_data[
|
137
|
+
if vm_data['job'].nil?
|
139
138
|
@logger.debug("VM with no job found: #{agent_id}")
|
140
139
|
end
|
141
140
|
|
@@ -148,9 +147,10 @@ module Bosh::Monitor
|
|
148
147
|
end
|
149
148
|
|
150
149
|
agent.deployment = deployment_name
|
151
|
-
agent.job = vm_data[
|
152
|
-
agent.index = vm_data[
|
153
|
-
agent.cid = vm_data[
|
150
|
+
agent.job = vm_data['job']
|
151
|
+
agent.index = vm_data['index']
|
152
|
+
agent.cid = vm_data['cid']
|
153
|
+
agent.instance_id = vm_data['id']
|
154
154
|
|
155
155
|
@deployments[deployment_name] ||= Set.new
|
156
156
|
@deployments[deployment_name] << agent_id
|
@@ -209,7 +209,7 @@ module Bosh::Monitor
|
|
209
209
|
created_at: ts,
|
210
210
|
deployment: agent.deployment,
|
211
211
|
job: agent.job,
|
212
|
-
|
212
|
+
instance_id: agent.instance_id)
|
213
213
|
end
|
214
214
|
|
215
215
|
if agent.rogue?
|
data/lib/bosh/monitor/config.rb
CHANGED
@@ -6,6 +6,7 @@ module Bosh::Monitor
|
|
6
6
|
attr_accessor :director
|
7
7
|
attr_accessor :intervals
|
8
8
|
attr_accessor :mbus
|
9
|
+
attr_accessor :em_threadpool_size
|
9
10
|
attr_accessor :event_mbus
|
10
11
|
attr_accessor :agent_manager
|
11
12
|
attr_accessor :event_processor
|
@@ -23,6 +24,8 @@ module Bosh::Monitor
|
|
23
24
|
@director = Director.new(config["director"], @logger)
|
24
25
|
@mbus = OpenStruct.new(config["mbus"])
|
25
26
|
|
27
|
+
@em_threadpool_size = config["em_threadpool_size"]
|
28
|
+
|
26
29
|
@event_processor = EventProcessor.new
|
27
30
|
@agent_manager = AgentManager.new(event_processor)
|
28
31
|
|
@@ -11,7 +11,7 @@ module Bosh::Monitor
|
|
11
11
|
CONSUL_MAX_EVENT_BYTESIZE = 512
|
12
12
|
|
13
13
|
CONSUL_ENDPOINTS = {
|
14
|
-
event:
|
14
|
+
event: "/v1/event/fire/", #fire an event
|
15
15
|
register: "/v1/agent/check/register", #register a check
|
16
16
|
deregister: "/v1/agent/check/deregister/", #deregister a check
|
17
17
|
pass: "/v1/agent/check/pass/", #mark a check as passing
|
@@ -31,15 +31,15 @@ module Bosh::Monitor
|
|
31
31
|
def process(alert)
|
32
32
|
deployment = alert.attributes['deployment']
|
33
33
|
job = alert.attributes['job']
|
34
|
-
|
34
|
+
id = alert.attributes['instance_id']
|
35
35
|
|
36
|
-
# only when the agent times out do we add deployment, job &
|
36
|
+
# only when the agent times out do we add deployment, job & id to the alert
|
37
37
|
# attributes, so this won't trigger a recreate for other types of alerts
|
38
|
-
if deployment && job &&
|
39
|
-
agent_key = ResurrectorHelper::JobInstanceKey.new(deployment, job,
|
38
|
+
if deployment && job && id
|
39
|
+
agent_key = ResurrectorHelper::JobInstanceKey.new(deployment, job, id)
|
40
40
|
@alert_tracker.record(agent_key, alert.created_at)
|
41
41
|
|
42
|
-
payload = {'jobs' => {job => [
|
42
|
+
payload = {'jobs' => {job => [id]}}
|
43
43
|
|
44
44
|
unless director_info
|
45
45
|
logger.error("(Resurrector) director is not responding with the status")
|
@@ -70,13 +70,13 @@ module Bosh::Monitor
|
|
70
70
|
# queue instead, and only queue if it isn't already in the queue
|
71
71
|
# what if we can't keep up with the failure rate?
|
72
72
|
# - maybe not, maybe the meltdown detection takes care of the rate issue
|
73
|
-
logger.warn("(Resurrector) notifying director to recreate unresponsive VM: #{deployment} #{job}/#{
|
73
|
+
logger.warn("(Resurrector) notifying director to recreate unresponsive VM: #{deployment} #{job}/#{id}")
|
74
74
|
|
75
75
|
send_http_put_request(url.to_s, request)
|
76
76
|
end
|
77
77
|
|
78
78
|
else
|
79
|
-
logger.warn("(Resurrector) event did not have deployment, job and
|
79
|
+
logger.warn("(Resurrector) event did not have deployment, job and id: #{alert}")
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -3,26 +3,26 @@ module Bosh::Monitor::Plugins
|
|
3
3
|
|
4
4
|
# Hashable tuple of the identifying properties of a job
|
5
5
|
class JobInstanceKey
|
6
|
-
attr_accessor :deployment, :job, :
|
6
|
+
attr_accessor :deployment, :job, :id
|
7
7
|
|
8
|
-
def initialize(deployment, job,
|
8
|
+
def initialize(deployment, job, id)
|
9
9
|
@deployment = deployment
|
10
10
|
@job = job
|
11
|
-
@
|
11
|
+
@id = id
|
12
12
|
end
|
13
13
|
|
14
14
|
def hash
|
15
|
-
(deployment.to_s + job.to_s +
|
15
|
+
(deployment.to_s + job.to_s + id.to_s).hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def eql?(other)
|
19
19
|
other.deployment == deployment &&
|
20
20
|
other.job == job &&
|
21
|
-
other.
|
21
|
+
other.id == id
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_s
|
25
|
-
[deployment, job,
|
25
|
+
[deployment, job, id].join('/')
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -72,7 +72,7 @@ module Bosh::Monitor::Plugins
|
|
72
72
|
def alerts_for_deployment(deployment)
|
73
73
|
agents = @agent_manager.get_agents_for_deployment(deployment)
|
74
74
|
keys = agents.values.map { |agent|
|
75
|
-
JobInstanceKey.new(agent.deployment, agent.job, agent.
|
75
|
+
JobInstanceKey.new(agent.deployment, agent.job, agent.instance_id)
|
76
76
|
}
|
77
77
|
|
78
78
|
result = {}
|
data/lib/bosh/monitor/runner.rb
CHANGED
data/lib/bosh/monitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3189.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - '='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
159
|
+
version: 2.7.1
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.
|
166
|
+
version: 2.7.1
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rake
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|