an Automated Functional Testing (AFT) library providing logging to an AWS Kinesis Firehose endpoint for any TestResult
objects logged via the aft-core.ReportingManager
> npm i aft-reporting-awskinesis
to send values to AWS Kinesis Firehose endpoints you must specify the AWS Credentials, the AWS Region Endpoint and the AWS Kinesis Delivery Stream. These take the following form in your aftconfig.json
:
{
"plugins": [
{"name": "kinesis-reporting-plugin", "searchDir": "./node_modules/"}
],
"KinesisReportingPluginConfig": {
"logLevel": "info",
"region": "us-west-1",
"deliveryStream": "your-frehose-delivery-stream",
"batch": true,
"batchSize": 10,
"sendStrategy": "logsandresults"
}
}
-
logLevel - an optional
LogLevel
to be used by this plugin (defaults to value set inAftConfig.logLevel
orwarn
if unset) -
region - a
string
containing the AWS region where the Kinesis Firehose stream is located. values likeeu-west-1
orus-west-2
are expected. -
deliveryStream - a
string
containing the name of the Kinesis Firehose stream to send through. If using Elasticsearch as your back-end storage, this would be the Elasticsearch index to use. -
batch - an optional
boolean
indicating whether logs should be batched before forwarding to Kinesis Firehose (defaults totrue
) -
batchSize - an optional
number
representing the number of log records to batch before sending (defaults to 10) -
sendStrategy - an optional
string
oflogsandresults
,logsonly
orresultsonly
that controls sending of log messages and results (defaults tologsandresults
)
the AWS Credentials are first attempted to be read from AFT Configuration and if no value is specified then the following are checked:
- Environment Variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
- EC2 Metadata: also known as instance profile credentials
- Shared Ini File: read from the host system
- ECS Credentials: similar to the EC2 Metadata, but on ECS
- Process Credentials: any credentials set on the current process
the log record that is sent to your AWS Kinesis Firehose endpoint will have the following format:
{
"logName": "if used with an AftTest this will be the 'description' or 'Test IDs' or a GUID",
"message": "this is the actual message being logged",
"level": "warn",
"version": "3.0.0",
"buildName": "Jenkins or Team City Job Name",
"buildNumber": "Jenkins or Team City Job Number",
"machineInfo": {
"ip": "234.9.10.11",
"name": "CETH-ARG-WIN10",
"user": "SYSTEM"
}
}
-
logName - the
logName
passed to this plugin when loaded from theReportingManager
-
message - the
string
being logged by some component -
level - a
string
value from one of theaft-core.LoggingLevel
values based on the level of the message being logged -
version - the current version of the
KinesisReportingPlugin
-
buildName - a
string
retrieved from theBuildInfoManager.getBuildName
function -
buildNumber - a
string
retrieved from theBuildInfoManager.getBuildNumber
function -
machineInfo - an
aft-core.MachineInfoData
object containing the following:-
ip - a
string
of the machine's IP address -
name - a
string
of the machine's name -
user - a
string
of the currently logged in user who executed the tests
-
ip - a
{
"logName": "if used with an AftTest this will be the 'description' or 'Test IDs' or a GUID",
"result": {
"testId": "1234",
"resultMessage": "the final result was a SUCCESS!",
"status": "passed",
"resultId": "dbbf6fce-14db-4bd2-ba31-e3fa68d719e4",
"created": 1655289028279,
"metadata": {
"durationMs": 12345,
"buildName": "Test Build",
"buildNumber": "23"
}
},
"buildName": "Jenkins or Team City Job Name",
"buildNumber": "Jenkins or Team City Job Number",
"machineInfo": {
"ip": "234.9.10.11",
"name": "CETH-ARG-WIN10",
"user": "SYSTEM"
}
}
-
logName - the
logName
passed to this plugin when loaded from theReportingManager
-
result - an
TestResult
object containing the following:-
testId - a
string
containing any unique ID for the test result being recorded -
resultMessage - a
string
message of the final result -
status - a
string
representing theaft-core.TestStatus
value -
resultId - a
string
containing a unique identifier for theTestResult
-
created - a
number
containing the date and time theTestResult
was created as milliseconds since the epoch -
metadata - an
object
that can contain additional data for theTestResult
-
testId - a
-
version - the current version of the
KinesisReportingPlugin
-
buildName - a
string
retrieved from theBuildInfoManager.getBuildName
function -
buildNumber - a
string
retrieved from theBuildInfoManager.getBuildNumber
function -
machineInfo - an
aft-core.MachineInfoData
object containing the following:-
ip - a
string
of the machine's IP address -
name - a
string
of the machine's name -
user - a
string
of the currently logged in user who executed the tests
-
ip - a