Skip to content

Commit

Permalink
Add https-batch to allowed formats
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklas-dohrn committed Jul 17, 2024
1 parent 519dda6 commit 52fbfbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/pkg/egress/syslog/https.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (w *HTTPSWriter) sendHttpRequest(msg []byte, msgCount float64) error {
req.SetBody(msg)

resp := fasthttp.AcquireResponse()
defer fasthttp.ReleaseResponse(resp)

err := w.client.Do(req, resp)
if err != nil {
Expand Down Expand Up @@ -100,12 +101,10 @@ func (*HTTPSWriter) Close() error {
return nil
}

func httpClient(netConf NetworkTimeoutConfig, tlsConf *tls.Config) *fasthttp.Client {
func httpClient(_ NetworkTimeoutConfig, tlsConf *tls.Config) *fasthttp.Client {
return &fasthttp.Client{
MaxConnsPerHost: 5,
MaxIdleConnDuration: 90 * time.Second,
MaxConnsPerHost: 100,
MaxIdleConnDuration: 10 * time.Second,
TLSConfig: tlsConf,
ReadTimeout: 20 * time.Second,
WriteTimeout: 20 * time.Second,
}
}
4 changes: 2 additions & 2 deletions src/pkg/egress/syslog/https_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"code.cloudfoundry.org/loggregator-agent-release/src/pkg/egress"
)

const BATCHSIZE = 256 * 1024
const BATCHSIZE = 1024 * 1024

type HTTPSBatchWriter struct {
HTTPSWriter
Expand Down Expand Up @@ -39,7 +39,7 @@ func NewHTTPSBatchWriter(
syslogConverter: c,
},
batchSize: BATCHSIZE,
sendInterval: 1 * time.Second,
sendInterval: 3 * time.Second,
egrMsgCount: 0,
msgs: make(chan []byte),
}
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/ingress/bindings/filtered_binding_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"code.cloudfoundry.org/loggregator-agent-release/src/pkg/egress/syslog"
)

var allowedSchemes = []string{"syslog", "syslog-tls", "https"}
var allowedSchemes = []string{"syslog", "syslog-tls", "https", "https-batch"}

type IPChecker interface {
ResolveAddr(host string) (net.IP, error)
Expand Down

0 comments on commit 52fbfbe

Please sign in to comment.