Skip to content

Commit 278e3f0

Browse files
committed
Merge branch 'hotfix/client'
2 parents fd600bb + 1bd2cdc commit 278e3f0

4 files changed

Lines changed: 27 additions & 28 deletions

File tree

caching/caching_boltdb.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func (c *CachingBolt) GetAppInfo(appGuid string) App {
151151
}
152152

153153
func (c *CachingBolt) Close() {
154+
//logging.Info.Printf("Closing Caching...")
154155
c.Appdb.Close()
155156
}
156157

firehoseclient/firehoseclient.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"crypto/tls"
55
"time"
66

7-
"github.com/mcplusa/cloudfoundry-sumologic-nozzle/eventRouting"
8-
"github.com/mcplusa/cloudfoundry-sumologic-nozzle/logging"
97
"github.com/cloudfoundry-community/go-cfclient"
108
"github.com/cloudfoundry/noaa/consumer"
119
"github.com/cloudfoundry/sonde-go/events"
1210
"github.com/gorilla/websocket"
11+
"github.com/mcplusa/cloudfoundry-sumologic-nozzle/eventRouting"
12+
"github.com/mcplusa/cloudfoundry-sumologic-nozzle/logging"
1313
)
1414

1515
type FirehoseNozzle struct {
@@ -48,6 +48,7 @@ func (f *FirehoseNozzle) Start() error {
4848
logging.Info.Printf("consume the firehose... \n")
4949
err := f.routeEvent()
5050
return err
51+
5152
}
5253

5354
func (f *FirehoseNozzle) consumeFirehose() {
@@ -77,22 +78,22 @@ func (f *FirehoseNozzle) handleError(err error) {
7778

7879
switch {
7980
case websocket.IsCloseError(err, websocket.CloseNormalClosure):
80-
//logging.LogError("Normal Websocket Closure", err)
81+
logging.Error.Printf("Normal Websocket Closure: %v ", err)
8182
case websocket.IsCloseError(err, websocket.ClosePolicyViolation):
82-
//logging.LogError("Error while reading from the firehose", err)
83-
//logging.LogError("Disconnected because nozzle couldn't keep up. Please try scaling up the nozzle.", nil)
83+
logging.Error.Printf("Error while reading from the firehose: %v ", err)
84+
logging.Error.Println("Disconnected because nozzle couldn't keep up. Please try scaling up the nozzle.")
8485

8586
default:
86-
//logging.LogError("Error while reading from the firehose", err)
87+
logging.Error.Printf("Error while reading from the firehose: %v", err)
8788
}
8889

89-
//logging.LogError("Closing connection with traffic controller due to error", err)
90+
logging.Error.Printf("Closing connection with traffic controller due to error: %v", err)
9091
f.consumer.Close()
9192
}
9293

9394
func (f *FirehoseNozzle) handleMessage(envelope *events.Envelope) {
9495
if envelope.GetEventType() == events.Envelope_CounterEvent && envelope.CounterEvent.GetName() == "TruncatingBuffer.DroppedMessages" && envelope.GetOrigin() == "doppler" {
95-
//logging.LogStd("We've intercepted an upstream message which indicates that the nozzle or the TrafficController is not keeping up. Please try scaling up the nozzle.", true)
96+
logging.Info.Println("We've intercepted an upstream message which indicates that the nozzle or the TrafficController is not keeping up. Please try scaling up the nozzle.")
9697
}
9798
}
9899

main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,9 @@ func main() {
124124
}
125125

126126
logging.Info.Printf("Connecting to Firehose... \n")
127-
128127
firehoseClient := firehoseclient.NewFirehoseNozzle(cfClient, events, firehoseConfig)
129-
go firehoseClient.Start()
130-
131-
defer firehoseClient.Start()
132-
128+
errFirehose := firehoseClient.Start()
129+
logging.Info.Printf("FirehoseClient Error: %v", errFirehose)
133130
defer cachingClient.Close()
134131

135132
}

tile.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,41 @@ forms:
4545
- name: sumo-endpoint
4646
type: string
4747
label: Sumo Logic Endpoint
48-
description: Sumo Logic Endpoint where to send the logs
48+
description: Complete URL for the endpoint, copied from the Sumo Logic HTTP Source configuration
4949
- name: sumo-post-minimum-delay
5050
type: string
5151
label: Sumo Logic Post Minimum Delay
52-
description: Delay between post to Sumo Logic
53-
default: 200ms
52+
description: Minimum time between HTTP POST to Sumo Logic
53+
default: 2000ms
5454
- name: sumo-category
5555
type: string
5656
label: Sumo Logic Category
57-
description: Sumo Logic Category (this will override the default in Sumo Logic)
57+
description: This value overrides the default 'Source Category' associated with the configured Sumo Logic HTTP Source
5858
optional: true
5959
- name: sumo-name
6060
type: string
6161
label: Sumo Logic Name
62-
description: Sumo Logic Name (this will override the default in Sumo Logic)
62+
description: This value overrides the default 'Source Name' associated with the configured Sumo Logic HTTP Source
6363
optional: true
6464
- name: sumo-host
6565
type: string
6666
label: Sumo Logic Host
67-
description: Sumo Logic Host (this will override the default in Sumo Logic)
67+
description: This value overrides the default 'Source Host' associated with the configured Sumo Logic HTTP Source
6868
optional: true
6969
- name: custom-metadata
7070
type: string
7171
label: Custom Metadata
72-
description: Enter your custom metadata and values (key1:value1,key2:value2, etc...)
72+
description: Use this field for addingCustom Metadata to the JSON (key1:value1,key2:value2, etc...)
7373
optional: true
7474
- name: include-only-matching-filter
7575
type: string
7676
label: Include Only Matching Filter
77-
description: Enter your Include Only Filter as key1:value1,key2:value2, etc...
77+
description: Adds an 'Include only' filter to Events content (key1:value1,key2:value2, etc...)
7878
optional: true
7979
- name: exclude-always-matching-filter
8080
type: string
8181
label: Exclude Always Filter
82-
description: Enter your Exclude Always Filter as key1:value1,key2:value2, etc...
82+
description: Adds an 'Exclude always' filter to Events content (key1:value1,key2:value2, etc...)
8383
optional: true
8484

8585

@@ -91,7 +91,7 @@ forms:
9191
- name: api-endpoint
9292
type: string
9393
label: Cloud Foundry API Endpoint
94-
description: API endpoint for CF
94+
description: URL to CF API Endpoint
9595
- name: cloudfoundry-user
9696
type: string
9797
label: Cloud Foundry User
@@ -103,23 +103,23 @@ forms:
103103
- name: log-events-batch-size
104104
type: string
105105
label: Log Events Batch Size
106-
description: Events Batch Size to send to Sumo Logic
107-
default: 200
106+
description: When number of messages in the buffer is equal to this field, send those to Sumo Logic
107+
default: 500
108108
- name: events
109109
type: string
110110
label: Comma separated list of events you would like (Default is "LogMessage")
111111
default: LogMessage
112-
description: Valid options are Error, ContainerMetric, HttpStart, HttpStop, HttpStartStop, LogMessage, ValueMetric, CounterEvent
112+
description: Valid options are Error,ContainerMetric,HttpStart,HttpStop,HttpStartStop,LogMessage,ValueMetric,CounterEvent
113113
- name: verbose-log-messages
114114
type: boolean
115115
label: Verbose in 'LogMessage' event
116116
default: true
117-
description: If is not checked, it will send only the LogMessage and the App id
117+
description: Enable Verbose in 'LogMessage' Event. If is not checked, the 'LogMessage' will contain ONLY the fields 'tiemstamp', 'cf_app_guid', 'Msg'
118118
- name: nozzle-polling-period
119119
type: string
120120
label: Nozzle Polling Period
121121
default: 15s
122-
description: Time delay between checking the Nozzle for more events
122+
description: How frequently this Nozzle polls the CF Firehose for data
123123
- name: f2s-disable-logging
124124
type: boolean
125125
label: Disable Logging (Nozzle's Logs)

0 commit comments

Comments
 (0)