update newrelic to v3 (GO-15926)#21
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the NewRelic Go agent from v2 to v3, addressing breaking changes in the API and modernizing the codebase. The migration includes updating imports, changing transaction types from interfaces to pointers, and removing error handling for the AddAttribute method which no longer returns errors in v3.
- Updated NewRelic Go agent dependencies from v2 to v3
- Changed transaction types from interface to pointer references
- Replaced
interface{}withanytype alias throughout codebase
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated NewRelic dependencies to v3 and added required integrations |
| step_function_handler.go | Updated imports, transaction type, and AddAttribute method |
| sqs_handler.go | Updated imports, transaction type, and replaced interface{} with any |
| s3_handler.go | Updated imports, transaction type, and simplified AddAttribute |
| handlers.go | Updated NewRelic import and replaced interface{} with any |
| dynamodb_handler.go | Updated imports, transaction type, and simplified AddAttribute |
| cloudwatch_handler.go | Updated imports, transaction type, and simplified AddAttribute |
| apigw_handler_test.go | Replaced interface{} with any type alias |
| apigw_handler.go | Updated imports, transaction type, and simplified AddAttribute |
| apigw_ca_handler.go | Updated imports, transaction type, and simplified AddAttribute |
| golangci.yml | Added comprehensive linting configuration |
| Makefile | Enhanced with help system and lint target |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "github.com/rs/zerolog" | ||
| ) | ||
|
|
||
| // StepEvent represents a generic event for AWS Step Functions. |
There was a problem hiding this comment.
The comment on line 13 describes StepEvent but is placed above the StepContext type definition. This comment should be moved to line 31 where StepEvent is actually defined, or updated to describe StepContext.
| // StepEvent represents a generic event for AWS Step Functions. |
| return strings.Join(errorParts, "; ") | ||
| } | ||
|
|
||
| // ToJSON returns the JSON representation of the Err. |
There was a problem hiding this comment.
The comment on line 54 mentions 'ToJSON' method but is placed above the ErrInternalServer variable declaration. This comment appears to be misplaced and should either be removed or moved to the appropriate location.
| // ToJSON returns the JSON representation of the Err. |
No description provided.