-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dev] Add High Cardinality Indexer to Kibana as kbn-data-forge #174559
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
- Remove default logger to allow user to override - removing HCI index prefixes; adding cleanup; adding generate; overriding client; overriding logger; - Updating test to replace infra-forge with data-forge - Adding codeowners for kbn-data-forge - Fixing the paths for the ECS generate command - Implimenting cli options - Fixing spelling errors - Running yarn kbn bootstrap - Removing depricated faker.random.numeric - Shaping the data correctly for the tests - Fixing config for each test - Fixing jest.config.js - second attempt at fixing jest.config.js - Attempting to fix the document count test - Attempting to fix the document count test - Fixing types - Removing depreciated installTemplate function and coresponding templates - Fixing tests to be more robust so they don't execute until the source documents are available. - Fixing typo - Adding changes to burn rate rule - Fixing document checks
6f92aee
to
52562a3
Compare
Sorry... I had to force push. Somehow, the last merge commit changes a bunch of unrelated files which in turn triggered a bunch of reviews that were unnecessary. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Tested locally and work as expected! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested locally and reviewed the test changes 👍🏻
dataForgeConfig = { | ||
schedule: [ | ||
{ | ||
template: 'good', | ||
start: 'now-15m', | ||
end: 'now+5m', | ||
metrics: [ | ||
{ name: 'system.cpu.user.pct', method: 'linear', start: 2.5, end: 2.5 }, | ||
{ name: 'system.cpu.total.pct', method: 'linear', start: 0.5, end: 0.5 }, | ||
{ name: 'system.cpu.total.norm.pct', method: 'linear', start: 0.8, end: 0.8 }, | ||
], | ||
}, | ||
], | ||
indexing: { dataset: 'fake_hosts' as Dataset, eventsPerCycle: 1, interval: 10000 }, | ||
}; | ||
dataForgeIndices = await generate({ client: esClient, config: dataForgeConfig, logger }); | ||
await alertingApi.waitForDocumentInIndex({ indexName: DATA_VIEW, docCountTarget: 360 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
…ic#174559) ## Summary This PR adds the [High Cardinality Indexer](https://github.com/elastic/high-cardinality-cluster) to Kibana as a new package called `kbn-data-forge`. It also replaces `kbn-infra-forge` usage in the test and is the preferred way to generate data for Observability use cases, specifically for SLO testing. ### Todo - [x] Replace `kbn-infra-forge` usage - [x] Create convenience functions for testing (`generate` and `cleanup`) - [x] Make the logger (`LoggingTool`) configurable as an injected dependency - [x] Make the Elasticsearch client (`Client`) configurable as an injected dependency - [x] Fix the ECS Generate commands - [x] Add CLI options via Commander ### CLI Help Screen ``` Usage: data_forge.js [options] A data generation tool that will create realistic data with different scenarios. Options: --config <filepath> The YAML config file --lookback <datemath> When to start the indexing (default: "now-15m") --events-per-cycle <number> The number of events per cycle (default: 1) --payload-size <number> The size of the ES bulk payload (default: 10000) --concurrency <number> The number of concurrent connections to Elasticsearch (default: 5) --index-interval <milliseconds> The interval of the data in milliseconds (default: 60000) --dataset <dataset> The name of the dataset to use. Valid options: "fake_logs", "fake_hosts", "fake_stack" (default: "fake_logs") --scenario <scenerio> The scenario to label the events with (default: "good") --elasticsearch-host <address> The address to the Elasticsearch cluster (default: "http://localhost:9200") --elasticsearch-username <username> The username to for the Elasticsearch cluster (default: "elastic") --elasticsearch-password <password> The password for the Elasticsearch cluster (default: "changeme") --elasticsearch-api-key <key> The API key to connect to the Elasticsearch cluster --kibana-url <address> The address to the Kibana server (default: "http://localhost:5601") --kibana-username <username> The username for the Kibana server (default: "elastic") --kibana-password <password> The password for the Kibana server (default: "changeme") --install-kibana-assets This will install index patterns, visualizations, and dashboards for the dataset --event-template <template> The name of the event template (default: "good") --reduce-weekend-traffic-by <ratio> This will reduce the traffic on the weekends by the specified amount. Example: 0.5 will reduce the traffic by half (default: 0) --ephemeral-project-ids <number> The number of ephemeral projects to create. This is only enabled for the "fake_stack" dataset. It will create project IDs that will last 5 to 12 hours. (default: 0) -h, --help output usage information ``` ### Testing an Example Run the following command against a clean Kibana development enviroment: ``` node x-pack/scripts/data_forge.js --events-per-cycle 200 --lookback now-1h --install-kibana-assets --ephemeral-project-ids 10 --dataset fake_stack ``` This should install a handful of DataViews (Admin Console, Message Processor, Nginx Logs, Mongodb Logs) along with a few dashboards and visualizations. --------- Co-authored-by: kibanamachine <[email protected]>
Summary
This PR adds the High Cardinality Indexer to Kibana as a new package called
kbn-data-forge
. It also replaceskbn-infra-forge
usage in the test and is the preferred way to generate data for Observability use cases, specifically for SLO testing.Todo
kbn-infra-forge
usagegenerate
andcleanup
)LoggingTool
) configurable as an injected dependencyClient
) configurable as an injected dependencyCLI Help Screen
Testing an Example
Run the following command against a clean Kibana development enviroment:
This should install a handful of DataViews (Admin Console, Message Processor, Nginx Logs, Mongodb Logs) along with a few dashboards and visualizations.