Commit graph

340 commits

Author SHA1 Message Date
Pere Urbon-Bayes
ee690ac3ee make sure _stats and _node/stats data format is the same
Fixes #4780
2016-03-11 19:31:14 +00:00
fbaligand
587db82c15 add complementary tests to 'environment variable evaluation'
Fixes #3944
2016-03-07 10:58:38 -08:00
Jordan Sissel
d45e303dca Make ${FOO} evaluation fail if FOO is not an environment variable
This updates the specs to cover this expectation. It also makes
assertions about default values if a default `${FOO:default value}` is
given.

Specs pass for me (18 specs)

(Improves on #4710)
2016-03-07 10:58:17 -08:00
fbaligand
9b89b884a0 Fix issue #3944 : Add support for environment variable injection in logstash plugin configuration 2016-03-07 10:58:17 -08:00
Pier-Hugues Pellerin
82dde31afe Fix an issue with the expectation on the agent#uptime
Fixes #4687

Fixes #4653
2016-02-12 19:00:11 +00:00
Pere Urbon-Bayes
459fad4738 cleanup non used expectation inside the jvm specs
Fixes #4683

Fixes #4653
2016-02-12 19:00:11 +00:00
Pere Urbon-Bayes
93a3baa007 add human version to not_found error and rescue errors on webserver
Fixes #4662

Fixes #4653
2016-02-12 19:00:10 +00:00
Pier-Hugues Pellerin
e06c5106c5 Threadsafety problem when creating the initial metric instance
This PR fix an issue where we were incorrectly creating the first
instance of the metric. This was causing missing increments

Fixes #4665

Fixes #4653
2016-02-12 19:00:10 +00:00
Pere Urbon-Bayes
2c4b8e8fd5 add a way to ask for pretty print json for the webapi
Fixes #4658

Fixes #4653
2016-02-12 19:00:10 +00:00
Pere Urbon-Bayes
23dcf467e4 This make all designed resources for the metrics api available, this follows the initial sketches created in #4446.
As discussed in this adds:

/
/_node/hot_threads
/_node/stats/
/_node/stats/events
/_node/stats/jvm
/_stats/jvm

introduces also small refactors and cleanup necessary to improve the
webapi code quality.

adds also a way to handle references from the webapi to the internals of
logstash by passing the agent refrences to the collector, this is not
perfect, but for now it solve the communication situation until furder
refactor.

Fixes #4652

Fixes #4653
2016-02-12 19:00:10 +00:00
Pere Urbon-Bayes
81f83a231c introduced basic error logging
Fixes #4635

Fixes #4653
2016-02-12 19:00:10 +00:00
Pier-Hugues Pellerin
a04da0f76d Collecting Logstash metrics at runtime
This commit introduce the collection of the main metrics inside the
logstash pipeline and records it to the metric store. This code is also
the initial stone to define an internal metric api.

Collected metrics from the pipeline and system will be exposed by the web
api.

This work was done in collaboration by @ph and @purbon, commits were
squashed to simplify the merging process.

Fixes #4653
2016-02-12 19:00:09 +00:00
Colin Surprenant
ad6cb41726 new Event#from_json method
from_json POC

add Event#from_json with corresponding specs

pre-inititalize error class constants

tests for Event#from_json

support array of events in from_json, upgrade to latest jackson

add test for partially invalid json array
2016-02-09 11:46:44 -05:00
Joao Duarte
7d8d6e4c7a better documentation on agent/runner/pipeline methods
Fixes #4520
2016-02-05 12:44:52 +00:00
Joao Duarte
e32f732dba support multiple pipeline reloading and other cleanups
* serialize upgrade_state and running_pipelines?
* remove useless @thread from pipeline
* remove agent registry and cleanup
* reduce reload_interval from 5 to 3
* remove useless MissingAgentError class
* fix exit codes for reload_state failures
* explain why thread var exists in agent.rb
* properly pass backtrace exceptions to oops
* remove is_config_test from loader

Fixes #4520
2016-02-05 12:44:52 +00:00
Joao Duarte
34ed3c3475 add reload config flag and allow reload through sighup
* move signal handling to runner
* add "-r" flag to detect changes in config and reload
* make SIGHUP reload config file
* make agent execute either loop to detect changes or sleep forever
* sigint/sigterm shut down the agent.execute task
* stop agent if pipeline terminates

Fixes #4520
2016-02-05 12:44:52 +00:00
Joao Duarte
e38d815ecb reload config from files
Fixes #4520
2016-02-05 12:44:52 +00:00
Andrew Cholakian
a90ed32d6d Pluggable agents
Fixes #4520
2016-02-05 12:44:52 +00:00
Suyog Rao
a3f4376f21 Make Java 8 as minimum required
Oracle marked the EOL of Java 7 in April 2015, and as of July 2015 they no longer provide downloads for Java 7.

Fixes #3877

Fixes #4626
2016-02-04 18:43:56 +00:00
Andrew Cholakian
1c79d92a99 Add specs to code around flusher initialization order
Fixes #4623
2016-02-04 16:41:33 +00:00
Pier-Hugues Pellerin
41c78372a2 Hide milestone confusing message to the user
This PR change the log level when a user load a plugin with a milestone
option to debug instead of warn.

Fixes: #4562

Fixes #4603
2016-02-03 23:52:30 +00:00
Pier-Hugues Pellerin
4e45dba8fd Fix a warning in the tests
When running the test for the `ShutdownWatcher` in the full suite, the
logger of the class was incorrectly setup, this PR make sure we use a
silent logger instead.

Fixes #4581

Fixes #4582
2016-01-28 20:12:50 +00:00
Pere Urbon-Bayes
711965437f add test to verify that a cloned codec is only registerd once
Fixes #4533
2016-01-21 16:33:58 +00:00
Guy Boertje
1a4032b436 Better method of ensuring that args are not mutated by plugin initialize
add test for subclasses of codec, filter, input and output

Register codec clone, use String clone not dup so frozen strings stay so

Fixes #4444

Fixes #4473
2016-01-14 14:15:55 +00:00
Joao Duarte
69ca10a9d2 distinguish between user set and default pipeline settings 2016-01-13 10:36:17 +00:00
Joao Duarte
d8ba25b04b rename pipeline-worker settings to symbols
Fixes #4430
2016-01-07 18:58:39 +00:00
Andrew Cholakian
e492ff3aba Add debug log for determining the number of output workers for output delegator
Fixes #4391
2016-01-07 17:19:08 +00:00
Andrew Cholakian
f6ff16eaab Improve OutputDelegator implementation and specs.
Backwards compatibility is now implemented for existing workers_not_supported uses.

This clears up a few bugs in the initial pass as well.

Fixes #4391
2016-01-07 17:19:08 +00:00
Andrew Cholakian
57f8b657ed Improved semantics for OutputDelegator This commit greatly improves the semantics for the OutputDelegator. It now: * Has an API for declaring if an output is threadsafe to avoid instance creation * By default sets the number of workers for an output to be == the number of pipeline workers * Moves the worker safe API to the class, not instance level * Strongly enforces the worker safety API * Should provide better performance for threadsafe plugins
Fixes #4391
2016-01-07 17:19:08 +00:00
Pier-Hugues Pellerin
9d876fa8b3 Replace def #{type}_func with define_singleton_method
When you run multiples pipeline and the config code get evaluated, on
every evaluation the class cached is clear, everytime you were calling a
`func` method you had the latest evaluated code. The `filter_func` and
the `output_func` need to be unique for every instance of the pipeline,
this PR replace the `def` with a `define_single_method` call ensuring
the uniqueness of the code on every instance.

This PR is based on #4254

Fixes #4298
2016-01-06 20:11:21 +00:00
Joao Duarte
be914390f2 rename ShutdownController to ShutdownWatcher
slightly adjust the metaphor for the class that is responsible for
monitoring a pipeline's shutdown process, report on its status and
intervene if it's stalled
2016-01-05 17:34:15 +00:00
Pier-Hugues Pellerin
bed04ccfbf Add a WrappedSynchronousQueue#offer method
Expose the Java's `#offer` method of the `SynchronousQueue` class,
This method allow the input developper to correctly apply back pressure
to the network clients.

If you use `#push` it will block forever until the pipeline free some
space, this behavior is sufficient if the pipeline outputs are healthy.
But if the output stale the backpressure will be applied up to the input
(producers) when reading a file this scenario is fine since we will just
stop reading the file until the thread unblock again.

In the context of network clients, the story is a bit different the
clients will timeout and try to reconnect to restransmit their payload
creating multiple new connection thread block on the queue. In some case
this will lead into a OOM issues.

This PR is the first step to communicate that the queue is under
pressure.

Fixes #4408
2016-01-05 14:33:28 +00:00
Andrew Cholakian
a6147909c9 Warn on potential memory issues when a large number of inflight messages are present
Fixes #4410
2016-01-04 19:14:14 +00:00
Pier-Hugues Pellerin
066e778f63 Allow the Agent to define some identifier
This PR allow the user to set the name of the logstash instance with the
`-n` or `--name` option, if no name is provided the agent will fallback
to the current hostname of the machine.

This PR also add the `node_uuid` to the agent which is unique between
each new instance of the agent, it will lazy generate a UUID v4 on
invocation.

Fixes: #4353

Fixes #4356
2015-12-18 15:10:32 +00:00
Andrew Cholakian
3a1b0f200e Use a simple timer thread for flushes instead of a task
Fixes #4340
2015-12-15 18:51:45 +00:00
Andrew Cholakian
028576ba6f Next generation pipeline
Fixes #4340
2015-12-15 18:51:45 +00:00
Joao Duarte
00a99c19e5 refactor concerns of runner, agent and pipeline
* move cli argument handling from agent to runner
* add a short-help message
* add interactive shell option
* log fatal messages to terminal when logging to file
* change docs:generate task to use bundle exec

Fixes #3872
2015-11-25 12:11:36 +00:00
Joao Duarte
5db1d28742 add shutdown controller to force exit on stalled shutdown
* start logstash with --allow-unsafe-shutdown to force_exit on stalled shutdown
* by default --allow-unsafe-shutdown is disabled
* stall detection kicks in when SIGTERM/SIGINT is received
* check if inflight event count isn't going down and if there are blocked/blocking plugin threads
2015-11-19 16:09:29 +00:00
guyboertje
b51608a907 add provision for worker threads based on threadsafe workers
updates requested by code review

changes requested by colin: make workers override from -w arg

do not set workers unless user actually specified it via cmdline

fix defaults printing

add describe block to improve test output readability

Closes #4130
2015-11-17 12:15:44 +00:00
Colin Surprenant
d74d41cb30 logstash-core & logstash-core-event extraction to support logstash-core-event-java impl, relates to #4191
fixed timezone issue

extracted logstash-core and reorganized specs

extracted logstash-core-event

extract java Event into logstash-core-event-java in a proper gem

remove obsolete jruby_event bootstrapping

fix require path

add java code bootstrap

use logstash-core-event/logstash-core-event.rb

remove obsolete files

basic instructions

LogStash::Json need to be initialized from event

update jruby and gradle versions

update compile:logstash-core-event-java rake task

WIP tasks refactor

fix gem.files

skip test if class is not defined

fix gem related tasks for new structure

add gem spec dirs in core tests

bootstrap java implementation when requiring timestamp

new Cloner class and Event clone impl

fix array fields assignments, see #4140

don't rely on json implementation ordering

fix skipped last iterpolation char

remove implementation specific unnecessary check

also require ruby classes

define error class in ruby

raise exception on invalid format

remove implementation specific tests and extract and put logger related test in pending

missing bits for having all core timestamp specs pass

run all core specs

remove leftover

comment regex

missing encoding header

revert to logstash-core-event by default

finished proper gemification

useless require

dynamically pick specs depending on logstash-core-event-* implementation

logstash root package version

missing file for proper gemification

do not build java event by default

always check for root logstash lib dir

fix concurrent-ruby version confict

fix rebase conflict

re-enable specs

user vars instead of constants

move non core code in bootstrap

document version files

move version file

remove useless code

use version in logstash-core

fix gem files list

put back concurrent-ruby version constrain as in master

add dependency on logstash-core-event

remove dependency on logstash-core to avoid circular dependency

fix rebase conflict

remove circular dependency

fix specs

update README
2015-11-16 16:40:19 -05:00