Installation steps
Install Atatus Go Agent and messaging module
copygo get go.atatus.com/agent go get go.atatus.com/agent/module/atawssdkgo
Set up tracer and wrap the messaging client
copyimport ( "go.atatus.com/agent" "go.atatus.com/agent/module/atawssdkgo" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3/s3manager" ) func main() { // Initialize Atatus tracer with values from environment tracer := atatus.DefaultTracer tracer.Service.LicenseKey = os.Getenv("ATATUS_LICENSE_KEY") tracer.Service.AppName = os.Getenv("ATATUS_APP_NAME") tracer.Service.Tracing = os.Getenv("ATATUS_TRACING") tracer.Service.Analytics = os.Getenv("ATATUS_ANALYTICS") session := session.Must(session.NewSession()) session = atawssdkgo.WrapSession(session) uploader := s3manager.NewUploader(session) s := &server{uploader} ... } func (s *server) handleRequest(w http.ResponseWriter, req *http.Request) { ctx := req.Context() out, err := s.uploader.UploadWithContext(ctx, &s3manager.UploadInput{ Bucket: aws.String("your-bucket"), Key: aws.String("your-key"), Body: bytes.NewBuffer([]byte("your-body")), }) ... }
Clean Up Dependencies
copygo mod tidy
Run the Application
copygo run main.go