-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update broker/pipeline setup #4650
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha2...master[Check the HEAD d | |
- The `scripts/import_dashboards` is removed from packages. Use the `setup` command instead. {pull}4586[4586] | ||
- Change format of the saved kibana dashboards to have a single JSON file for each dashboard {pull}4413[4413] | ||
- Rename `configtest` command to `test config`. {pull}4590[4590] | ||
- Remove setting `queue_size` and `bulk_queue_size`. {pull}4650[4650] | ||
|
||
*Filebeat* | ||
|
||
|
@@ -70,6 +71,8 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha2...master[Check the HEAD d | |
- Add support for analyzers and multifields in fields.yml. {pull}4574[4574] | ||
- Add support for JSON logging. {pull}4523[4523] | ||
- Add `test output` command, to test Elasticsearch and Logstash output settings. {pull}4590[4590] | ||
- Introduce configurable event queue settings: queue.mem.events, queue.mem.flush.min_events and queue.mem.flush.timeout. {pull}4650[4650] | ||
- Enable pipelining in Logstash output by default. {pull}4650[4650] | ||
|
||
*Filebeat* | ||
|
||
|
@@ -81,6 +84,7 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha2...master[Check the HEAD d | |
- Add udp prospector type. {pull}4452[4452] | ||
- Enabled Cgo which means libc is dynamically compiled. {pull}4546[4546] | ||
- Add Beta module config reloading mechanism {pull}4566[4566] | ||
- Remove spooler and publisher components and settings. {pull}4644[4644] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, we should probably have a message in 5.6 or even better, not let the beat start in 6.0 if these values are set? |
||
|
||
*Heartbeat* | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,12 +86,25 @@ auditbeat.modules: | |
# sub-dictionary. Default is false. | ||
#fields_under_root: false | ||
|
||
# Internal queue size for single events in processing pipeline | ||
#queue_size: 1000 | ||
|
||
# The internal queue size for bulk events in the processing pipeline. | ||
# Do not modify this value. | ||
#bulk_queue_size: 0 | ||
# Internal queue configuration for buffering events to be published. | ||
#queue: | ||
# Queue type by name (default 'mem') | ||
# The memory queue will present all available events (up to the outputs | ||
# bulk_max_size) to the output, the moment the output is ready to server | ||
# another batch of events. | ||
#mem: | ||
# Max number of events the queue can buffer. | ||
#events: 4096 | ||
|
||
# Hints the minimum number of events stored in the queue, | ||
# before providing a batch of events to the outputs. | ||
# A value of 0 (the default) ensures events are immediately available | ||
# to be sent to the outputs. | ||
#flush.min_events: 0 | ||
|
||
# Maximum duration after which events are available to the outputs, | ||
# if the number of events stored in the queue is < min_flush_events. | ||
#flush.timeout: 0s | ||
|
||
# Sets the maximum number of CPUs that can be executing simultaneously. The | ||
# default is the number of logical CPUs available in the system. | ||
|
@@ -284,9 +297,9 @@ output.elasticsearch: | |
# Optional load balance the events between the Logstash hosts | ||
#loadbalance: true | ||
|
||
# Number of batches to be send asynchronously to logstash while processing | ||
# Number of batches to be sent asynchronously to logstash while processing | ||
# new batches. | ||
#pipelining: 0 | ||
#pipelining: 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we changed the default to 5? Should probably be mentioned in the changelog? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated changelog. |
||
|
||
# Optional index name. The default index name is set to name of the beat | ||
# in all lowercase. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,6 @@ const ( | |
|
||
type Config struct { | ||
Prospectors []*common.Config `config:"prospectors"` | ||
SpoolSize uint64 `config:"spool_size" validate:"min=1"` | ||
PublishAsync bool `config:"publish_async"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glad to see this one removed ;-) |
||
IdleTimeout time.Duration `config:"idle_timeout" validate:"nonzero,min=0s"` | ||
RegistryFile string `config:"registry_file"` | ||
ConfigDir string `config:"config_dir"` | ||
ShutdownTimeout time.Duration `config:"shutdown_timeout"` | ||
|
@@ -34,8 +31,6 @@ type Config struct { | |
var ( | ||
DefaultConfig = Config{ | ||
RegistryFile: "registry", | ||
SpoolSize: 2048, | ||
IdleTimeout: 5 * time.Second, | ||
ShutdownTimeout: 0, | ||
} | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,31 +2,22 @@ package publisher | |
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/elastic/beats/libbeat/common" | ||
"github.com/elastic/beats/libbeat/logp" | ||
"github.com/elastic/beats/libbeat/outputs" | ||
"github.com/elastic/beats/libbeat/processors" | ||
"github.com/elastic/beats/libbeat/publisher/broker" | ||
"github.com/elastic/beats/libbeat/publisher/broker/membroker" | ||
"github.com/elastic/beats/libbeat/publisher/pipeline" | ||
) | ||
|
||
const defaultBrokerSize = 8 * 1024 | ||
|
||
func createPipeline( | ||
beatInfo common.BeatInfo, | ||
shipper ShipperConfig, | ||
processors *processors.Processors, | ||
outcfg common.ConfigNamespace, | ||
) (*pipeline.Pipeline, error) { | ||
queueSize := defaultBrokerSize | ||
if qs := shipper.QueueSize; qs != nil { | ||
if sz := *qs; sz > 0 { | ||
queueSize = sz | ||
} | ||
} | ||
|
||
var out outputs.Group | ||
if !(*publishDisabled) { | ||
var err error | ||
|
@@ -63,11 +54,27 @@ func createPipeline( | |
}, | ||
} | ||
|
||
brokerFactory := func(e broker.Eventer) (broker.Broker, error) { | ||
return membroker.NewBroker(e, queueSize, false), nil | ||
brokerType := "mem" | ||
if b := shipper.Queue.Name(); b != "" { | ||
brokerType = b | ||
} | ||
|
||
p, err := pipeline.New(brokerFactory, out, settings) | ||
brokerFactory := broker.FindFactory(brokerType) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As quickly discussed, later we should probably rename |
||
if brokerFactory == nil { | ||
return nil, fmt.Errorf("'%v' is no valid queue type", brokerType) | ||
} | ||
|
||
brokerConfig := shipper.Queue.Config() | ||
if brokerConfig == nil { | ||
brokerConfig = common.NewConfig() | ||
} | ||
|
||
p, err := pipeline.New( | ||
func(eventer broker.Eventer) (broker.Broker, error) { | ||
return brokerFactory(eventer, brokerConfig) | ||
}, | ||
out, settings, | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a message to the 5.6 release that these values will change?