Commit graph

52 commits

Author SHA1 Message Date
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
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
Marco Antonio Ghiani
296025b1e7
[Stack Monitoring] Filter CCR list by currently viewed cluster (#148018)
## 📓 Summary

Closes #147224 

The issue was caused by the missing usage of the `clusterUuid` parameter
in the query used to retrieve the cluster followers and stats.

Adding a `term` condition for the cluster_uuid now retrieves only the
followers related to the interested cluster. In case a cluster has no
followers, an empty list will be returned by the endpoint.

This PR also adds stronger typing against the data returned by the
endpoint and adds some minor improvements.

## 🧪 Testing
Testing locally this PR requires some effort since is necessary to
create a multi-cluster locally.
Following [this
guide](https://github.com/elastic/kibana/blob/main/x-pack/plugins/monitoring/dev_docs/how_to/running_components_from_source.md#multi-cluster-tests-for-ccrccs-or-listing)
is possible to locally setup the 2 cluster and make one of them follow
the other.
Also, the new issue
[oblt#3279](https://github.com/elastic/observability-test-environments/issues/3279)
has been opened to have an easier way to access a multi-cluster setup
with oblt clusters.

### Before bugfix


https://user-images.githubusercontent.com/34506779/209954682-b519fcd3-888b-472a-8a1d-acf57ff5de05.mov

### After bugfix


https://user-images.githubusercontent.com/34506779/209954718-5045c49e-f113-42e5-aabf-81d2c5f53556.mov

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-04 08:16:28 +01:00
Kibana Machine
dbb135381b skip failing test suite (#146067) 2022-11-23 14:27:42 -05:00
Kibana Machine
a4e2571891 skip failing test suite (#146068) 2022-11-23 14:27:24 -05:00
Kevin Lacabane
5cf0d0f248
[Stack Monitoring] api tests for cluster and elasticsearch (#145138)
### Summary
Part of https://github.com/elastic/kibana/issues/119658

Add api integration tests for cluster and elasticsearch routes to
validate behavior when reading data ingested by elastic-agent.

We currently have a testing suite for legacy and another one for
metricbeat. Since metricbeat and agent documents only differ in their
metadata, for example agent will populate a `data_stream.*` property to
identify the document types while metricbeat uses `metricset.*`, the
tests assertion validating _business_ data should pass regardless of the
documents source. With this in mind the metricbeat tests were updated to
run the tests twice, one time with metricbeat data and a second time
with package data.

To generate the archives the `metrics-*` mappings were extracted with
esArchiver from an elasticsearch with the package installed, and the
documents were transformed from the metricbeat documents with [this
script](https://gist.github.com/klacabane/654497ff86053c60af6df15fa6f6f657).

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-22 14:02:50 +01:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
Sandra G
a5f410ecf7
[Stack Monitoring] add back api integration tests and update esArchiver data (#126998)
* comment tests back in for es, kibana, cluster, logstash

* comment tests back in for APM and update data to ECS .monitoring-beats-8-mb

* add beats integration tests and update archive data

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-03-08 08:13:58 -05:00
Mat Schaffer
aafb7be138
Revert "[Stack Monitoring] api_integration - Ignore logs section of index detail api" (#126559) 2022-03-01 14:12:25 +01:00
Mat Schaffer
5ec3206bf8
[Stack Monitoring] api_integration - Ignore logs section of index detail api (#126427) 2022-02-28 11:07:03 +01:00
Sandra G
eb17b10203
[Stack Monitoring] compatibility for agent data streams (#119112)
* update queries for elasticsearch package

* fix unit test

* add gitCcs helper function

* modify rest of es queries

* update logstash and kibana queries to use new createQuery

* change beats and apm to use new createQuery

* update changeQuery and remove old one

* make getIndexPattern take request to check for ccs

* fix unit test

* fix unit tests

* update queries and createQuery

* don't add metric constant without dataset in query

* fix types

* fix type

* comment out mb tests

* fix unit test

* fix unit test

* fix

* fix function param

* change to getMetrics name

* change to node_stats

* comment out metricbeat tests

* fix types

* improve types and readability for test

* remove passing of data stream type for now

* add tests for createQuery changes

* update getNewIndexPatterns to take one dataset

* add unit test for getNewIndexPatterns

* fix types

* remove metrics from filter, update tests

* update createNewIndexPatterns to accept new config instead of legacy

* update alert queries to include datas stream index patterns

* update comment

* fix defaulting ccs to * for non cluster requests

* update elasticsearch enterprise module

* update unit test

* remove data_stream.type from queries

* change entsearch to metricbeat module name enterprisesearch

* undo ccs cluster stats change

* fix import

* update alert queries

* fix unit test

* update unit test

* change shard size query to use filter

* change must to filter fix

* update findSupportedBasicLicenseCluster index pattern

* add ccs param to cluster request functions

* update queries for ccs in get_clusters_from_request

* update getBeatsForClusters query

* update clusters apm query

* update enterprisesearch query

* move index pattern to query in fetch for alerts, fix ccs

* remove metricbeat config from alert tests

* fix ts

* add metricset.name back to queries

* comment tests back in

* remove enterprise search checking for standalone cluster to fix test

* update es index metricset name from index_stats to index for mb data

* fix type

* fetchClusters creates index pattern

* fix type

* remove monitoring.ui.metricbeat.index from config and usage in getCollectionStatus

* fix type

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-20 17:13:23 -05:00
Kevin Lacabane
3dcfdef1eb
[Stack monitoring] adapt ES queries to updated document structure (#121641)
* adapt ES queries to updated document structure

* lint

* Revert "lint"

This reverts commit 2ad61e406c.

* Revert "adapt ES queries to updated document structure"

This reverts commit 25d4357dd2.

* fix cluster state property accesses

* only query index_recovery with ecs compliant indices

* lint

* setup/teardown to support datastreams

* lint

* update _mb archived data to target .monitoring index

* load archive with useCreate for datastream compatibility

* Revert "update _mb archived data to target .monitoring index"

This reverts commit 7bad361fd1.

* ignore non-elasticsearch archived documents

* Revert "ignore non-elasticsearch archived documents"

This reverts commit 26daeb7066.

* use correct index for archived documents

* add datastream lifecycle helper for api-integration tests

* use datastream lifecycle methods

* transform ccr_mb archive

* clean up datastreams

* lint

* load _mb data

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-23 12:22:31 +01:00
Sandra G
f9488f41f7
[Stack Monitoring] remove usage of fields being removed in ES segments, update tests (#118106)
* remove usage of fields being removed in es, update tests

* add Lucene to title of fixed_bit_set_memory_in_bytes instead of generic IndexMemoryMetric class

* update fixtures for integration tests

* remove index segment count

* update translations

* remove usage of fields being removed in es, update tests

* add Lucene to title of fixed_bit_set_memory_in_bytes instead of generic IndexMemoryMetric class

* update fixtures for integration tests

* remove index segment count

* update translations

* Revert "remove index segment count"

This reverts commit d56ce6e746.

* Revert "remove index segment count"

This reverts commit d56ce6e746.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-16 09:08:51 -05:00
Spencer
f466ebf1a3
[esArchiver] drop support for --dir, use repo-relative paths instead (#101345)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-08 17:37:42 -04:00
Chris Roberson
c9ce295a0b
[Monitoring] Ensure Stack Monitoring UI works with metricbeat-* indices (#96205)
* WIP

* WIP

* Remove unnecessary fields

* Work on node detail page

* Cluster overview looking good

* Index page

* Fix types

* ML jobs

* CCR

* CCR

* We just need total here

* Standalone cluster fix

* Re-enable logstash

* FIx jest test

* Fix tests

* Fix tests

* Fix unused import

* Add new MB-based archives

* Add actual archives

* Fix types

* Add this file back in

* Fix tests and add more

* Update whitelist

* Renames

* Renames

* Only do ccs if enabled

* Updates

* Comment out

* More tests passing

* Another passing test

* More passing, yay

* Forgot to add the actual tests, wow

* CCR

* Fix CI issues

* Missed a field here

* Kibana tests passing

* Fix type issues

* Fix type

* Fix types

* Good chunk of logstash work

* Fix types

* Fix jest test

* Fix issue with get usage in logstash code

* Fix small bug here

* Update archives with proper mappings

* Handle both legacy and mb fields properly

* Fixes

* Fix jest test

* Fix issue

* Getting setup tests in a better state

* Only beats is failing now, which is good

* Progress on cluster listing

* Functional tests passing!

* More progress on cluster tests

* More cluster work

* Fix test

* Last recovery working

* Fix types

* Fix tests

* More tweaks

* Fix snapshot

* Use stats instead of kibana_stats

* Use node and node_stats for logstash

* Beats tests passing

* APM tests passing

* API tests passing!

* Fix types

* Fix tests

* Renames beats-with-restarted-instance archive dirs

Kebab case is disallowed for all newly added files.

* Renames logstash-pipeline dirs

Kebab case disallowed for all new files

* Renames multi-basic dirs

Kebab case disallowed for all new files

* Renames singlecluster-* dirs

Kebab case disallowed for all new files

* Fixes inaccurate path change for archive setup

* Reverts changes to rebuild_all script

Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-23 11:54:32 -04:00
Brandon Kobel
4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Chris Roberson
1e8f2f66eb
[Monitoring] Some progress on making alerts better in the UI (#81569)
* Some progress on making alerts better in the UI

* Handle edge case

* Updates

* More updates

* Show kibana instances alerts better

* Stop showing missing nodes and improve the detail alert UI

* WIP

* Fix the badge display

* Okay I think this is finally working

* Fix type issues

* Fix tests

* Fix tests

* Fix alert counts

* Fix setup mode listing

* Better detail page view of alerts

* Feedback

* Sorting

* Fix a couple small issues

* Start of unit tests

* I don't think we need this Mock type

* Fix types

* More tests

* Improve tests and fix sorting

* Make this test more resilient

* Updates after merging master

* Fix tests

* Fix types, and improve tests

* PR comments

* Remove nextStep logic

* PR feedback

* PR feedback

* Removing unnecessary changes

* Fixing bad merge issues

* Remove unused imports

* Add tooltip to alerts grouped by node

* Fix up stateFilter usage

* Code clean up

* PR feedback

* Fix state filtering in the category list

* Fix types

* Fix test

* Fix types

* Update snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-13 10:20:29 -05:00
restrry
bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
Tyler Smalley
1bcf848e46
Sets min_doc_count=0 for parent histogram of derivative aggregation (#61390)
From the docs: The specified metric must be numeric and the enclosing
histogram must have min_doc_count set to 0 (default for histogram
aggregations).

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-derivative-aggregation.html#search-aggregations-pipeline-derivative-aggregation

This is now enforced, and currently failing the promotion of the current
Elasticsearch build

Related to https://github.com/elastic/kibana/pull/61387

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-03-25 22:22:04 -07:00
Tyler Smalley
30a512d831 Temporarily disable tests caused by possible ES regression
https://github.com/elastic/kibana/issues/61366

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-03-25 15:35:33 -07:00
Chris Roberson
bf7c25332e
[Monitoring] Fetch shard data more efficiently (#54028)
* For the nodes listing page, do not fetch shard data for indices

* Optimize our shard queries for the index and node listing pages

* This change isn't necessary

* Rename file and function

* Use optimized query for ml jobs and es overview

* Apply to node/index detail page, and more renaming

* Unnecessary change

* Fix tests

* Add basic tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 14:06:54 -05:00
Chris Roberson
75447e5ae1
[Monitoring] Add error state for unstructured logs (#53299)
* Add error state for unstructured logs

* Fix tests
2019-12-17 15:54:47 -05:00
spalger
8e9a8a84dc autofix all violations 2019-12-13 23:17:13 -07:00
Andrea Del Rio
2ce0f789bb
[Monitoring] Sass cleanup (#51100) 2019-11-27 12:32:49 -08:00
renovate[bot]
5b375df8e9 Update moment related packages (#46849)
* Update moment related packages

* unify moment version in yarn.lock

* adapt ro pluralization fixes

* update some bad pluralization in fixtures/snapshots
2019-10-28 12:07:35 -07:00
Chris Roberson
1c3c0bcc66
[Monitoring] Server side pagination for ES Nodes listing table (#47224)
* Got the basics working

* Preserve the sorting after calling getNodes

* Remove debug

* Fix issue where the loading state wasn't persisted as long as it needed to be

* Fix shardCount and isOnline not working properly

* Remove this test, as it doesn't make sense with server side sorting

* Ensure we properly await these clicks

* Fix api tests

* Fix tests and add some for pagination/sorting/filtering

* Fix and add a test here

* Add get_node_ids test

* Add setup mode support in the SSP table

* We need to wait for the table to finish loading now that we're sorting on the server

* Also wait for the table to finish loading when filtering

* Use different i18n id

* Fix issue where we expect data but it isn't there
2019-10-08 09:37:40 -04:00
Mike Place
629623a24e
[Stack Monitoring] Add I/O metrics for Elasticsearch (#45870)
* I/O metrics POC

* Gather correct metric for total

* Remove io stats from advanced

* Move io stats to node overview page

* Add new io metrics

* Add new io metrics

* Add note about supported platforms

* Update snapshot

* Add warning about platforms to all metrics

* Another snapshot update

* Update type and units

* Remove errant trailing comma

* Snapshot update for new types

* Add node_io integration testing
2019-09-19 09:57:55 +00:00
Mike Place
1d24c8b4a4
[Stack Monitoring] Re-order items in segment count legend (#43752)
* Switch the order of primaries and total in legend

* Revert "Switch the order of primaries and total in legend"

This reverts commit 895960af10.

* Reorder legend items

* Functional test fixes
2019-08-26 10:11:04 +00:00
Mike Place
15c43b73ef
Add disk space percentage to node listing (#42145)
* Add disk space percentage to node listing

* Test modification for totalSpace

* Fix test mockup

* Add totalSpace to fixture

* Test fixup

* Remove trailing space per review suggestion

* More fixture updates

* More fixture update

* More fixture updates

* Update mock

* More fixture changes
2019-08-03 12:03:57 +00:00
Mike Place
40611cac20
Adjust GC label in Stack Monitoring application (#41437)
* Adjust GC label

* Modify to 'GC Rate' per review suggestion

* Test fixup
2019-07-18 15:56:52 +00:00
Chris Roberson
6a3aadc9f2
[Monitoring] Introducing Logs UI (#31275)
* Initial implementation

* More logs UI work

* Remove unnecessary code

* Add support to build a logs url based on the cluster and/or node uuid

* Deep link directly

* Update link

* Use CCS to access remote filebeat data

* Fix existing tests

* Add log specific api integration tests

* Localization

* Adding more localization

* Adding unit tests for logs ui

* Client side unit tests, configuration for log fetch count, adding visual callout for why we can't detect logs

* Remove debug

* Fix localization issue

* Update tests

* PR feedback

* Update import

* Format the count to avoid a huge string of numbers

* Use @timestamp instead

* Handle scenario where the time period is not right but the type exists

* Update jest tests

* Update api tests

* Text changes

* Add periods

* Update tests
2019-04-15 08:45:47 -04:00
Spencer
2e232c2e31
[@kbn/expect] "fork" expect.js into repo (#33761)
* [@kbn/expect] "fork" expect.js into repo

* [eslint] autofix references to expect.js

* [tslint] autofix all expect.js imports

* now that expect.js is in strict mode, avoid reassigning fn.length
2019-03-25 09:56:48 -07:00
Mike Place
4e9b7ef112
Minor change to stack monitoring tooltips (#31855)
* Minor change to stack monitoring tooltips

In the Linux documentation and source code, cgroups are always referred to without
capitalization and should be here as well.

* Update Jest snapshots

* Update more test fixtures
2019-03-04 20:45:23 +00:00
Chris Roberson
13e533177e
[Monitoring] Skip tests for cloud (#30879)
* Skip tests for cloud

* Add TODOs
2019-02-13 23:19:29 -05:00
Chris Roberson
fba727b2c0
[Monitoring] Address some UI regressions with shard allocation (#29757)
* Address some UI regressions with shard allocation

* Renable the shard tests, and a couple others that are disabled

* PR feedback
2019-02-04 15:15:09 -05:00
Peter Pisljar
7b688066a8
skipping failing tests (#26877) 2018-12-10 16:24:37 +01:00
Chris Roberson
25896d625d
Re-enable these tests (#24600) 2018-11-05 14:57:02 -05:00
Chris Roberson
af3e62131d
[Monitoring] Rename ccr fields based on changes in ES (#24519)
* Rename ccr fields based on changes in ES

* More renames

* Update archive data

* Update snapshot

* Skip the api integration tests for now
2018-10-25 12:30:58 -04:00
Nicolas Ruflin
e8451ad40a
Add latency to index and node Elasticsearch stats (#22625)
Closes https://github.com/elastic/kibana/issues/22503
2018-10-23 19:26:30 +02:00
Chris Roberson
f382ee2d89
Fixes from the demo (#23922) 2018-10-18 09:05:27 -04:00
Chris Roberson
0dcef1ed1d
Fix tests for #23013 (#23883) 2018-10-05 13:22:35 -04:00
Chris Roberson
2caf6ecb4f
[Monitoring] CCR UI (#23013)
* Initial version of CCR monitoring UI

* Adding missing files

* Use icons

* Use new column header text

* Update tests

* Basic of shard detail page

* Do these in parallel

* Disable time picker on ccr page

* Remove summary for now

* Remove unnecessary code here

* Fix a few things on the shard page

* Only send down what we need

* update snapshot

* Handle no ccr_stats documents

* Ensure we fetch the latest

* Updates

* Format the time

* Add api integration tests

* Adding pagination and sorting

* Updated query logic

* Change this back

* Add specific information about the follower and leader lag ops

* Update tests

* UI updates

* Address PR issues

* Fix tests

* Update shapshots

* Add timestamp

* Update tests

* Add a few snapshot tests

* Use timezone formatter

* Fix tests

* Fix aligment of shard table

* PR feedback

* Update snapshots

* Update snapshot
2018-10-05 08:46:21 -04:00
Chris Roberson
9ba4c9ac6b
[Monitoring] Ensure we use the provided node id in the query (#23715)
* Ensure we use the right parameter name

* Update test fixture to use second node
2018-10-03 12:26:54 -04:00
Chris Earle
2f082208f6
[Monitoring] Ignore Duplicate Shards (#21057)
[Monitoring] Ignore Duplicate Shards

This eliminates duplicate shards from the shard table by actively ignoring
them from the response.
2018-07-24 16:04:11 -04:00
Chris Roberson
92dd341f5c
[Monitoring] Use 0 as the default for shard count if the node is not found (#21000)
* Use 0 as the default for shard count if the node is not found

* Remove debug

* Updating snapshot tests

* Update api integration test
2018-07-24 12:56:10 -04:00
Tim Sullivan
f8bdc7d22a
[Test/Cleanup] Remove console.log (#21002) 2018-07-19 13:42:47 -07:00
Tim Sullivan
cbd319f92c
[Monitoring] Fix Node Advanced page (#19740)
* [Monitoring] Fix Node Advanced page

* fix metrics snapshot
2018-06-07 17:05:43 -07:00
Tim Sullivan
d649f02c07
Monitoring/directives use react view elasticsearch (#19362)
* [Monitoring/React] Make Elasticsearch directives use React component internally

* fix more functional tests

* remove TODO

* lessen loc change
2018-05-23 16:57:37 -07:00
Tim Sullivan
782d4d9804
[Monitoring/React] Render ES Indices Listing with Base Controller / React (#18595)
* [Monitoring/React] Render ES Indices Listing with Base Controller

Refactors the ES Indices Listing to use Base Controller and a React component instead of an Angular directive

* fix functional tests

* fix another test

* better default for summary status component

* nicer code for whitespace after label

* apiFn => apiUrlFn

* Deleted / Closed
2018-05-09 21:37:24 -07:00
Tim Sullivan
3332143d14
[Monitoring/Test] More indices listing tests to prep for refactoring (#18758) 2018-05-03 09:16:31 -07:00