Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions .github/workflows/dev-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: dev build image
on:
workflow_dispatch:
push:
branches: [ "main" ]

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main

- name: Create tag name
run: echo "tag=$(date +'%Y-%m-%dT%H-%M-%S')_$GITHUB_SHA" >> $GITHUB_ENV

- name: Install AWS cli
uses: unfor19/install-aws-cli-action@master

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build and Push Agent Image
uses: docker/build-push-action@v3
with:
context: .
file: 'Dockerfile'
push: true
tags: |
280501305789.dkr.ecr.us-east-1.amazonaws.com/nudgebee-node-agent:${{ env.tag }}
38 changes: 38 additions & 0 deletions .github/workflows/prod-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: dev build image
on:
workflow_dispatch:
push:
branches: [ "prod" ]

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main

- name: Create tag name
run: echo "tag=$(date +'%Y-%m-%dT%H-%M-%S')_$GITHUB_SHA" >> $GITHUB_ENV

- name: Install AWS cli
uses: unfor19/install-aws-cli-action@master

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build and Push Agent Image
uses: docker/build-push-action@v3
with:
context: .
file: 'Dockerfile'
push: true
tags: |
740395098545.dkr.ecr.us-east-1.amazonaws.com/nudgebee-node-agent:${{ env.tag }}
4 changes: 3 additions & 1 deletion containers/l7.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package containers

import (
"log"
"time"

"github.com/coroot/coroot-node-agent/common"
Expand Down Expand Up @@ -69,7 +70,8 @@ func (s L7Stats) get(protocol l7.Protocol, destination, actualDestination netadd
labels = append(labels, "method")
case l7.ProtocolHTTP:
method, path, payload := l7.ParseHttpAndRest(r.Payload)
if r.Status == l7.StatusFailed {
if r.Status.Http() == "400" || r.Status.Http() == "500" {
log.Printf("Captured failed request actual body %s, converted body %s, status %s", string(r.Payload), payload, r.Status.Http())
constLabels["payload"] = payload
}
constLabels["path"] = path
Expand Down