Commit graph

19 commits

Author SHA1 Message Date
Carson Ip
32f6a78933
Fix typo in stack monitoring apm (#187875)
Fix typo in stack monitoring apm
2024-07-10 14:50:47 +01:00
Cristina Amico
966736e4b4
[Fleet] Add rate limiting to install by upload endpoint (#184036)
Fixes https://github.com/elastic/ingest-dev/issues/3217

## Summary

Add rate limiting to "install by upload" endpoint. 
Implemented with a cache that is set with the timestamp of each install
by upload, independently from the package name/version. If the time
elapsed since the last timestamp it's less than retry time (10s), the
endpoint will return `429 Too many requests`.

### Testing
- Upload a package with 
```
curl -XPOST -H 'content-type: application/zip' -H 'kbn-xsrf: true' http://localhost:5601/YOUR_PATH/api/fleet/epm/packages -u elastic:changeme --data-binary @PACKAGE_NAME.zip
```
- Upload another package shortly after. It can be the same one or
another one, as the rate limiting is applied across all uploads, no
matter the package name.
- If the second upload happens <10s after the first one, should return
error `429 Too Many Requests. Please wait 10s before uploading again.`

### Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-06 17:13:52 +02:00
Tiago Costa
bff17fe57f
skip flaky suite (#184853) 2024-06-05 20:38:46 +01:00
Tiago Costa
db3f866a0d
skip flaky suite (#184619) 2024-06-05 16:06:18 +01:00
Kibana Machine
d380098c1c skip failing test suite (#182783) 2024-05-23 12:06:52 -04:00
Pierre Gayvallet
148eeec0fe
Update supertest and superagent to latest version (#183587)
## Summary

Related to https://github.com/elastic/kibana/issues/7104

Update supertest, superagent, and the corresponding type package, to
their latest version.

(of course, types had some signature changes and we're massively using
supertest in all our FTR suites so the whole Kibana multiverse has to
review it)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-17 04:23:21 -07:00
Tiago Costa
188493afee
skip flaky suite (#177142) 2024-05-01 14:41:15 +01:00
Tre
63c3ef4808
[Es Archiver][Load Action] New Overridable Batch Size + Concurrency (#174631)
Adding new defaults for the stream batch size and concurrency.

Now, the default batch size is increased from 300 to 5000.
The default concurrency is set to 4.

## Summary of Performance Characteristics
Using a list of over 70 archives from within the repo, we've benchmarked
the speed before changing the performance characteristics, and after.

One champion example is the
`x-pack/test/functional/es_archives/getting_started/shakespeare`
archive.
It's load time decreased from **~2.5 minutes**, to less than **18
seconds**, in a serverless environment.

There are a little over a handful where the time actually got worse, but
most are only milliseconds slower.
None are a full second slower.


---------

Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-01-26 14:42:16 +00:00
Kevin Lacabane
b7f57a09cb
[Stack Monitoring] install packages before test suite runs (#165881)
## Summary

Closes https://github.com/elastic/kibana/issues/165043

Updates the approach to load packages in test suites by sending http
request before suite starts instead of using
`xpack.fleet.developer.bundledPackageLocation`

[Flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3075)
2023-09-08 13:32:30 +02:00
mohamedhamed-ahmed
2eb46924cb
[Stack Monitoring] Document count graph doesn't show exact number (#164809)
closes https://github.com/elastic/kibana/issues/164667

## 📝  Summary

This PR modifies the legend for `Document Count` graph in stack
monitoring to allow showing the exact document count when the user
hovers on a specific point.

##   Testing

1. Make sure to have any dummy index with millions of documents
2. Navigate to Indices tab in Stack Monitoring
3. Click on the created index and observe the Document Count Graph 
4. Hovering on any point should show the exact document count through
the legend below the graph

## 🎥 Demo


56747cf7-7914-4742-884a-9f9a9f59e9e6
2023-08-29 18:57:36 +02:00
Kevin Lacabane
bca80be144
[Stack Monitoring] fix beat api tests (#153466)
Closes https://github.com/elastic/kibana/issues/153123

### Summary
https://github.com/elastic/elasticsearch/pull/94400 added missing
aliases required by Stack Monitoring. Tests started to fail as they
expected the metrics related to these aliases to be empty since they
could not be queried, but now return associated data.
I've generated a new archive and updated the tests accordingly.

Tests use package build from
https://github.com/elastic/integrations/pull/5639.
2023-03-23 12:26:12 +01:00
Milton Hultgren
469c5a3761
[Monitoring] Support Metricbeat format for shard activity (#151983)
Related issue: https://github.com/elastic/beats/issues/34427

Since Metricbeat now reports the right fields, I've updated the UI to
consume those.

<img width="2935" alt="Screenshot 2023-02-23 at 12 00 05"
src="https://user-images.githubusercontent.com/2564140/220893266-1d82bc16-6bca-4eca-a5a1-1a1573eb139d.png">

Related PRs:
https://github.com/elastic/beats/pull/34653
https://github.com/elastic/elasticsearch/pull/94062
https://github.com/elastic/integrations/pull/5367

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-21 13:45:46 +01:00
Kevin Lacabane
e1579c8f4a
[Stack Monitoring] baseline kibana api tests for package and metricbeat data (#153184)
## Summary

Part of https://github.com/elastic/kibana/issues/148303

Port kibana api tests to the
[monitoring_api_integration](https://github.com/elastic/kibana/tree/main/x-pack/test/monitoring_api_integration)
suite. This reimplements all the existing tests with fresh data.

See [flaky test
run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2002)
2023-03-20 13:49:20 +01:00
Jonathan Budzenski
3d571bd836 skip suite failing es promotion (#153123) 2023-03-10 12:25:26 -06:00
Kevin Lacabane
ab7c879c23
[Stack Monitoring] baseline logstash api tests for package and metricbeat data (#152575)
## Summary

Closes https://github.com/elastic/kibana/issues/151158
Part of https://github.com/elastic/kibana/issues/148303

Port logstash tests to the
[monitoring_api_integration](https://github.com/elastic/kibana/tree/main/x-pack/test/monitoring_api_integration)
suite. This reimplements all the existing tests (plus missing ones for
the pipeline api) with fresh data.

See [flaky test
run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1982)
2023-03-08 14:26:05 +01:00
Kevin Lacabane
d9adcca543
[Stack Monitoring] implement baseline elasticsearch api tests for package and metricbeat data (#149161)
### Summary

Part of https://github.com/elastic/kibana/issues/148303
Closes https://github.com/elastic/kibana/issues/146067
Closes https://github.com/elastic/kibana/issues/146068

I investigated the failing tests but couldn't get to the root cause
quickly enough so I took the opportunity to port the tests to the
[monitoring_api_integration](https://github.com/elastic/kibana/tree/main/x-pack/test/monitoring_api_integration)
suite. This reimplements all the existing tests (plus missing ones for
the `ml_jobs` api) with fresh data.
By using the new testing approach we can remove the archived mappings
which greatly reduce execution times.

### Testing
- The suite was executed against by the [flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1804)
multiple times with no failures
- Test data is bundled in two archives (one for metricbeat and one for
package data) and can be loaded to verify their content: `node
scripts/es_archiver.js load
x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node/(package|metricbeat)
--es-url=http://elastic:changeme@localhost:9200
--kibana-url=http://elastic:changeme@localhost:5601`

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-30 17:01:00 +01:00
Kevin Lacabane
870f79df8c
[Stack Monitoring] support entsearch package (#148668)
### Summary

Update stack monitoring to read from data streams created by the
[enterprisesearch
package](https://github.com/elastic/integrations/pull/4926)

### Testing
- build [enterprisesearch
package](https://github.com/elastic/integrations/pull/4926)
- start stack: `elastic-package stack up -v -d --version
8.7.0-SNAPSHOT`; make sure your image contains [this
change](https://github.com/elastic/elastic-agent/pull/2121)
- start enterprisesearch service: `elastic-package service up -v`
- install elasticsearch integration with variables
- `hosts: http://host.docker.internal:9201; username: elastic; password:
changeme`
- install enterprisesearch integration with variables
- `hosts: http://host.docker.internal:3002; username: elastic; password:
changeme`
- connect [local
kibana](2d893bf40b/x-pack/plugins/monitoring/dev_docs/how_to/work_with_packages.md (connecting-a-local-kibana))
- navigate to Stack Monitoring on the local kibana, enterprise search
section shows up with populated graphs

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-30 13:43:13 +01:00
Kevin Lacabane
11f6f1b6ef
[Stack Monitoring] Clarify api tests validation (#148374)
## Summary

Clarified validation of new packages in API tests
2023-01-04 14:34:44 +01:00
Kevin Lacabane
5c9df67e8d
[Stack Monitoring] Beats package integration tests (#147755)
### Summary

**Sets up the foundations for
https://github.com/elastic/kibana/issues/146000**
- created a new test server under
`x-pack/test/monitoring_api_integration/` that allows loading of
packages at kibana startup
- a test runner utility which is a simple for loop executing the
supplied test twice, one time with `metricbeat` data and a second time
with `package` data
- a utility that allows transformation of package data into metricbeat
data

**Adds API tests for the beats package**
- created a test case for each API exposed
- removed the duplicates from
`x-pack/test/api_integration/apis/monitoring`

-----

_See the included
[README](b55de5c1cc/x-pack/test/monitoring_api_integration/README.md)
for additional details_

This directory defines a custom test server that provides bundled
integrations
packages to the spawned test Kibana. This allows us to install those
packages at
startup, with all their assets (index templates, ingest pipelines..),
without
having to reach a remote package registry.
With the packages and their templates already installed we don't have to
provide
the static mappings in the tests archives. This has the benefit of
reducing our
disk footprint and setup time but more importantly it enables an easy
upgrade path
of the mappings so we can verify no breaking changes were introduced by
bundling
the new versions of the packages.

_Note that while Stack Monitoring currently supports 3 collection modes,
the tests
in this directory only focus on metricbeat and elastic-agent data. Tests
for legacy
data are defined under `x-pack/test/api_integration/apis/monitoring`._

Since an elastic-agent integration spawns the corresponding metricbeat
module under
the hood (ie when an agent policy defines elasticsearch metrics data
streams,
a metricbeat process with the elasticsearch module will be spawned), the
output
documents are _almost_ identical. This means that we can easily
transform documents
from a source (elastic-agent) to another (metricbeat), and have the same
tests run
against both datasets.

Note that we don't have to install anything for the metricbeat data
since the mappings
are already installed by elasticseach at startup, and available at
`.monitoring-<component>-8-mb`
patterns. So we are always running the metricbeat tests against the
latest version of
the mappings.
We could have a similar approach for packages, for example by installing
the latest
packages versions from public EPR before the test suites run, instead of
using pinned
versions. Besides the questionable reliance on remote services for
running tests,
this is also dangerous given that packages are released in a continuous
model.
This means that whenever the test suite would execute against the latest
version
of packages it would be too late, as in already available to users.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-03 16:20:17 +01:00