kibana/x-pack/plugins/dataset_quality
Yngrid Coello df0a21cac1
[Dataset quality] Added malformed docs column to table (#172462)
Closes https://github.com/elastic/kibana/issues/170220.

### Changes
- New endpoint added to query malformed docs in elasticsearch `GET
/internal/dataset_quality/data_streams/malformed_docs`
- Decoded response from apis in `data_streams_stats_client.ts` as
suggested by @tonyghiani in
https://github.com/elastic/kibana/pull/171777.
- New synthtrace scenario, malformed logs, where we ingest documents
that will have `_ignored` properties.
- Malformed Docs column was added to `columns.tsx`.

#### Demo


07a76f13-a837-4621-9366-63053a51b489

### How to test?
1. Go to
https://yngrdyn-deploy-kiban-pr172462.kb.us-west2.gcp.elastic-cloud.com/app/observability-log-explorer/dataset-quality
2. `Malformed docs` column should be present and should be sortable

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 14:33:37 +01:00
..
common [Dataset quality] Added malformed docs column to table (#172462) 2023-12-05 14:33:37 +01:00
public [Dataset quality] Added malformed docs column to table (#172462) 2023-12-05 14:33:37 +01:00
scripts
server [Dataset quality] Added malformed docs column to table (#172462) 2023-12-05 14:33:37 +01:00
jest.config.js
kibana.jsonc [Dataset quality] Implementing Dataset Table + consuming plugin from observability log explorer (#171777) 2023-11-23 22:57:33 +01:00
README.md
tsconfig.json [Dataset quality] Added malformed docs column to table (#172462) 2023-12-05 14:33:37 +01:00

Dataset Quality

In order to make ongoing maintenance of log collection easy we want to introduce the concept of dataset quality, where users can easily get an overview on the datasets they have with information such as integration, size, last activity, among others.

Development

Tests

Unit tests

Kibana primarily uses Jest for unit testing. Each plugin or package defines a jest.config.js that extends a preset provided by the @kbn/test package. The following command runs all Dataset quality unit tests:

yarn jest --config x-pack/plugins/dataset_quality/jest.config.js

You can also run a specific test by passing the filepath as an argument, e.g.:

yarn jest --config x-pack/plugins/dataset_quality/jest.config.js x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams/get_data_streams.test.ts

API integration tests

Option Description
--server Only start ES and Kibana
--runner Only run tests
--grep Specify the specs to run
--grep-files Specify the files to run
--inspect Add --inspect-brk flag to the ftr for debugging
--times Repeat the test n number of times

The API tests are located in x-pack/test/dataset_quality_api_integration/.

Start server and run test (single process)

node x-pack/plugins/dataset_quality/scripts/api [--help]

The above command will start an ES instance on http://localhost:9220, a Kibana instance on http://localhost:5620 and run the api tests. Once the tests finish, the instances will be terminated.

Start server and run test (separate processes)

# start server
node x-pack/plugins/dataset_quality/scripts/api --server

# run tests
node x-pack/plugins/dataset_quality/scripts/api --runner --grep-files=error_group_list