Skip to content

updated readme #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

[![PyPI package](https://img.shields.io/badge/pip%20install-firetail--lambda-brightgreen)](https://pypi.org/project/firetail-lambda/) [![version number](https://img.shields.io/pypi/v/firetail-lambda?color=green&label=version)](https://github.com/Firetail-io/firetail-py-lambda/releases) [![Actions Status](https://github.com/Firetail-io/firetail-py-lambda/workflows/Test/badge.svg)](https://github.com/Firetail-io/firetail-py-lambda/actions) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL_v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) [![codecov](https://codecov.io/gh/FireTail-io/firetail-py-lambda/branch/main/graph/badge.svg?token=HU206RRZZ4)](https://codecov.io/gh/FireTail-io/firetail-py-lambda)

The purpose of this module is to correctly log out the event and response payload to allow the firetail extension to then send it on to the firetail logging api
###Overview

```bash
pip install firetail-lambda
```
The purpose of this module is to correctly log out the AWS Lambda event and response payload to allow the firetail extension to then send it on to the firetail logging api

The firetail_handler is a decorator that wraps around an event handler function in a AWS Lambda to extract the event and response payloads into a base64 logging message.

How to implement
###Supported Lambda Runtimes
- [x] Python 3.7
- [x] Python 3.8
- [x] Python 3.9

Add Environment variables to code/lambda
###Installation
Install the module with using pip
```bash
export FIRETAIL_API_URL=https://api.logging.eu-west-1.sandbox.firetail.app/logs/bulk
export FIRETAIL_API_TOKEN=<your-api-token>
pip install -U firetail-lambda
```


Expand All @@ -31,4 +34,26 @@ def lambda_handler(event, context):
})
}
```
Multiple Event handlers
```python
from firetail_lambda import firetail_handler

@firetail_handler()
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": json.dumps({
"message": "Hello"
})
}

@firetail_handler()
def lambda_handler_2(event, context):
return {
"statusCode": 200,
"body": json.dumps({
"message": "Hello 2"
})
}
```