Skip to content

Commit

Permalink
Support insights (#74)
Browse files Browse the repository at this point in the history
* validate time for log

* update readme

* update readme add new expect to the function

* update changelog

* update github action after release upload files

* update release
  • Loading branch information
resdenia authored May 21, 2023
1 parent eb6486d commit 91892e9
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 30 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Upload new release
on:
release:
types: [published]

jobs:
build_function:
name: Build function
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get integraion
id: integration-receiver
run: |
integration=$(echo "${{ github.event.release.tag_name }}" | cut -d- -f2)
echo "integration=${integration}" >> "$GITHUB_ENV"
- name: Get version clean
id: version-receiver-without
run: |
version=$(echo "${{ github.event.release.tag_name }}" | cut -d- -f1)
version_without=$(echo ${version:1})
echo "version_without=${version_without}" >> "$GITHUB_ENV"
- name: Zip Folder
run: |
if [[ "${{ env.integration }}" = "CloudWatch" ]]; then
cd python3/cloudwatch
make
echo "release_file_path=python3/cloudwatch/dist/logzio-cloudwatch-log-shipper.zip" >> "$GITHUB_ENV"
else
cd python3/kinesis
make
echo "release_file_path=python3/kinesis/dist/logzio-kinesis-log-shipper.zip" >> "$GITHUB_ENV"
fi
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.release_file_path }}
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GIT }}
upload_to_buckets:
name: Upload to S3 buckets
runs-on: ubuntu-latest
needs: build_function
strategy:
matrix:
aws_region:
- 'us-east-1'
- 'us-east-2'
- 'us-west-1'
- 'us-west-2'
- 'eu-central-1'
- 'eu-north-1'
- 'eu-west-1'
- 'eu-west-2'
- 'eu-west-3'
- 'sa-east-1'
- 'ap-northeast-1'
- 'ap-northeast-2'
- 'ap-northeast-3'
- 'ap-south-1'
- 'ap-southeast-1'
- 'ap-southeast-2'
- 'ca-central-1'
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Receive integraion
id: integration-receiver
run: |
integration=$(echo "${{ github.event.release.tag_name }}" | cut -d- -f2)
echo "integration=${integration}" >> "$GITHUB_ENV"
- name: Receive version clean
id: version-receiver-without
run: |
version=$(echo "${{ github.event.release.tag_name }}" | cut -d- -f1)
version_without=$(echo ${version:1})
echo "version_without=${version_without}" >> "$GITHUB_ENV"
- name: download zip
run: |
if [[ "${{ env.integration }}" = "CloudWatch" ]]; then
wget -c https://github.com/resdenia/github-action-aws-python/releases/download/${{ github.event.release.tag_name }}/logzio-cloudwatch-log-shipper.zip -O logzio-cloudwatch.zip
else
wget -c https://github.com/resdenia/github-action-aws-python/releases/download/${{ github.event.release.tag_name }}/logzio-kinesis-log-shipper.zip -O logzio-kinesis.zip
fi
shell: bash
- name: create new version
run: |
if [[ "${{ env.integration }}" = "CloudWatch" ]]; then
cp ./python3/cloudwatch/sam-template.yaml ./sam-template-${{ matrix.aws_region }}.yaml
else
cp ./python3/kinesis/sam-template.yaml ./sam-template-${{ matrix.aws_region }}.yaml
fi
sed -i "s/<<VERSION>>/${{ env.version_without }}/" "./sam-template-${{ matrix.aws_region }}.yaml"
sed -i "s/<<REGION>>/${{ matrix.aws_region }}/" "./sam-template-${{ matrix.aws_region }}.yaml"
shell: bash
- name: Upload to aws
run: |
sudo apt-get update
sudo apt-get install awscli
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_KEY }}
aws configure set region ${{ matrix.aws_region }}
if [[ "${{ env.integration }}" = "CloudWatch" ]]; then
aws s3 cp ./sam-template-${{ matrix.aws_region }}.yaml s3://logzio-aws-integrations-${{ matrix.aws_region }}/cloudwatch-auto-deployment/${{ env.version_without }}/sam-template.yaml --acl public-read
aws s3 cp ./logzio-cloudwatch.zip s3://logzio-aws-integrations-${{ matrix.aws_region }}/cloudwatch-auto-deployment/${{ env.version_without }}/logzio-cloudwatch.zip --acl public-read
else
aws s3 cp ./sam-template-${{ matrix.aws_region }}.yaml s3://logzio-aws-integrations-${{ matrix.aws_region }}/aws-kinesis/${{ env.version_without }}/auto-deployment.yaml --acl public-read
aws s3 cp ./logzio-kinesis.zip s3://logzio-aws-integrations-${{ matrix.aws_region }}/aws-kinesis/${{ env.version_without }}/logzio-kinesis.zip --acl public-read
fi
shell: bash
- name: Clean
run: |
rm ./sam-template-${{ matrix.aws_region }}.yaml
rm ./function.zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.prettierignore
36 changes: 19 additions & 17 deletions python3/cloudwatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ To deploy this project, click the button that matches the region you wish to dep

| REGION | DEPLOYMENT |
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `us-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-east-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-east-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-east-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-west-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-west-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-central-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-north-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-north-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-west-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-west-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-west-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-west-3.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `sa-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-sa-east-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ca-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ca-central-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-northeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-northeast-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-northeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-northeast-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-northeast-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-3#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-northeast-3.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-south-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-south-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-southeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-southeast-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-southeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-southeast-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.0.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-east-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-east-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-east-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-west-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `us-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-us-west-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-central-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-north-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-north-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-west-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-west-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `eu-west-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/create/review?templateURL=https://logzio-aws-integrations-eu-west-3.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `sa-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-sa-east-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ca-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ca-central-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-northeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-northeast-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-northeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-northeast-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-northeast-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-3#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-northeast-3.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-south-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-south-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-southeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-southeast-1.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |
| `ap-southeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/create/review?templateURL=https://logzio-aws-integrations-ap-southeast-2.s3.amazonaws.com/cloudwatch-auto-deployment/1.1.0/sam-template.yaml&stackName=logzio-cloudwatch-shipper) |


#### 2. Specify stack details
Expand All @@ -116,6 +116,8 @@ Give your logs some time to get from your system to ours, and then open [Kibana]
If you still don't see your logs, see [log shipping troubleshooting](https://docs.logz.io/user-guide/log-shipping/log-shipping-troubleshooting.html).

## Changelog:
- **1.1.0**:
- Add support to send Lambda Insights from AWS to logz.io platform. [Resolved issue](https://github.com/logzio/logzio_aws_serverless/issues/73)

- **1.0.0**:
- **Breaking changes**:
Expand Down
4 changes: 2 additions & 2 deletions python3/cloudwatch/sam-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Resources:
Runtime: python3.7
Handler: lambda_function.lambda_handler
CodeUri:
Bucket: logzio-aws-integrations-us-east-1
Key: cloudwatch-auto-deployment/1.0.0/logzio-cloudwatch.zip
Bucket: logzio-aws-integrations-<<REGION>>
Key: cloudwatch-auto-deployment/<<VERSION>>/logzio-cloudwatch.zip
FunctionName: logzio-cloudwatch-log-shipper
MemorySize: 512
Timeout: 60
Expand Down
Loading

0 comments on commit 91892e9

Please sign in to comment.