Skip to content
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

[Bug fix] Drain queue upon shutdown event #40

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
87 changes: 43 additions & 44 deletions logzio-lambda-extensions-logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,61 +227,60 @@ foo: bar

| Region Name | Region Code | AWS ARN |
|---------------------------|------------------|---------------------------------------------------------------------------------|
| US East (N. Virginia) | `us-east-1` | `arn:aws:lambda:us-east-1:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| US East (Ohio) | `us-east-2` | `arn:aws:lambda:us-east-2:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| US West (N. California) | `us-west-1` | `arn:aws:lambda:us-west-1:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| US West (Oregon) | `us-west-2` | `arn:aws:lambda:us-west-2:486140753397:layer:LogzioLambdaExtensionLogs:13` |
| Europe (Frankfurt) | `eu-central-1` | `arn:aws:lambda:eu-central-1:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| Europe (Ireland) | `eu-west-1` | `arn:aws:lambda:eu-west-1:486140753397:layer:LogzioLambdaExtensionLogs:13` |
| Europe (Stockholm) | `eu-north-1` | `arn:aws:lambda:eu-north-1:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| Asia Pacific (Sydney) | `ap-southeast-2` | `arn:aws:lambda:ap-southeast-2:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| Canada (Central) | `ca-central-1` | `arn:aws:lambda:ca-central-1:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| South America (SΓ£o Paulo) | `sa-east-1` | `arn:aws:lambda:sa-east-1:486140753397:layer:LogzioLambdaExtensionLogs:16` |
| Asia Pacific (Tokyo) | `ap-northeast-1` | `arn:aws:lambda:ap-northeast-1:486140753397:layer:LogzioLambdaExtensionLogs:10` |
| Asia Pacific (Singapore) | `ap-southeast-1` | `arn:aws:lambda:ap-southeast-1:486140753397:layer:LogzioLambdaExtensionLogs:11` |
| Asia Pacific (Mumbai) | `ap-south-1` | `arn:aws:lambda:ap-south-1:486140753397:layer:LogzioLambdaExtensionLogs:10` |
| Asia Pacific (Osaka) | `ap-northeast-3` | `arn:aws:lambda:ap-northeast-3:486140753397:layer:LogzioLambdaExtensionLogs:11` |
| Asia Pacific (Seoul) | `ap-northeast-2` | `arn:aws:lambda:ap-northeast-2:486140753397:layer:LogzioLambdaExtensionLogs:11` |
| Europe (London) | `eu-west-2` | `arn:aws:lambda:eu-west-2:486140753397:layer:LogzioLambdaExtensionLogs:12` |
| Europe (Paris) | `eu-west-3` | `arn:aws:lambda:eu-west-3:486140753397:layer:LogzioLambdaExtensionLogs:11` |
| US East (N. Virginia) | `us-east-1` | `arn:aws:lambda:us-east-1:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| US East (Ohio) | `us-east-2` | `arn:aws:lambda:us-east-2:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| US West (N. California) | `us-west-1` | `arn:aws:lambda:us-west-1:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| US West (Oregon) | `us-west-2` | `arn:aws:lambda:us-west-2:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| Europe (Frankfurt) | `eu-central-1` | `arn:aws:lambda:eu-central-1:486140753397:layer:LogzioLambdaExtensionLogs:16` |
| Europe (Ireland) | `eu-west-1` | `arn:aws:lambda:eu-west-1:486140753397:layer:LogzioLambdaExtensionLogs:14` |
| Europe (Stockholm) | `eu-north-1` | `arn:aws:lambda:eu-north-1:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| Asia Pacific (Sydney) | `ap-southeast-2` | `arn:aws:lambda:ap-southeast-2:486140753397:layer:LogzioLambdaExtensionLogs:15` |
| Canada (Central) | `ca-central-1` | `arn:aws:lambda:ca-central-1:486140753397:layer:LogzioLambdaExtensionLogs:16` |
| South America (SΓ£o Paulo) | `sa-east-1` | `arn:aws:lambda:sa-east-1:486140753397:layer:LogzioLambdaExtensionLogs:17` |
| Asia Pacific (Tokyo) | `ap-northeast-1` | `arn:aws:lambda:ap-northeast-1:486140753397:layer:LogzioLambdaExtensionLogs:11` |
| Asia Pacific (Singapore) | `ap-southeast-1` | `arn:aws:lambda:ap-southeast-1:486140753397:layer:LogzioLambdaExtensionLogs:12` |
| Asia Pacific (Mumbai) | `ap-south-1` | `arn:aws:lambda:ap-south-1:486140753397:layer:LogzioLambdaExtensionLogs:11` |
| Asia Pacific (Osaka) | `ap-northeast-3` | `arn:aws:lambda:ap-northeast-3:486140753397:layer:LogzioLambdaExtensionLogs:12` |
| Asia Pacific (Seoul) | `ap-northeast-2` | `arn:aws:lambda:ap-northeast-2:486140753397:layer:LogzioLambdaExtensionLogs:12` |
| Europe (London) | `eu-west-2` | `arn:aws:lambda:eu-west-2:486140753397:layer:LogzioLambdaExtensionLogs:13` |
| Europe (Paris) | `eu-west-3` | `arn:aws:lambda:eu-west-3:486140753397:layer:LogzioLambdaExtensionLogs:12` |

## ARM64 Architecture
| Region Name | Region Code | AWS ARN |
|---------------------------|------------------|-----------------------------------------------------------------------------------|
| US East (N. Virginia) | `us-east-1` | `arn:aws:lambda:us-east-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| US East (Ohio) | `us-east-2` | `arn:aws:lambda:us-east-2:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| US West (N. California) | `us-west-1` | `arn:aws:lambda:us-west-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| US West (Oregon) | `us-west-2` | `arn:aws:lambda:us-west-2:486140753397:layer:LogzioLambdaExtensionLogsArm:5` |
| Europe (Frankfurt) | `eu-central-1` | `arn:aws:lambda:eu-central-1:486140753397:layer:LogzioLambdaExtensionLogsArm:5` |
| Europe (Ireland) | `eu-west-1` | `arn:aws:lambda:eu-west-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Europe (Stockholm) | `eu-north-1` | `arn:aws:lambda:eu-north-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Asia Pacific (Sydney) | `ap-southeast-2` | `arn:aws:lambda:ap-southeast-2:486140753397:layer:LogzioLambdaExtensionLogsArm:5` |
| Canada (Central) | `ca-central-1` | `arn:aws:lambda:ca-central-1:486140753397:layer:LogzioLambdaExtensionLogsArm:5` |
| South America (SΓ£o Paulo) | `sa-east-1` | `arn:aws:lambda:sa-east-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Asia Pacific (Tokyo) | `ap-northeast-1` | `arn:aws:lambda:ap-northeast-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Asia Pacific (Singapore) | `ap-southeast-1` | `arn:aws:lambda:ap-southeast-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Asia Pacific (Mumbai) | `ap-south-1` | `arn:aws:lambda:ap-south-1:486140753397:layer:LogzioLambdaExtensionLogsArm:5` |
| Asia Pacific (Osaka) | `ap-northeast-3` | `arn:aws:lambda:ap-northeast-3:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Asia Pacific (Seoul) | `ap-northeast-2` | `arn:aws:lambda:ap-northeast-2:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Europe (London) | `eu-west-2` | `arn:aws:lambda:eu-west-2:486140753397:layer:LogzioLambdaExtensionLogsArm:5` |
| Europe (Paris) | `eu-west-3` | `arn:aws:lambda:eu-west-3:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| US East (N. Virginia) | `us-east-1` | `arn:aws:lambda:us-east-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| US East (Ohio) | `us-east-2` | `arn:aws:lambda:us-east-2:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| US West (N. California) | `us-west-1` | `arn:aws:lambda:us-west-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| US West (Oregon) | `us-west-2` | `arn:aws:lambda:us-west-2:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Europe (Frankfurt) | `eu-central-1` | `arn:aws:lambda:eu-central-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Europe (Ireland) | `eu-west-1` | `arn:aws:lambda:eu-west-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Europe (Stockholm) | `eu-north-1` | `arn:aws:lambda:eu-north-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Asia Pacific (Sydney) | `ap-southeast-2` | `arn:aws:lambda:ap-southeast-2:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Canada (Central) | `ca-central-1` | `arn:aws:lambda:ca-central-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| South America (SΓ£o Paulo) | `sa-east-1` | `arn:aws:lambda:sa-east-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Asia Pacific (Tokyo) | `ap-northeast-1` | `arn:aws:lambda:ap-northeast-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Asia Pacific (Singapore) | `ap-southeast-1` | `arn:aws:lambda:ap-southeast-1:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Asia Pacific (Mumbai) | `ap-south-1` | `arn:aws:lambda:ap-south-1:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Asia Pacific (Osaka) | `ap-northeast-3` | `arn:aws:lambda:ap-northeast-3:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Asia Pacific (Seoul) | `ap-northeast-2` | `arn:aws:lambda:ap-northeast-2:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |
| Europe (London) | `eu-west-2` | `arn:aws:lambda:eu-west-2:486140753397:layer:LogzioLambdaExtensionLogsArm:6` |
| Europe (Paris) | `eu-west-3` | `arn:aws:lambda:eu-west-3:486140753397:layer:LogzioLambdaExtensionLogsArm:7` |

### Lambda extension versions

| Version | Supported Runtimes |
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.3.4 | `.NET 6`, `.NET 8`, `provided.al2`, `provided.al2023`, `Java 8`, `Java 11`, `Java 17`, `Node.js 16`, `Node.js 18`, `Python 3.8`, `Python 3.9`, `Python 3.10`, `Python 3.11`, `Python 3.12`, `Ruby 3.2`, `Custom Runtime` |
| 0.3.3 | `.NET 6`, `.NET 8`, `provided.al2`, `provided.al2023`, `Java 8`, `Java 11`, `Java 17`, `Node.js 16`, `Node.js 18`, `Python 3.8`, `Python 3.9`, `Python 3.10`, `Python 3.11`, `Python 3.12`, `Ruby 3.2`, `Custom Runtime` |
| 0.3.2 | `.NET 6`, `Go 1.x`, `Java 17`, `Node.js 18`, `Python 3.11`, `Ruby 3.2`, `Java 11`, `Java 8`, `Node.js 16`, `Python 3.10`, `Python 3.9`, `Python 3.8`, `Ruby 2.7`, `Custom Runtime` |
| 0.3.1 | All runtimes |
| 0.3.0 | `.NET Core 3.1`, `Java 11`, `Java 8`, `Node.js 14.x`, `Node.js 12.x`, `Python 3.9`, `Python 3.8`, `Python 3.7`, `Ruby 2.7`, `Custom runtime` |
| 0.2.0 | `.NET Core 3.1`, `Java 11`, `Java 8`, `Node.js 14.x`, `Node.js 12.x`, `Python 3.9`, `Python 3.8`, `Python 3.7`, `Ruby 2.7`, `Custom runtime` |
| 0.1.0 | `.NET Core 3.1`, `Java 11`, `Java 8`, `Node.js 14.x`, `Node.js 12.x`, `Node.js 10.x`, `Python 3.8`, `Python 3.7`, `Ruby 2.7`, `Ruby 2.5`, `Custom runtime` |
| 0.0.1 | `Python 3.7`, `Python 3.8` |
| Version | Supported Runtimes |
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.3.* | All runtimes |
| 0.3.0 | `.NET Core 3.1`, `Java 11`, `Java 8`, `Node.js 14.x`, `Node.js 12.x`, `Python 3.9`, `Python 3.8`, `Python 3.7`, `Ruby 2.7`, `Custom runtime` |
| 0.2.0 | `.NET Core 3.1`, `Java 11`, `Java 8`, `Node.js 14.x`, `Node.js 12.x`, `Python 3.9`, `Python 3.8`, `Python 3.7`, `Ruby 2.7`, `Custom runtime` |
| 0.1.0 | `.NET Core 3.1`, `Java 11`, `Java 8`, `Node.js 14.x`, `Node.js 12.x`, `Node.js 10.x`, `Python 3.8`, `Python 3.7`, `Ruby 2.7`, `Ruby 2.5`, `Custom runtime` |
| 0.0.1 | `Python 3.7`, `Python 3.8` |

**NOTE:** If your AWS region is not in the list, please reach out to Logz.io's support or open an issue in this repo.

### Changelog:
- **0.3.6**:
- Drain queue upon shutdown event.
- **0.3.5**:
- Fix ARM layer release
- **0.3.4**:
Expand Down
2 changes: 1 addition & 1 deletion logzio-lambda-extensions-logs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ require (
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/sys v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 2 additions & 0 deletions logzio-lambda-extensions-logs/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
1 change: 1 addition & 0 deletions logzio-lambda-extensions-logs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func main() {
return
case <-eventChannel:
logger.Info(printPrefix, "Received SHUTDOWN event")
logsApiLogger.Drain()
logsApiAgent.Shutdown()
logger.Info(printPrefix, "Exiting")
return
Expand Down
Loading