Route test data to Fluent Bit flexibly.
This system can be run locally with a local Fluent Bit process or compiled to a docker image and run with a sidecar aws-for-fluent-bit container.
The purpose of Firelens-Datajet is to abstract test configuration from implementation code
It does so by running tests based on a single JSON file and outputing the results.
Future work on this system involves making a REST interface for tests to be invoked by sending a POST request with the test configuration and responding with a test result JSON as the response.
The current driver.ts does not support multiple stages, however the core does support async and sync stages as well as validators.
The goal of this project is to eventually encapsulate test stages, validation wrappers, and data transmission in a portable JSON which can be sent to this program and executed at runtime.
Prerequisite Installation Instructions for Amazon Linux
To install NodeJS on Amazon Linux, use the following commands
See the /examples folder for a set of testing configuration files.
The simplest way to configure FireLens Datajet test framework is with a firelens-datajet.json file.
Find an example JSON from the /examples folder and copy it to ./firelens-datajet/firelens-datajet.json.
If you haven’t installed the FireLens Datajet dependencies, then run npm install from the root of the repository.
Then build and run the testing system with npm start.
A good first example to use is /examples/tcp-forward-file-input/firelens-datajet.json. This example shows Fluent Bit build and
executed, then logs sent in parallel to tcp, forward, and file inputs, and logs, instrumentation data, and byproducts from tail
output plugin captured. You can see this in the ./firelens-datajet/output folder. A new output/fluent-lock-hash folder will
be created in the output folder to help organize testing results. The hash is a hash of the Fluent Bit source commits, and the
Fluent Bit configuration template. Commits and config template are automatically documented in the output/fluent-lock-hash folder.
Individual tests will be added to this folder in a subfolder and timestamped.
After running the test, take a look at the auto-generated output folder’s contents
Firelens datajet can be contained in a Docker image.
Create docker image
make
ECR quick publish procedure
make publish tag="0.1.0"
Test Definition
Firelens Datajet currently supports configuration only with file, environment variable, and request.
Documentation on the format of a test definition is still in progress, but in summary, the test definition
chooses from a data generator which generates data
sends data via a datajet which outputs data in a way that is accessable to Fluent Bit
sets some values such as batch rate and batch limits
In the future, test definitions should support multiple
synchronous and asynchronous stages, as well as validation wrappers.
Clients
Clients are methods for obtaining test configuration and can be selected and configured via environment variables.
The following clients are supported:
Request: tests are posted to the url/execute endpoint
File: tests description found in file
Environment: tests description is found as environment variable
A single or multiple clients can be selected with the environment variable CLIENT
# A variable number of clients can be selected
CLIENTS='["environment", "request", "environment"]'
Client Configuration
Other environment variables are used to configure specific clients
Request
CLIENTS='["request"]'
# Provide an access token to secure the /execute endpoint
CLIENT_REQUEST_ACCESS_TOKEN=<access_token>
# Change the port FirelensDatajet client listens on
CLIENT_REQUEST_PORT=3334
Firelens Datajet
Route test data to Fluent Bit flexibly. This system can be run locally with a local Fluent Bit process or compiled to a docker image and run with a sidecar aws-for-fluent-bit container.
The purpose of Firelens-Datajet is to abstract test configuration from implementation code It does so by running tests based on a single JSON file and outputing the results.
Future work on this system involves making a REST interface for tests to be invoked by sending a POST request with the test configuration and responding with a test result JSON as the response.
The current driver.ts does not support multiple stages, however the core does support async and sync stages as well as validators. The goal of this project is to eventually encapsulate test stages, validation wrappers, and data transmission in a portable JSON which can be sent to this program and executed at runtime.
Prerequisite Installation Instructions for Amazon Linux
To install NodeJS on Amazon Linux, use the following commands
CMake will also need to be installed if Execution wrappers are used, as the testing framework can manage Fluent Bit compilation via CMake.
Setup instructions
To run Firelens Datajet locally please install NPM: https://nodejs.org/en/ and run the following commands
A .env file can be added to the project to configure environment variables while testing locally. The file might look something like:
Examples
See the
/examplesfolder for a set of testing configuration files. The simplest way to configure FireLens Datajet test framework is with a firelens-datajet.json file./examplesfolder and copy it to./firelens-datajet/firelens-datajet.json.npm installfrom the root of the repository.npm start.A good first example to use is
/examples/tcp-forward-file-input/firelens-datajet.json. This example shows Fluent Bit build and executed, then logs sent in parallel to tcp, forward, and file inputs, and logs, instrumentation data, and byproducts from tail output plugin captured. You can see this in the./firelens-datajet/outputfolder. A newoutput/fluent-lock-hashfolder will be created in the output folder to help organize testing results. The hash is a hash of the Fluent Bit source commits, and the Fluent Bit configuration template. Commits and config template are automatically documented in theoutput/fluent-lock-hash folder. Individual tests will be added to this folder in a subfolder and timestamped. After running the test, take a look at the auto-generated output folder’s contentsContainerization
Firelens datajet can be contained in a Docker image.
Create docker image
ECR quick publish procedure
Test Definition
Firelens Datajet currently supports configuration only with file, environment variable, and request. Documentation on the format of a test definition is still in progress, but in summary, the test definition
In the future, test definitions should support multiple synchronous and asynchronous stages, as well as validation wrappers.
Clients
Clients are methods for obtaining test configuration and can be selected and configured via environment variables. The following clients are supported:
A single or multiple clients can be selected with the environment variable CLIENT
Client Configuration
Other environment variables are used to configure specific clients
Request
Environment
File
(this client may need to be updated to allow for root access)
Request Client
Environment variables
Generating the ACCESS_TOKEN
Set environment variable ACCESS_TOKEN to the following and save the value.
Example Request
The following request uses the increment data generator and forwards logs to Fire Lens via stdout datajet
Example Response
Example ECS Task Configuration
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.