Commit graph

305 commits

Author SHA1 Message Date
Suyog Rao
e583cffed9 bump version to 5.3.3 (#7171) 2017-05-19 14:23:36 -07:00
TAC
4bfb8c403b Fix missing log4j2.properties file on Windows
fix Issue #6352

On Windows, Logstash can't find log4j2.properties file with above message at startup.
```
Could not find log4j2 configuration at path /LS_HOME/config/log4j2.properties.
```

Fixes #6903
2017-05-03 19:30:43 +00:00
Colin Surprenant
3f1644aab5 rephrase pipeline creation error message, fixes #6968 2017-04-26 10:16:58 -05:00
Suyog Rao
242159a5ee bump tp 5.3.2 (#6942) 2017-04-20 08:35:54 -07:00
Joao Duarte
635dfa1e72 pass namespaced metric to output plugin instance 2017-04-10 17:38:32 +01:00
Suyog Rao
3788ef9c87 Bump version to 5.3.1 (#6849) 2017-03-28 10:26:32 -07:00
DeDe Morton
5a4f2f6232 Fix typo
Fixes #6845
2017-03-27 14:27:22 -04:00
Joao Duarte
a83692c228 fix logic of logging configs
Fixes #6789
2017-03-02 15:01:10 -05:00
Suyog Rao
65205a0d81 Don't show config content when reload is not triggered
Fixes #6720
2017-02-16 16:43:57 -05:00
Colin Surprenant
3885fc5a9a cleanup partially initialized pipeline
DRY the plugin registration

typo

log exception message
2017-02-14 14:37:42 -05:00
Colin Surprenant
e784f0c8aa support exclusive locking of PQ dir access
fix agent and pipeline and specs for queue exclusive access

added comments and swapped all sleep 0.01 to 0.1

revert explicit pipeline close in specs using sample helper

fix multiple pipelines specs

use BasePipeline for config validation which does not instantiate a new queue

review modifications

improve queue exception message
2017-02-14 14:36:47 -05:00
Pier-Hugues Pellerin
f594e64319 Collecting the ThreadCount and the PeakThreadCount should not trigger a threaddump
When we use the JRMonitor library to get information about the running
threads it will trigger a thread dump to get the stacktrace information this OK when
we do a direct call to the `hot_threads` API but in the context of the
periodic poller this would mean that the threads need to be stopped to
generate their current stacktrace.

Which could significantly slow down logstash. This PR use the **ThreadMXBean** but only use the `#getThreadCount` and the `#getPeakThreadCount`. Theses two calls won't generate a hreaddump and won't block the currents
threads.

**To test** add the following options to your `config/jvm.options` and let logstash run for a few minutes to trigger a few periodic poller iteration and stop logstash you will see the report.

```
-XX:+PrintSafepointStatistics
-XX:PrintSafepointStatisticsCount=1
```

Fixes: #6603

Fixes #6705
2017-02-14 13:14:00 -05:00
Suyog Rao
bb1c56e6a0 Better asciidoc formatting and text for ID option
Fixes #6679
2017-02-09 14:39:21 -05:00
Suyog Rao
5434d2b798 Revert to 5.3.0 version instead of 5.4.0 (#6673) 2017-02-08 21:05:09 -08:00
Suyog Rao
cb9e8cf7c9 Revert to 5.4.0 version instead of 5.5.0 (#6672) 2017-02-08 20:33:32 -08:00
Suyog Rao
530c5fc43d Bump to v5.5 (#6670)
* Bump to v5.5
2017-02-08 19:38:07 -08:00
TAC
7abd136d00 Fix document format about plugin id
Fixes #6636
2017-02-08 14:39:19 -05:00
Jordan Sissel
2957c8f150 Do not show the configuration content anymore. Plugin validation errors and other config problems are more specifically logged before we get to this point, and showing the full config can too easily obscure a more actional 'you used an invalid setting' kind of error.
Fixes #6654
2017-02-07 19:27:10 -05:00
Joao Duarte
acdd400e97 add setting class that coerces value to array
Fixes #6630
2017-02-07 06:42:57 -05:00
Joao Duarte
ffa9c710a2 make SafeURI class clone deeper
Fixes #6645
2017-02-06 17:29:26 -05:00
Colin Surprenant
eba90f911d refactor agent pipeline reloading to avoid double live pipelines with same settings
extracted BasePipeline class to support complete config validation

minor review changes

added comment
2017-02-03 18:17:47 -05:00
Joao Duarte
4d28c401f0 fix shutdown watcher reports
since 5.x introduced log4j2 as the main logging mechanism, it's
necessary to be more explicit when logging complex objects.

In this case we tell the logger to use the .to_s version of the Snapshot
report generated by the Watcher.
The Snapshot#to_s calls .to_simple_hash.to_s

Fixes #6628
2017-02-02 10:28:48 -05:00
Joao Duarte
f5601ecbd7 propagate pipeline.id to api resources
this removes explicit references to the "main" pipeline,
using instead the value of the `pipeline.id` from LogStash::SETINGS

Fixes #6606
2017-01-30 12:46:20 -05:00
Joao Duarte
d6d0c672ae ensure pipeline.id is correctly propagated
Fixes #6530
2017-01-26 11:15:36 -05:00
Joao Duarte
b4c7c97452 include pipeline id in queue path
create queue sub directory based on pipeline id

Fixes #6540
2017-01-26 10:27:04 -05:00
Pier-Hugues Pellerin
6f9fb96818 Refactor non_reloadable_plugin
Instead of using a list of non reloadable plugin we add a new class
method on the base plugin class that the plugin will override.

By default we assume that all plugins are reloadable, only the stdin
shouldn't be reloadable.

Fixes #6499
2017-01-25 08:55:46 -05:00
Joao Duarte
0d47a362d0 fix return value of start_pipeline when start_workers fails
during Agent#start_pipeline a new thread is launched that executes
a pipeline.run and a rescue block which increments the failed reload counter

After launching the thread, the parent thread will wait for the pipeline
to start, or detect that the pipeline aborted, or sleep and check again.

There is a bug that, if the pipeline.run aborts during start_workers,
the pipeline is still marked as `ready`, and the thread will continue
running for a very short period of time, incrementing the failed reload
metric.

During this period of `pipeline.ready? == true` and `thread.alive? == true`,
the parent check code will observe all the necessary conditions to
consider the pipeline.run to be succesful and thus increment the success
counter too. This failed reload can then result in both the success and
failure reload count being incremented.

This commit changes the parent thread check to use `pipeline.running?`
instead of `pipeline.ready?` which is the next logical state transition,
and ensures it is only true if `start_workers` runs successfuly.

Fixes #6566
2017-01-20 06:47:14 -05:00
Joao Duarte
705ad54443 improve user facing error when yaml is incorrect
Fixes #6546
2017-01-19 12:14:21 -05:00
Pier-Hugues Pellerin
fdc4c15e46 review comments
Fixes #6498
2017-01-16 12:28:37 -05:00
Pier-Hugues Pellerin
8e57042e25 Extract the creation of the queue into a factory
I've move the initialization code into a factory for future work on the
pipeline.

Fixes #6498
2017-01-16 12:28:37 -05:00
Suyog Rao
c9391e964e Renamed cgroups metric to number_of_elapsed_periods
Renamed number_of_periods to number_of_elapsed_periods to be consistent with ES.

Fixes #6536
2017-01-16 12:20:16 -05:00
Tal Levy
bca87bae40 remove current_size_in_bytes and acked info from node stats
re #6508.

- removed `acked_count`, `unacked_count`, and migrated `unread_count` to
top-level `events` field.
- removed `current_size_in_bytes` info from queue node stats

Fixes #6510
2017-01-09 19:19:28 -05:00
Suyog Rao
9fc093e484 Bump version to 5.3.0 for 5.x branch (#6483) 2017-01-04 08:54:42 -08:00
Mykola Shestopal
4c4330ec2f Fixed calculation of took_in_millis for #6476
Fixes #6481
2017-01-04 11:43:56 -05:00
Colin Surprenant
8c4d8b83fc avoid resetting inexisting tags field back to empty array plus specs
Fixes #6477
2017-01-03 22:31:31 -05:00
Pier-Hugues Pellerin
94a67cb4e0 Record the execution time for each output in the pipeline
Record the wall clock time for each output a new `duration_in_millis`
key will now be available for each output in the api located at http://localhost:9600/_node/stats

This commit also change some expectations in the output_delegator_spec
that were not working as intended with the `have_received` matcher.

Fixes #6458
2016-12-29 12:51:41 -05:00
Pier-Hugues Pellerin
7715fabdc2 Initialize the metric values in the batch to the correct type
When we were initilizing the `duration_in_millis` in the the batch we
were using a `Gauge` instead of a counter, since all the object have the
same signature when the were actually recording the time the value was
replaced instead of incremented.

Fixes #6465
2016-12-29 11:12:32 -05:00
Pier-Hugues Pellerin
6250974508 Code cleanup for the collector observer
We have more the responsability of watching the collector inside the
input itself, this feature might come back when we have a new execution
model that can be improved in watching metrics. But this would require
more granular watchers.

No tests were affected by this changes since the code that required that
features was already removed.

Fixes: #6447

Fixes #6456
2016-12-29 08:59:52 -05:00
Pier-Hugues Pellerin
cc5b283035 Do not log a warning if a plugin is not from in #print_notice_version
When a plugin is loaded using the `plugins.path` option or is from a
universal plugin there no gemspec can be found for the specific plugin.

We should not print any warning on that case.

Fixes: #6444

Fixes #6448
2016-12-21 09:44:37 -05:00
Pier-Hugues Pellerin
ad763c81a3 Initialize with default values global events and pipeline events related metric
The metric store has no concept is a metric need to exist so as a rule
of thumb we need to defined them with 0 values and send them to the
store when we initialize something.

This PR make sure the batch object is recording the right default values

Fixes: #6449

Fixes #6450
2016-12-21 09:43:29 -05:00
Joao Duarte
90c364e903 ensure metric collection is disabled when metric.collect is false
Fixes #6445
2016-12-21 07:20:23 -05:00
Joao Duarte
a9e474f0e1 add tests for webserver metric
Fixes #6385
2016-12-19 12:43:25 -05:00
Joao Duarte
b314800abc add webserver metric
Fixes #6385
2016-12-19 12:43:25 -05:00
Pier-Hugues Pellerin
f0ab5fd955 rename cgroup usage to usage_nanos to align with ES' api
Fixes #6428
2016-12-16 10:19:59 -05:00
Tal Levy
f8b4c72a49 add queue stats to node/stats api (#6331)
* add queue stats to node/stats api

example queue section:

```
"queue" : {
    "type" : "persisted",
    "capacity" : {
      "page_capacity_in_bytes" : 262144000,
      "max_queue_size_in_bytes" : 1073741824,
      "max_unread_events" : 0
    },
    "data" : {
      "free_space_in_bytes" : 33851523072,
      "current_size_in_bytes" : 262144000,
      "storage_type" : "hfs",
      "path" : "/logstash/data/queue"
    },
    "events" : {
      "acked_count" : 0,
      "unread_count" : 0,
      "unacked_count" : 0
    }
}
```

Closes #6182.

* migrate to use period metric pollers for storing queue stats per pipeline
2016-12-15 13:19:08 -08:00
Pier-Hugues Pellerin
a611ebf64f Add cgroup information to the api
When logstash is run under a linux container we will gather statistic about the cgroup and the
cpu usage. This information will should in the /_node/stats api and the result will look like this:

```
  "os" : {
    "cgroup" : {
      "cpuacct" : {
        "usage" : 789470280230,
        "control_group" : "/user.slice/user-1000.slice"
      },
      "cpu" : {
        "cfs_quota_micros" : -1,
        "control_group" : "/user.slice/user-1000.slice",
        "stat" : {
          "number_of_times_throttled" : 0,
          "time_throttled_nanos" : 0,
          "number_of_periods" : 0
        },
        "cfs_period_micros" : 100000
      }
    }
  }
```

Fixes: #6252

Fixes #6357
2016-12-15 15:46:38 -05:00
Jordan Sissel
69c3bc21d4 Remove unnecessary log4j-1.2-api depedency.
This library provides a "log4j 1.2"-like API from the log4j2 library.

We don't seem to use this, and including it seems to be the cause of the
Logstash log4j input rejecting log4j 1.x's SocketAppender with this
message:

    org.apache.log4j.spi.LoggingEvent; class invalid for deserialization

The origin of this error is that log4j2's log4j-1.2-api defines
LoggingEvent without `implements Serializable`.

This commit also includes regenerated gemspec_jars.rb and
logstash-core_jars.rb.

Reference: https://github.com/logstash-plugins/logstash-input-log4j/issues/36

Fixes #6309
2016-12-14 02:19:57 -05:00
Suyog Rao
564bb7d41e Expose stats the right way
Fixes #6367
2016-12-13 00:59:24 -05:00
Pier-Hugues Pellerin
37fc21c2dc Do not include Utils, this could cause some bad references on the LogStash::Environment in the context of stand alone gems
Fixes #6377
2016-12-08 15:00:55 -05:00
Guy Boertje
23df3d1506 Allow for exception instances to get serialized in JSON logging 2016-11-30 15:45:45 -08:00