kibana/x-pack/plugins/observability
Xavier Mouligneau cf9e88c7d7
[RAC] ALerts table in observability (#103270)
Closes #98611

## Summary

Add alerts table in Observability => 

![image](https://user-images.githubusercontent.com/189600/123854490-c68ddf00-d8ec-11eb-897e-2217249d5fba.png)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

| Risk                      | Probability | Severity | Mitigation/Notes        |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. |
| Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. |
| [See more potential risk examples](https://github.com/elastic/kibana/blob/master/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2021-07-06 10:28:21 -06:00
..
.storybook Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
common Observability side navigation for cases and alerts (#102556) 2021-06-28 11:48:32 -05:00
public [RAC] ALerts table in observability (#103270) 2021-07-06 10:28:21 -06:00
scripts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
server [RAC] Fix rule registry write flag and turn it off by default (#103646) 2021-06-30 21:44:30 +02:00
typings [Uptime] Add Custom Fleet Integration UI (#91584) 2021-04-20 13:33:46 -04:00
jest.config.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
kibana.json [RAC] ALerts table in observability (#103270) 2021-07-06 10:28:21 -06:00
README.md [Observability] Fix README.md link to component (#100801) 2021-05-27 21:27:16 +02:00
tsconfig.json [RAC] ALerts table in observability (#103270) 2021-07-06 10:28:21 -06:00

Observability plugin

This plugin provides shared components and services for use across observability solutions, as well as the observability landing page UI.

Rules, Alerts, and Cases

The Observability plugin contains experimental support for improved alerting and case management.

If you have:

xpack.observability.unsafe.cases.enabled: true

In your Kibana configuration, the Cases page will be available.

If you have:

xpack.observability.unsafe.alertingExperience.enabled: true

In your Kibana configuration, the Alerts page will be available.

This will only enable the UI for this page when. In order to have alert data indexed you'll need to enable writing in the Rule Registry plugin:

xpack.ruleRegistry.write.enabled: true

When both of the these are set to true, your alerts should show on the alerts page.

Shared navigation

The Observability plugin maintains a navigation registry for Observability solutions, and exposes a shared page template component. Please refer to the docs in the component directory for more information on registering your solution's navigation structure, and rendering the navigation via the shared component.

Unit testing

Note: Run the following commands from kibana/x-pack/plugins/observability.

Run unit tests

npx jest --watch

Update snapshots

npx jest --updateSnapshot

Coverage

HTML coverage report can be found in target/coverage/jest after tests have run.

open target/coverage/jest/index.html

API integration testing

API tests are separated in two suites:

  • a basic license test suite
  • a trial license test suite (the equivalent of gold+)

This requires separate test servers and test runners.

Basic

# Start server
node scripts/functional_tests_server --config x-pack/test/observability_api_integration/basic/config.ts

# Run tests
node scripts/functional_test_runner --config x-pack/test/observability_api_integration/basic/config.ts

The API tests for "basic" are located in x-pack/test/observability_api_integration/basic/tests.

Trial

# Start server
node scripts/functional_tests_server --config x-pack/test/observability_api_integration/trial/config.ts

# Run tests
node scripts/functional_test_runner --config x-pack/test/observability_api_integration/trial/config.ts

The API tests for "trial" are located in x-pack/test/observability_api_integration/trial/tests.

API test tips

  • For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme)
  • To update snapshots append --updateSnapshots to the functional_test_runner command