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

@alertlogic/paws-collector

v2.2.6

Published

Alert Logic AWS based API Poll Log Collector Library

Downloads

280

Readme

paws-collector

Build Status ALPS build

Alert Logic AWS Based API Poll (PAWS) Log Collector Library.

Overview

This repository contains the AWS JavaScript Lambda function and CloudFormation Template (CFT) for deploying a log collector in AWS which will poll a 3rd party service API to collect and forward logs to the Alert Logic CloudInsight backend services.

Installation

Refer to the CF template readme for installation instructions.

How it works

Update Trigger

The Updater is a timer triggered function that runs a deployment sync operation every 12 hours in order to keep the collector lambda function up to date. The Updater syncs from the Alert Logic S3 bucket that contained the package used for the initial deployment.

Collection Trigger

The Collector function is an AWS lambda function which is triggered by SQS which contains a collection state message. During each invocation the function polls the specified 3rd party service log API and sends retrieved data to the AlertLogic Ingest service for further processing.

Checkin Trigger

The Checkin Scheduled Event trigger is used to report the health and status of the Alert Logic AWS lambda collector to the Azcollect back-end service based on an AWS Scheduled Event that occurs every 15 minutes.

Development

Creating New Collector Types

run npm run create-collector <<name>> <<version>> <<log-prefix>> to create a skeleton collector in the collectors folder.

Build

Clone this repository and build a lambda package by executing:

$ git clone https://github.com/alertlogic/paws-collector.git
$ cd paws-collector
$ make deps test package

Build collector for 3rd party API

Clone this repository and build a lambda package by executing:

$ git clone https://github.com/alertlogic/paws-collector.git
$ cd paws-collector/collectors/<collector-name>
$ make deps test package

The package name is al--collector.zip

Debugging

To get a debug trace, set a Node.js environment variable called DEBUG and specify the JavaScript module/s to debug.

E.g.

export DEBUG=*
export DEBUG=index

Or set an environment variable called "DEBUG" in your AWS stack (using the AWS console) for a collector AWS Lambda function, with value "index" or "*".

See debug for further details.

Invoking locally

In order to invoke lambda locally please follow the instructions to install AWS SAM. AWS SAM uses the default credentials profile from ~/.aws/credentials.

  1. Encrypt the key using aws cli:
aws kms encrypt --key-id KMS_KEY_ID --plaintext AIMS_SECRET_KEY
  1. Include the encrypted token, and KmsKeyArn, used in Step 1, inside the SAM yaml:
    KmsKeyArn: arn:aws:kms:us-east-1:xxx:key/yyy
    Environment:
        Variables:
  1. Fill in environment variables in env.json (including encrypted AIMS secret key) and invoke locally:
cp ./local/env.json.tmpl ./local/env.json
vi ./local/env.json
make test
make sam-local
  1. Please see local/event.json for the event payload used for local invocation.

Build artifact

  1. To build the single/individual collector :

    • a. Update ALPS_SERVICE_VERSION from collector package.json version.
    • b. Trigger the phrase base on the collector name once the pr is approved. ex. to create artifact for auth0 ,phrase will be build-collector-auth0
  2. To build all the collectors: There is two way of building the all collector as follow:

    1. Update the ALPS_SERVICE_VERSION for each collector as per package.json and trigger the common prase build-collectors once pr is approved.

      OR

    2. After pr is merge to master branch ,create the tag, which will build the single artifact for all collectors.