Skip to content

Commit 0d6b19d

Browse files
Merge pull request #36 from FireTail-io/update-docs
update docs
2 parents 8310198 + e2a305c commit 0d6b19d

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

README.md

+28-21
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,9 @@
66

77
## Overview
88

9-
The FireTail Logging Extension receives AWS Lambda events and response payloads and sends them to the FireTail Logging API.
9+
The FireTail Logging Extension collects AWS Lambda events & response payloads by proxying the Lambda runtime API and sends them to the FireTail Logging API.
1010

11-
The extension receives these events and response payloads by a runtime-specific FireTail library which you will need to use in your Function code. The FireTail library outputs specifically formatted logs which the extension then receives from the [Lambda Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html). You can find a table of FireTail function libraries that correspond with a Lambda runtime in the [Function Libraries](#function-libraries) section. Below is a diagram depicting how the FireTail extension, Extensions API, Logs API and FireTail API interact over the lifetime of a Lambda.
12-
13-
![Firetail Lambda Extension Lifecycle Diagram](./docs/imgs/extension-lifecycle.svg)
14-
15-
16-
17-
## Function Libraries
18-
19-
| Supported Runtimes | Library |
20-
| -------------------- | ------------------------------------------------------------ |
21-
| Python 3.7, 3.8, 3.9, 3.10 | [github.com/FireTail-io/firetail-py-lambda](https://github.com/FireTail-io/firetail-py-lambda) |
11+
Includes a wrapper script, [firetail-wrapper.sh](./firetail-wrapper.sh), that you must use by setting the `AWS_LAMBDA_EXEC_WRAPPER` to `/opt/firetail-wrapper.sh`
2212

2313

2414

@@ -141,19 +131,20 @@ For example, for `ARCH=amd64` and `VERSION=v1-1-0` this should yield:
141131
arn:aws:lambda:us-east-1:247286868737:layer:firetail-extension-x86_64-v1-1-0:1
142132
```
143133

144-
Regardless of how you add the Lambda Layer to your Lambda Function, you will also need to configure at least one environment variable: `FIRETAIL_API_TOKEN`.
134+
Regardless of how you add the Lambda Layer to your Lambda Function, you will also need to configure at least two environment variables: `AWS_LAMBDA_EXEC_WRAPPER` and `FIRETAIL_API_TOKEN`.
145135

146-
If you are using not using the Firetail SaaS' default region then you will also need to set the environment variable `FIRETAIL_API_URL` appropriately. For example, for `us.firetail.app` the appropriate URL would be `https://api.logging.us-east-2.prod.firetail.app/logs/bulk`.
136+
If you are using not using the FireTail SaaS' default region then you will also need to set the environment variable `FIRETAIL_API_URL` appropriately. For example, for `us.firetail.app` the appropriate URL would be `https://api.logging.us-east-2.prod.firetail.app/logs/bulk`.
147137

148138
Find below a full list of the environment variables used by the FireTail Lambda Extension:
149139

150-
| Environment Variable | Default Value | Description |
151-
| ------------------------ | ----------------------------------------------------------- | ------------------------------------------------------------ |
152-
| FIRETAIL_API_TOKEN | None | Your API token for the FireTail Logging API. If left unset, no logs will be sent to the Firetail Logging API. |
153-
| FIRETAIL_API_URL | `https://api.logging.eu-west-1.prod.firetail.app/logs/bulk` | The URL of the FireTail Logging API. Note, if you are not using `firetail.app`'s default region this will need to be configured appropriately. |
154-
| FIRETAIL_EXTENSION_DEBUG | `false` | Enables debug logging from the extension if set to a value parsed as `true` by [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool). |
155-
| FIRETAIL_LOG_BUFFER_SIZE | `1000` | The maximum amount of logs the extension will hold in its buffer from which logs are batched and sent to FireTail. |
156-
| FIRETAIL_MAX_BATCH_SIZE | `100` | The maximum size of a batch of logs to be sent to the FireTail logging API in one request. |
140+
| Environment Variable | Default Value | Description |
141+
| -------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ |
142+
| `AWS_LAMBDA_EXEC_WRAPPER` | None | Must be set to `/opt/firetail-wrapper.sh`. |
143+
| `FIRETAIL_API_TOKEN` | None | Your API token for the FireTail Logging API. If left unset, no logs will be sent to the FireTail Logging API |
144+
| `FIRETAIL_API_URL` | `https://api.logging.eu-west-1.prod.firetail.app/logs/bulk` | The URL of the FireTail Logging API |
145+
| `FIRETAIL_EXTENSION_DEBUG` | `false` | Enables debug logging from the extension if set to a value parsed as `true` by [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool) |
146+
| `FIRETAIL_LOG_BUFFER_SIZE` | `1000` | The maximum amount of logs the extension will hold in its buffer from which logs are batched and sent to FireTail |
147+
| `FIRETAIL_MAX_BATCH_SIZE` | `100` | The maximum size of a batch of logs to be sent to the FireTail logging API in one request |
157148

158149

159150

@@ -228,6 +219,7 @@ resource "aws_lambda_function" "extensions-demo-example-lambda-python" {
228219
229220
environment {
230221
variables = {
222+
AWS_LAMBDA_EXEC_WRAPPER = "/opt/firetail-wrapper.sh"
231223
FIRETAIL_API_TOKEN = "firetail-api-key",
232224
FIRETAIL_API_URL = "https://api.logging.eu-west-1.prod.firetail.app/logs/bulk"
233225
}
@@ -238,3 +230,18 @@ resource "aws_lambda_function" "extensions-demo-example-lambda-python" {
238230
]
239231
}
240232
```
233+
234+
235+
236+
## Legacy Mode
237+
238+
The FireTail Lambda extension used to work in conjunction with a runtime-specific FireTail library which you would need to use in your Function code. The FireTail library outputted specifically formatted logs which the extension then received via the [Lambda Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html). You can find a table of FireTail function libraries which correspond with a Lambda runtime in the table below. Below is a diagram depicting how the FireTail extension, Extensions API, Logs API and FireTail API interact over the lifetime of a Lambda.
239+
240+
You can still use this mode by setting the environment variable `FIRETAIL_EXTENSION_LEGACY` to `true`.
241+
242+
![FireTail Lambda Extension Lifecycle Diagram](./docs/imgs/extension-lifecycle.svg)
243+
244+
| Supported Runtimes | Library |
245+
| -------------------- | ------------------------------------------------------------ |
246+
| Python 3.7, 3.8, 3.9 | [github.com/FireTail-io/firetail-py-lambda](https://github.com/FireTail-io/firetail-py-lambda) |
247+

0 commit comments

Comments
 (0)