Commit graph

10886 commits

Author SHA1 Message Date
Andres Rodriguez
3fee1429c4
Update platform_ingest_project_board.yml 2022-12-15 12:51:27 -05:00
Andres Rodriguez
115a310f26
Update platform_ingest_project_board.yml 2022-12-14 15:00:42 -05:00
Andres Rodriguez
284ff27958
Update platform_ingest_project_board.yml 2022-12-14 14:57:28 -05:00
Andres Rodriguez
e81019c89f
Update platform_ingest_project_board.yml 2022-12-14 14:39:08 -05:00
Andres Rodriguez
d2080b8796
Update platform_ingest_project_board.yml (#14814) 2022-12-14 14:34:04 -05:00
Andres Rodriguez
58b22a391b
Update platform_ingest_project_board.yml (#14813)
Fix actions to add docs
2022-12-14 14:28:03 -05:00
Andres Rodriguez
59c693a7b5
Update platform_ingest_project_board.yml (#14801)
Include automation for docs label.
2022-12-14 14:21:22 -05:00
Ry Biesemeyer
e121650e56
live timers: API boundary, implementation, opt-in (#14748)
* live timers: introduce API boundary

Introduces an API boundary for timers as a first-class metric, as described
in elastic/logstash#14675, and migrates all known internal timers to use the
new API boundary for tracked execution.

Please refer to the specification for details on motivations.

This commit is net zero change to behaviour, and introduces a single new
undocumented setting `metric.timers` to `logstash.yml`, which presently only
takes its default value `delayed` to indicate that delayed committing of
execution time is acceptable.

It implements the new `TimerMetric` API in a way that is also net-zero-change.
Tracked executions are still performed by marking a start time, performing
the tracked execution, and incrementing an underlying long-type counter with
the number of elapsed milliseconds _after_ execution has completed. This means
that long-running execution is still missing from the metric until it has
completed.

The new Timer API is available to both the Ruby- and the Java-based plugin APIs

* timer metrics: sub-package and add baseline tests

* WIP: move execution metric ownership out of queue

* noop: remove useless abstract method

Our `AbstractMetric` implements `Metric` and does not need to declare
an abstract override of `Metric#getType`. Doing so prevents interfaces
from providing a default override for all implementers.

* timer metric tests: extract util, refactor for reuse

* timers: accumulate milli-excess-nanos

* live timers: single-checkpoint implementation

* timer metric: use explicit type parameters to make intent clear

* remove unused imports

* use safe int conversion

* test fixup: use given name for tested metric

* test helper: TimerMetricFactory prefers nanotime supplier

* timers: flesh out test coverage, incl live-timers

* test: move validation of queue-read metrics to ObservedExecution

* flow: support non-moving denominator (±infinity)

* metrics: add metric config pass-through to env2yaml
2022-12-13 13:35:53 -08:00
Lisa Cawley
f21edfb7ea
[DOCS] Remove glossary from Logstash Reference (#14808) 2022-12-12 09:51:23 -08:00
kaisecheng
52d2d2e57a
update ci release file (#14807) 2022-12-12 13:54:54 +00:00
Mashhur
43d1c8cdf4
Logstash is logging unnecessary pipeline configuration. (#14779)
* Remove unnecessary IR graph loggings.

* Add the guides for protecting sensitive info leaking in the logs.

  `CONTRIBUTING.md` now contains the guide to prevent sensitive info leaking in the debug logs.

  Fixes: #14778
  Pull-request: #14779

* Add sample source codes to the `CONTRIBUTING.md`.

* Apply suggestions from code review

Contribution guide for using sensitive data in Logstash improved.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-12-07 15:11:26 +05:00
Andrea Selva
720996fa7c
Cover all #system invokation with exit code checking, eventually failing the execution of Rake task (#14782)
Covers all invocations of system Ruby method inside artifcts.rake script to check the exit status and eventually raise an exception.
2022-11-30 16:02:27 +01:00
Andrea Selva
7a39d97055
Avoid to create and upload AARCH64 Docker images for UBI8 (#14786)
On ARM architecture UBI8 Docker images aren't created, so avoid to create empty tar.gz files.
2022-11-29 11:21:08 +01:00
Andrea Selva
2e5e49d10d
[DRA] Avoid to loose err code on docker save (#14780)
* [DRA] Force docker save to save directly on file instead of pipe to another command loosing the execution error code
2022-11-28 16:47:04 +01:00
João Duarte
394abbd4b1
bump jruby to 9.3.9.0 (#14694)
fixes Encoding bug on Windows https://github.com/jruby/jruby/issues/7367
2022-11-28 15:35:10 +00:00
Andrea Selva
10d6530f8b
Forward port 8.5.2 release notes (#14775) 2022-11-23 11:10:51 +01:00
Andrea Selva
aa73187d93
Update CI used versions after 8.5.2 release (#14772) 2022-11-22 18:39:30 +01:00
Ry Biesemeyer
4941c25f32
fix: calculated inflight_count from in-flight batches (#14760)
During stalled shutdowns while waiting for in-flight batches to complete,
our shutdown watcher emits helpful information about what work is in flight,
including the actual threads and plugins that are still executing.

Since ~6.3.0, the `inflight_count` metric in this log message has always
been `0`, in part because of two somewhat-overlapping bugs:

 - elastic/logstash#8987 and elastic/logstash#9056 (7.0, 6.3) changed
   the `inflight_batches` map provided by the queue read clients to index
   batches by native thread id, but pipeline reporter continued to
   attempt to extract by ruby thread object. Because it does not find
   the thread in the "batch map", it reports zero.
 - elastic/logstash#9111 (7.0, 6.3) changed the _value_ stored in
   the `inflight_batches` map provided by a new common queue read client
   from an object responding to `#size` to a java `QueueBatch` which
   does not respond to `size`. If our pipeline reporter had been able to
   look up the queue batch, it would have failed with a `NoMethodError`.

We resolve the issue by (1) extracting the batch from our "batch map" using
the native thread id and (2) safely extracting the value from a `QueueBatch`
before falling through to `Object#size` or 0.
2022-11-18 01:49:52 -08:00
Mashhur
dd06ec53e9
Use aarch64 artifact arch for integration tests on Mac M1 (darwin) OS. (#14754) 2022-11-17 16:24:57 +05:00
Andrea Selva
25b4187392
Forward port releasenotes from 8.5.0 and 8.5.1 (#14763) 2022-11-17 12:23:23 +01:00
Rob Bavey
1f8ee249bb
Logstash Getting started with Kubernetes Guide (#14655)
This PR presents a getting started guide to working with Logstash in Kubernetes, and comes in three parts:

- A walkthrough of a sample scenario, setting up a Kubernetes cluster with 
  - Elasticsearch
  - Kibana
  - Filebeat to read Kubernetes API server logs and sent to Elasticsearch via Logstash
  - Logstash
  - Metricbeat to monitor Logstash
and walks through the setup of these files
- An annotated guide to these files
- Explanations of how Logstash configuration and settings files map to the Kubernetes environment


Relates #14576
Closes #14576 

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2022-11-16 16:06:56 -05:00
Andrea Selva
b40136c76c
Bump to 8.7.0 (#14755) 2022-11-16 16:34:29 +01:00
Andrea Selva
9242105c3c
[Doc] Document the usage of LS_JAVA_OPTS environment variable (#14738)
* [Doc] Document the usage of LS_JAVA_OPTS environment variable

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2022-11-15 08:53:45 +01:00
Andrea Selva
05bfaff799
Avoid the wrapping of LogstashMessageFactory with log4j's MessageFactory2Adapter (#14727)
Starting with Log4j2  2.6 if a subclass of MessageFactory associated with an Logger instance
is not subclass of MessageFactory2, then it's wrapped with MessageFactory2Adapter.

This trigger a log4j warn log that, when a class subclasses LogStash::Plugin for example, is noisy and report about
a Logger is not associated with the default MessagedFactory (LogstashMessageFactory) every time a subclass of Plugins is instantiated.

This commit adapt LogstashMessageFactory to implement the MessagedFactory2 instead of the older MessageFactory to avoid the wrapping with the adapter class.
2022-11-09 10:16:34 +01:00
kaisecheng
90aae6a6f3
[doc] Logstash Kubernetes - Persistent Storage Docs (#14714)
Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2022-11-04 20:40:47 +00:00
kaisecheng
6847ad80e1
[doc] Logstash Kubernetes - Stack Monitoring docs (#14696)
Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2022-11-04 20:40:24 +00:00
kaisecheng
7cc0646a26
[doc] Logstash Kubernetes - Securing Logstash (#14737)
Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2022-11-04 18:47:45 +00:00
Andrea Selva
c6880f226f
Update bundled JDK to 17.0.5+8 (#14728) 2022-11-03 15:12:27 +01:00
Andres Rodriguez
77009b253c
Add missing step (#14735) 2022-11-03 09:50:29 -04:00
Andres Rodriguez
531a4fa077
Add GitHub action to add issues to another project board. (#14733) 2022-11-03 09:38:49 -04:00
Andres Rodriguez
1dead06cdd
DRA: Build dockerfiles for release (#14730) 2022-11-03 09:14:44 -04:00
Andres Rodriguez
ef6852b687
DRA: uploading missing docker-build-context files (#14722) 2022-11-02 16:35:45 -04:00
Ry Biesemeyer
372a61219f
Fix pipelines yaml loading (#14713)
* source/multilocal: fix detection of empty pipelines.yml

Fixes a regression introduced in elastic/logstash#13883 in which the presence
of an empty `pipelines.yml` file produces an error message indicating that
the file cannot be read.

When either `YAML::load` or `YAML::safe_load` encounter an effectively-empty
payload (such as one that is entirely comments), they use a `fallback` param
to determine what value to emit, with the former emitting `false` and the
latter emitting `nil`.

This is problematic because a _separate_ blind-`rescue nil` causes `nil` to
be bound to the MultiLocal's `@detected_marker`, and we assume that a `nil`
value in the marker means that there was an exception reading the file (such
as a permissions issue or parse failure).

By providing a `fallback: false` directive when parsing the contents, we
ensure that an empty file is reported as such.

* source/multilocal: avoid `rescue nil` that loses helpful context

When the pipelines yaml cannot be read, or can be read but fails to parse,
the MultiLocal#read_pipelines_from_yaml emits a helpful exception including
specifics about why it failed to load or parse, but a blind `rescue nil`
here causes that helpful information to be lost.

When pipeline detection is exceptional, hold onto the helpful exception
so that it can be reported along with the config conflicts.

* source/multilocal: differentiate between reading and parsing failure

* source/multilocal: use translations for conflict messages

* source/multilocal: specs for error conditions
2022-11-02 11:05:01 -07:00
Ry Biesemeyer
9460d4d7fc
specs: assert presence of logging without risking NoMethodError (#14633)
* specs: assert presence of logging without risking NoMethodError

* Update qa/integration/specs/monitoring_api_spec.rb
2022-11-02 11:01:59 -07:00
kaisecheng
0c1dcc2334
[Doc] k8s troubleshooting (#14606)
doc for k8s troubleshooting and common issues

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2022-10-28 14:54:51 +01:00
Andres Rodriguez
dd399b62b2
Update add-docs-preview-link.yml (#14710)
Adds docsk8s/** to build preview links.
2022-10-27 11:09:10 -04:00
kaisecheng
cf54386d01
update release version (#14709) 2022-10-26 17:55:08 +01:00
kaisecheng
08072aae0b
update release file 7.17.8 (#14692) 2022-10-26 17:44:45 +01:00
Andres Rodriguez
2e8bd20cf5
DRA - Fix docker image build (#14706)
Fix the docker image building and upload process:
 * Builds ubi8 on x86_64.
 * Uploads ironbank and ubi8 context files from x86_64 only.
2022-10-26 11:20:50 -04:00
Andrea Selva
6ad5690a8c
Adds upload of missed docker docker-build-context.tar.gz artifacts (#14703)
Updates the dra_docker.sh script to upload also docker-build-context.tar.gz files
2022-10-26 12:15:55 +02:00
Andres Rodriguez
17d0bb5ffb
DRA - Fix error reporting (#14698)
Ensures the DRA build script surfaces a rake error, instead of allowing the build to continue.

This ensures that the build doesn't continue if any of the steps fails.

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2022-10-25 17:00:09 -04:00
Andres Rodriguez
6ba5cc112f
DRA - generalize docker image building (#14670)
* Generalize docker image building
* Rename and add ability to pass the architecture as a parameter
* Handle ARCH env variable
2022-10-24 12:50:11 -04:00
Andres Rodriguez
9584d1332b
DRA - fix dra_upload syntax, breaking builds (#14685)
Fix dra_upload.sh syntax that's breaking the build.
2022-10-22 13:02:34 -04:00
Andrea Selva
9c7b7b7454
[DRA] Don't download Darwin arrch64 for 7.17 (#14677)
Version 7.17 doesn't generate Darwin aarch64 artifacts. Don't download these artifacts from the GCS bucket, given that we don't build Darwin for that release.
2022-10-20 16:30:41 +02:00
Andres Rodriguez
86a18e6e3f
Exclude jruby's bundler from artifacts (#14667)
Exclude Jruby's bundler and rake from the built artifacts. The artifacts don't need to ship with such dependencies. Also, Logstash will bundle its own bundler for plugin management but it is not the one shipped with jruby.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-10-18 11:13:02 -04:00
Andres Rodriguez
393460025e
Fix sourcing on dra_upload (#14659)
Fix sourcing on dra_upload.sh
2022-10-17 12:55:47 -04:00
Andres Rodriguez
8bfc7ef164
Fix dra_common sourcing (#14657)
Fixes the source of dra_common.sh. It will now first check the directory of the file from which this dra_common.sh script is being called. This allows the common script to be sourced regardless of where the sourcing script is being called from.
2022-10-17 11:09:56 -04:00
Andres Rodriguez
5b1d53622c
DRA: Improve shell scripts for debuggability (#14654)
The changes remove some code duplication by introducing a common file that can be sourced between all scripts. It also improves debuggability by adding better messages.
2022-10-17 10:23:26 -04:00
Mashhur
f19e9cb647
Collect queue growth events and bytes metrics when PQ is enabled. (#14554)
* Collect growth events and bytes metrics if PQ is enabled: Java changes.

* Move queue flow under queue namespace.

* Pipeline level PQ flow metrics: add unit & integration tests.

* Include queue info in node stats sample.

* Apply suggestions from code review

Change uptime precision for PQ growth metrics to uptime seconds since PQ events are based on seconds.

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>

* Add safeguard when using lazy delegating gauge type.

* flow metrics: simplify generics of lazy implementation

Enables interface `FlowMetrics::create` to take suppliers that _implement_
a `Metric<? extends Number>` instead of requiring them to be pre-cast, and
avoid unnecessary exposure of the metrics value-type into our lazy init.

* flow metrics: use lazy init for PQ gauge-based metrics

* noop: use enum equality

Avoids routing two enum values through `MetricType#toString()`
and `String#equals()` when they can be compared directly.

* Apply suggestions from code review

Optional.ofNullable used for safe return. Doc includes real tested expected metric values.

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>

* flow metrics: make lazy-init wraper inherit from AbstractMetric

this allows the Jackson serialization annotations to work

* flow metrics: move pipeline queue-based flows into pipeline flow namespace

* Follow up for moving PQ growth metrics under pipeline.*.flow.
- Unit and integration tests are added or fixed.
- Documentation added along with sample response data

* flow: pipeline pq flow rates docs

* Do not expect flow in the queue section of API. Metrics moved to flow section.

Update logstash-core/spec/logstash/api/commands/stats_spec.rb

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>

* Integration test failure fix.

Mistake: `flow_status` should be `pipeline_flow_stats`

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>

* Integration test failures fix.

Number should be Numeric in the ruby specs.

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>

* Make CI happy.

* api specs: use PQ only where needed

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
Co-authored-by: Ry Biesemeyer <ry.biesemeyer@elastic.co>
2022-10-13 15:30:31 -07:00
Andres Rodriguez
db6a7bc619
DRA: Handle env variables better (#14644)
* DRA: Handle env variables better
* Moved the addition of SNAPSHOT suffix to the version after the VERSION_QUALIFIER
* Fix badly assigned variable, version qualifier has to be appended also to PLAIN_STACK_VERSION and not RELEASE_VER

Co-authored-by: andsel <selva.andre@gmail.com>
2022-10-13 10:38:55 -04:00