Skip to content

Commit

Permalink
Make the log scraper buffer configurable (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
medzin authored Jul 19, 2018
1 parent d057858 commit d785c36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type Config struct {
// SentryDSN is an address used for sending logs to Sentry
SentryDSN string `split_words:"true"`

// ServicelogBufferSize sets a line buffer size used by log scraping module
ServicelogBufferSize uint `default:"2000" split_words:"true"`

// ServicelogIgnoreKeys is a list of ignored keys for log scraping module
ServicelogIgnoreKeys []string `split_words:"true"`

Expand Down Expand Up @@ -139,6 +142,7 @@ func NewExecutor(cfg Config, hooks ...hook.Hook) *Executor {
log.Infof("SubscriptionBackoffMax = %s", cfg.MesosConfig.SubscriptionBackoffMax)
log.Infof("APIPath = %s", cfg.APIPath)
log.Infof("Debug = %t", cfg.Debug)
log.Infof("ServicelogBufferSize = %d", cfg.ServicelogBufferSize)
log.Infof("ServicelogIgnoreKeys = %s", cfg.ServicelogIgnoreKeys)
log.Infof("StateUpdateBufferSize = %d", cfg.StateUpdateBufferSize)

Expand Down Expand Up @@ -460,7 +464,7 @@ func (e *Executor) createOptionsForLogstashServiceLogScrapping(taskInfo mesos.Ta
filter := scraper.ValueFilter{Values: values}
scr := &scraper.JSON{
KeyFilter: filter,
BufferSize: 2000,
BufferSize: e.config.ServicelogBufferSize,
ScrapUnmarshallableLogs: utilTaskInfo.GetLabelValue("log-scraping-all") != "",
}
apr, err := appender.LogstashAppenderFromEnv()
Expand Down

0 comments on commit d785c36

Please sign in to comment.