Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

Commit bbe02f9

Browse files
author
caleb miles
committed
Use BOSH Job ID (guid) rather than index (uint)
[#121080065] Signed-off-by: nino khodabandeh <ninok@hpe.com>
1 parent 12f8a95 commit bbe02f9

File tree

44 files changed

+75
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+75
-59
lines changed

config/doppler.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"OutgoingPort": 8080,
88
"SinkSkipCertVerify": false,
99
"JobName": "loggregator_z1",
10-
"Index": 0,
10+
"Index": "0",
1111
"MaxRetainedLogMessages": 10,
1212
"CollectorRegistrarIntervalMilliseconds": 60000,
1313
"SharedSecret": "secret",

config/loggregator_trafficcontroller.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"JobName": "trafficcontroller",
3-
"JobIndex": 3,
3+
"Index": "3",
44
"EtcdUrls" : ["http://127.0.0.1:4001", "http://127.0.0.1:4002"],
55
"EtcdMaxConcurrentRequests": 5,
66
"OutgoingDropsondePort": 4566,

config/metron.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Index": 0,
2+
"Index": "0",
33
"DropsondeIncomingMessagesPort": 51161,
44
"SharedSecret": "shared_secret",
55
"EtcdUrls" : ["http://127.0.0.1:5800"],

jobs/dea_logging_agent/templates/dea_logging_agent.json.erb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
<%
2+
# try and set these properties from a BOSH 2.0 spec object
3+
instance_id = spec.id
4+
5+
if instance_id.nil?
6+
instance_id = spec.index
7+
end
8+
%>
19
{
2-
"Index": <%= spec.index %>,
10+
"Index": "<%= instance_id %>",
311
"MetronAddress": "<%= p("metron_endpoint.host") %>:<%= p("metron_endpoint.dropsonde_port") %>"
412
<% if_p("syslog_daemon_config") do |_| %>
513
, "Syslog": "vcap.dea_logging_agent"

jobs/doppler/templates/doppler.json.erb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
<%
2-
1+
<%
32
# try and set these properties from a BOSH 2.0 spec object
4-
job_name = spec.job
3+
job_name = spec.job.name
4+
instance_id = spec.id
55
instance_zone = spec.az
6+
67
if job_name.nil?
78
job_name = name
89
end
910

11+
if instance_id.nil?
12+
instance_id = spec.index
13+
end
1014

1115
if instance_zone.nil?
1216
instance_zone = p("doppler.zone")
1317
end
14-
1518
%>
1619
{
1720
"EtcdUrls": [<%= p("loggregator.etcd.machines").map{|addr| "\"http://#{addr}:4001\""}.join(",") %>],
@@ -29,9 +32,9 @@
2932
},
3033
<% end %>
3134
"OutgoingPort": <%= p("doppler.outgoing_port") %>,
32-
"Index": <%= spec.index %>,
3335
"Zone": "<%= instance_zone %>",
3436
"JobName": "<%= job_name %>",
37+
"Index": "<%= instance_id %>",
3538
"MaxRetainedLogMessages": <%= p("doppler.maxRetainedLogMessages") %>,
3639
"SharedSecret": "<%= p("doppler_endpoint.shared_secret") %>",
3740
"ContainerMetricTTLSeconds": <%= p("doppler.container_metric_ttl_seconds") %>,

jobs/loggregator_trafficcontroller/templates/loggregator_trafficcontroller.json.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"JobName": "<%= name %>",
3-
"JobIndex": <%= spec.index %>,
3+
"Index": "<%= spec.index %>",
44
"EtcdUrls": [<%= p("loggregator.etcd.machines").map{|addr| "\"http://#{addr}:4001\""}.join(",")%>],
55
"EtcdMaxConcurrentRequests": <%= p("loggregator.etcd.maxconcurrentrequests") %>,
66
"OutgoingDropsondePort": <%= p("loggregator.outgoing_dropsonde_port") %>,

jobs/metron_agent/templates/metron_agent.json.erb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,26 @@
66

77
useTLS = protocols.include? "tls"
88

9-
109
# try and set these properties from a BOSH 2.0 spec object
11-
job_name = spec.job
10+
job_name = spec.job.name
11+
instance_id = spec.id
1212
instance_zone = spec.az
13+
1314
if job_name.nil?
1415
job_name = name
1516
end
17+
18+
if instance_id.nil?
19+
instance_id = spec.index
20+
end
21+
1622
if instance_zone.nil?
1723
instance_zone = p("metron_agent.zone")
1824
end
1925
%>
2026

2127
{
22-
"Index": <%= spec.index %>,
28+
"Index": "<%= instance_id %>",
2329
"Job": "<%= job_name %>",
2430
"Zone": "<%= instance_zone %>",
2531
"Deployment": "<%= p("metron_agent.deployment") %>",

src/deaagent/deaagent/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ import (
99
"os"
1010
"time"
1111

12-
"github.com/cloudfoundry/dropsonde"
1312
"signalmanager"
13+
14+
"github.com/cloudfoundry/dropsonde"
1415
)
1516

1617
const DrainStoreRefreshInterval = 1 * time.Minute
1718

1819
type Config struct {
1920
Syslog string
20-
Index uint
21+
Index string
2122
MetronAddress string
2223
}
2324

src/doppler/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Config struct {
2727
TLSListenerConfig TLSListenerConfig
2828
EtcdMaxConcurrentRequests int
2929
EtcdUrls []string
30-
Index uint
30+
Index string
3131
JobName string
3232
LogFilePath string
3333
MaxRetainedLogMessages uint32

src/doppler/config/fixtures/doppler.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"SinkSkipCertVerify": false,
1313
"Job": "doppler_z1",
1414
"Zone": "z1",
15-
"Index": 0,
15+
"Index": "0",
1616
"EtcdUrls": ["http://localhost:4001"],
1717
"MaxRetainedLogMessages": 10,
1818
"MessageDrainBufferSize": 100,

0 commit comments

Comments
 (0)