npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aft-reporting-aws-kinesis-firehose

v12.1.1

Published

Automated Functional Testing (AFT) reporting plugin package supporting test reporting to AWS Kinesis Firehose

Downloads

30

Readme

AFT-reporting-AWSKinesis

an Automated Functional Testing (AFT) library providing logging to an AWS Kinesis Firehose endpoint for any TestResult objects logged via the aft-core.ReportingManager

Installation

> npm i aft-reporting-awskinesis

Configuration

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",
        "assumeRoleArn": "optional-iam-role-needed-for-sending-to-firehose",
        "assumeRoleDuration": 900
    }
}
  • logLevel - an optional LogLevel to be used by this plugin (defaults to value set in AftConfig.logLevel or warn if unset)
  • region - a string containing the AWS region where the Kinesis Firehose stream is located. values like eu-west-1 or us-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 to true)
  • batchSize - an optional number representing the number of log records to batch before sending (defaults to 10)
  • sendStrategy - an optional string of logsandresults, logsonly or resultsonly that controls sending of log messages and results (defaults to logsandresults)
  • assumeRoleArn - an optional string containing a valid AWS IAM Role ARN that should be assumed following acquring the AWS Credentials so that the plugin can send to the Firehose stream
  • assumeRoleDuration - an optional number containing the number of seconds the assumed role should remain valid (defaults to 900)

NOTE:

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

Format of log records

the log record that is sent to your AWS Kinesis Firehose endpoint will have the following format:

message logs

{
    "created": 1655289028279,
    "version": "11.2.1",
    "machineInfo": {
        "ip": "234.9.10.11",
        "name": "CETH-ARG-WIN10",
        "user": "SYSTEM"
    },
    "log": {
        "name": "if used with an AftTest this will be the 'description' or 'Test IDs' or a GUID",
        "level": "warn",
        "message": "this is the actual message being logged",
        "data": [
            "an array of optional values",
            {"foo": "bar", "baz": true}
        ]
    }
}
  • created - the elapsed milliseconds since the epoch representing when this log record was created
  • version - the current version of the KinesisReportingPlugin
  • 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
  • log - the LogMessageData object
    • name - the name passed to this plugin when loaded from the ReportingManager
    • level - a string value from one of the aft-core.LoggingLevel values based on the level of the message being logged
    • message - the string being logged by some component
    • data - an array of anything added to the log function call after the message

TestResult logs

{
    "created": 1655289028279,
    "version": "11.2.1",
    "machineInfo": {
        "ip": "234.9.10.11",
        "name": "CETH-ARG-WIN10",
        "user": "SYSTEM"
    },
    "result": {
        "created": 1655289028270,
        "testName": "this is the description from your test",
        "testId": "1234",
        "resultMessage": "the final result was a SUCCESS!",
        "status": "passed",
        "resultId": "dbbf6fce-14db-4bd2-ba31-e3fa68d719e4",
        "metadata": {
            "durationMs": 12345,
            "buildName": "Test Build",
            "buildNumber": "23",
        }
    }
}
  • created - the elapsed milliseconds since the epoch representing when this log record was created
  • version - the current version of the KinesisReportingPlugin
  • 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
  • result - an TestResult object containing the following:
    • created - a number representing the elapsed milliseconds since the epoch for when this result was created
    • 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 the aft-core.TestStatus value
    • resultId - a string containing a unique identifier for the TestResult
    • created - a number containing the date and time the TestResult was created as milliseconds since the epoch
    • metadata - an object that can contain additional data for the TestResult