Skip to content

Commit

Permalink
Improving autograph monitor log messages (#991)
Browse files Browse the repository at this point in the history
* AUT-250 - working on making monitor errors more explicit. Upgraded aws-lambda package
  • Loading branch information
alexcottner authored Sep 20, 2024
1 parent 4f4674e commit 153bb60
Show file tree
Hide file tree
Showing 14 changed files with 743 additions and 194 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.1

require (
github.com/DataDog/datadog-go v3.7.2+incompatible
github.com/aws/aws-lambda-go v1.27.0
github.com/aws/aws-lambda-go v1.47.0
github.com/aws/aws-sdk-go-v2 v1.30.5
github.com/aws/aws-sdk-go-v2/config v1.27.33
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.18
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-lambda-go v1.27.0 h1:aLzrJwdyHoF1A18YeVdJjX8Ixkd+bpogdxVInvHcWjM=
github.com/aws/aws-lambda-go v1.27.0/go.mod h1:jJmlefzPfGnckuHdXX7/80O3BvUUi12XOkbv4w9SGLU=
github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI=
github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=
github.com/aws/aws-sdk-go v1.21.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.42.15 h1:RcUChuF7KzrrTqx9LAzJbLBX00LkUY7cH9T1VdxNdqk=
github.com/aws/aws-sdk-go v1.42.15/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
Expand Down Expand Up @@ -273,6 +275,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10 h1:4zp+5ElNBLy5qmaDFrbVDolQSOtPmquw+W6EMNEpi+k=
github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
Expand Down
6 changes: 3 additions & 3 deletions monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func (m *monitor) checkSigners() {
// sign with data set to the base64 of the string 'AUTOGRAPH MONITORING'
sig, err := s.(signer.DataSigner).SignData(MonitoringInputData, s.(signer.DataSigner).GetDefaultOptions())
if err != nil {
m.sigerrstrs[i] = fmt.Sprintf("signing failed with error: %v", err)
m.sigerrstrs[i] = fmt.Sprintf("data signing for %s failed with error: %v", s.Config().ID, err)
continue
}

encodedsig, err := sig.Marshal()
if err != nil {
m.sigerrstrs[i] = fmt.Sprintf("encoding failed with error: %v", err)
m.sigerrstrs[i] = fmt.Sprintf("encoding failed for %s with error: %v", s.Config().ID, err)
continue
}
m.sigerrstrs[i] = ""
Expand All @@ -109,7 +109,7 @@ func (m *monitor) checkSigners() {
}
output, err := s.(signer.FileSigner).SignFile(s.(signer.TestFileGetter).GetTestFile(), s.(signer.FileSigner).GetDefaultOptions())
if err != nil {
m.sigerrstrs[i] = fmt.Sprintf("signing failed with error: %v", err)
m.sigerrstrs[i] = fmt.Sprintf("file signing failed for %s with error: %v", s.Config().ID, err)
continue
}
signedfile := base64.StdEncoding.EncodeToString(output)
Expand Down
3 changes: 1 addition & 2 deletions tools/autograph-monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ func main() {
} else {
err := Handler()
if err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
log.Fatalf("Unhandled exception from monitor: %s", err)
}
os.Exit(0)
}
Expand Down
78 changes: 45 additions & 33 deletions vendor/github.com/aws/aws-lambda-go/lambda/entry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/aws/aws-lambda-go/lambda/entry_generic.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 153bb60

Please sign in to comment.