Error tracking tool on AWS managed services.
JavaScript

README.md

faultline

Error tracking tool on AWS managed services.

logo

Table of Contents

Concept

Using framework

  • Serverless Framework ⚡️ (= v1.6.1)

AWS Resources

  • AWS Lambda
  • API Gateway
  • Amazon S3
  • Amazon DynamoDB
  • IAM

How to deploy

Clone

$ git clone https://github.com/k1LoW/faultline.git
$ cd faultline
$ npm install

Edit config

Copy config.default.yml to config.yml. And edit.

Deploy to AWS

$ AWS_PROFILE=XXxxXXX npm run deploy

Usage

POST errors to API

Example:

$ curl -X POST -H "x-api-key: xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX" -H "Content-Type: application/json" -d @sample-errors.json https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0/projects/sample-project/errors

Sample errors POST JSON file is here.

Notififaction

Slack

POST errors with slack notification config like this.

slack

GitHub issue

POST errors with GitHub repo config for creating issue, like following code

{
  "errors": [

   - snip -

  ],
  "notifications": [

    - snip -

    {
      "type": "github",
      "userToken": "XXXXXXXxxxxXXXXXXxxxxxXXXXXXXXXX",
      "owner": "k1LoW",
      "repo": "faultline",
      "threshold": -1
    }
  ]
}

GitHub

API

API Document generated by jdoc.

JSON Hyper-Schema is here.

Web UI

Sample web UI for faultline

https://github.com/k1LoW/faultline-webui

Destroy faultline

  1. Delete all projects (or Empty S3 bucket).
  2. Run following command.
$ AWS_PROFILE=XXxxXXX npm run destroy

TODO

  • Refactor API response format
  • Notification
    • Slack
    • GitHub Issue
    • ???
  • Error Notify Filter
  • API Gateway API Key (waiting CFn/Serverless "Usage plan" support. see #2450 )

Contribute

PRs accepted.

License

MIT © Ken'ichiro Oyama