Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix security agent performance issues #769

Merged
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
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## 3.24.1
### Fixed
* Performance improvement around calls to security agent. In some cases, unnecessary setup operations were being performed even if there was no security agent present to use that. These are now conditional on the security agent being present in the application (note that this will enable the setup code if the security agent is *present* in the application, regardless of whether it's currently enabled to run). This affects:
* Base agent code (updated to v3.24.1)
* `nrmongo` integration (updated to v1.1.1)

* Fixed unit tests for integrations which were failing because code level metrics are enabled by default now:
* `nrawssdk-v1` (updated to v1.1.2)
* `nrawssdk-v2` (updated to v1.2.2)
* `nrecho-v3` (updated to v1.0.2)
* `nrecho-v4` (updated to v1.0.4)
* `nrhttprouter` (updated to
* `nrlambda` (updated to v1.2.2)
* `nrnats` (updated to v1.1.5)
* `nrredis-v8` (updated to v1.0.1)


### Changed
* Updated all integration `go.mod` files to reflect supported Go language versions.

### Support statement

We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves (i.e., Go versions 1.19 and later are supported).

We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date. (https://docs.newrelic.com/docs/new-relic-solutions/new-relic-one/install-configure/update-new-relic-agent/)

See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.

## 3.24.0

### Added
Expand Down
3 changes: 1 addition & 2 deletions v3/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module github.com/newrelic/go-agent/v3

go 1.18
go 1.19

require (
github.com/golang/protobuf v1.5.3
google.golang.org/grpc v1.54.0
)


retract v3.22.0 // release process error corrected in v3.22.1
6 changes: 4 additions & 2 deletions v3/integrations/logcontext-v2/logWriter/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/logWriter

go 1.17
go 1.19

require (
github.com/newrelic/go-agent/v3 v3.19.1
github.com/newrelic/go-agent/v3 v3.24.1
github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrwriter v1.0.0
)


replace github.com/newrelic/go-agent/v3 => ../../..
6 changes: 4 additions & 2 deletions v3/integrations/logcontext-v2/nrlogrus/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrlogrus

go 1.17
go 1.19

require (
github.com/newrelic/go-agent/v3 v3.18.0
github.com/newrelic/go-agent/v3 v3.24.1
github.com/sirupsen/logrus v1.8.1
)


replace github.com/newrelic/go-agent/v3 => ../../..
6 changes: 4 additions & 2 deletions v3/integrations/logcontext-v2/nrwriter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrwriter

go 1.17
go 1.19

require github.com/newrelic/go-agent/v3 v3.19.1
require github.com/newrelic/go-agent/v3 v3.24.1


replace github.com/newrelic/go-agent/v3 => ../../..
6 changes: 4 additions & 2 deletions v3/integrations/logcontext-v2/nrzap/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrzap

go 1.18
go 1.19

require (
github.com/newrelic/go-agent/v3 v3.21.1
github.com/newrelic/go-agent/v3 v3.24.1
go.uber.org/zap v1.24.0
)


replace github.com/newrelic/go-agent/v3 => ../../..
6 changes: 4 additions & 2 deletions v3/integrations/logcontext-v2/nrzerolog/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrzerolog

go 1.17
go 1.19

require (
github.com/newrelic/go-agent/v3 v3.18.0
github.com/newrelic/go-agent/v3 v3.24.1
github.com/rs/zerolog v1.26.1
)


replace github.com/newrelic/go-agent/v3 => ../../..
6 changes: 4 additions & 2 deletions v3/integrations/logcontext-v2/zerologWriter/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/zerologWriter

go 1.17
go 1.19

require (
github.com/newrelic/go-agent/v3 v3.19.1
github.com/newrelic/go-agent/v3 v3.24.1
github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrwriter v1.0.0
github.com/rs/zerolog v1.27.0
)


replace github.com/newrelic/go-agent/v3 => ../../..
7 changes: 5 additions & 2 deletions v3/integrations/logcontext/nrlogrusplugin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext/nrlogrusplugin

// As of Dec 2019, the logrus go.mod file uses 1.13:
// https://github.com/sirupsen/logrus/blob/master/go.mod
go 1.13
go 1.19

require (
github.com/newrelic/go-agent/v3 v3.17.0
github.com/newrelic/go-agent/v3 v3.24.1
// v1.4.0 is required for for the log.WithContext.
github.com/sirupsen/logrus v1.4.0
)


replace github.com/newrelic/go-agent/v3 => ../../..
7 changes: 5 additions & 2 deletions v3/integrations/nrawssdk-v1/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ module github.com/newrelic/go-agent/v3/integrations/nrawssdk-v1
// As of Dec 2019, aws-sdk-go's go.mod does not specify a Go version. 1.6 is
// the earliest version of Go tested by aws-sdk-go's CI:
// https://github.com/aws/aws-sdk-go/blob/master/.travis.yml
go 1.7
go 1.19

require (
// v1.15.0 is the first aws-sdk-go version with module support.
github.com/aws/aws-sdk-go v1.34.0
github.com/newrelic/go-agent/v3 v3.24.0
github.com/newrelic/go-agent/v3 v3.24.1
)


replace github.com/newrelic/go-agent/v3 => ../..
2 changes: 1 addition & 1 deletion v3/integrations/nrawssdk-v1/nrawssdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

func testApp() integrationsupport.ExpectApp {
return integrationsupport.NewTestApp(integrationsupport.SampleEverythingReplyFn, integrationsupport.DTEnabledCfgFn)
return integrationsupport.NewTestApp(integrationsupport.SampleEverythingReplyFn, integrationsupport.DTEnabledCfgFn, newrelic.ConfigCodeLevelMetricsEnabled(false))
}

type fakeTransport struct{}
Expand Down
6 changes: 4 additions & 2 deletions v3/integrations/nrawssdk-v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrawssdk-v2

// As of May 2021, the aws-sdk-go-v2 go.mod file uses 1.15:
// https://github.com/aws/aws-sdk-go-v2/blob/master/go.mod
go 1.17
go 1.19

require (
github.com/aws/aws-sdk-go-v2 v1.16.15
Expand All @@ -11,6 +11,8 @@ require (
github.com/aws/aws-sdk-go-v2/service/lambda v1.24.5
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.10
github.com/aws/smithy-go v1.13.3
github.com/newrelic/go-agent/v3 v3.24.0
github.com/newrelic/go-agent/v3 v3.24.1
)


replace github.com/newrelic/go-agent/v3 => ../..
2 changes: 1 addition & 1 deletion v3/integrations/nrawssdk-v2/nrawssdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func testApp() integrationsupport.ExpectApp {
return integrationsupport.NewTestApp(integrationsupport.SampleEverythingReplyFn, integrationsupport.DTEnabledCfgFn)
return integrationsupport.NewTestApp(integrationsupport.SampleEverythingReplyFn, integrationsupport.DTEnabledCfgFn, newrelic.ConfigCodeLevelMetricsEnabled(false))
}

type fakeTransport struct{}
Expand Down
4 changes: 3 additions & 1 deletion v3/integrations/nrb3/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrb3

go 1.19

require github.com/newrelic/go-agent/v3 v3.24.0
require github.com/newrelic/go-agent/v3 v3.24.1


replace github.com/newrelic/go-agent/v3 => ../..
7 changes: 5 additions & 2 deletions v3/integrations/nrecho-v3/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ module github.com/newrelic/go-agent/v3/integrations/nrecho-v3

// 1.7 is the earliest version of Go tested by v3.1.0:
// https://github.com/labstack/echo/blob/v3.1.0/.travis.yml
go 1.7
go 1.19

require (
// v3.1.0 is the earliest v3 version of Echo that works with modules due
// to the github.com/rsc/letsencrypt import of v3.0.0.
github.com/labstack/echo v3.1.0+incompatible
github.com/newrelic/go-agent/v3 v3.24.0
github.com/newrelic/go-agent/v3 v3.24.1
)


replace github.com/newrelic/go-agent/v3 => ../..
15 changes: 8 additions & 7 deletions v3/integrations/nrecho-v3/nrecho_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (
"github.com/labstack/echo"
"github.com/newrelic/go-agent/v3/internal"
"github.com/newrelic/go-agent/v3/internal/integrationsupport"
newrelic "github.com/newrelic/go-agent/v3/newrelic"
)

func TestBasicRoute(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -79,7 +80,7 @@ func TestNilApp(t *testing.T) {
}

func TestTransactionContext(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -109,7 +110,7 @@ func TestTransactionContext(t *testing.T) {
}

func TestNotFoundHandler(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand All @@ -129,7 +130,7 @@ func TestNotFoundHandler(t *testing.T) {
}

func TestMethodNotAllowedHandler(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand All @@ -154,7 +155,7 @@ func TestMethodNotAllowedHandler(t *testing.T) {
}

func TestReturnsHTTPError(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -196,7 +197,7 @@ func TestReturnsHTTPError(t *testing.T) {
}

func TestReturnsError(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -238,7 +239,7 @@ func TestReturnsError(t *testing.T) {
}

func TestResponseCode(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down
6 changes: 4 additions & 2 deletions v3/integrations/nrecho-v4/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ module github.com/newrelic/go-agent/v3/integrations/nrecho-v4

// As of Jun 2022, the echo go.mod file uses 1.17:
// https://github.com/labstack/echo/blob/master/go.mod
go 1.17
go 1.19

require (
github.com/labstack/echo/v4 v4.9.0
github.com/newrelic/go-agent/v3 v3.24.0
github.com/newrelic/go-agent/v3 v3.24.1
)


replace github.com/newrelic/go-agent/v3 => ../..
17 changes: 9 additions & 8 deletions v3/integrations/nrecho-v4/nrecho_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (
"github.com/labstack/echo/v4"
"github.com/newrelic/go-agent/v3/internal"
"github.com/newrelic/go-agent/v3/internal/integrationsupport"
newrelic "github.com/newrelic/go-agent/v3/newrelic"
)

func TestBasicRoute(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -61,7 +62,7 @@ func TestBasicRoute(t *testing.T) {
}

func TestSkipper(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
skipper := func(c echo.Context) bool {
Expand Down Expand Up @@ -144,7 +145,7 @@ func TestNilApp(t *testing.T) {
}

func TestTransactionContext(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -174,7 +175,7 @@ func TestTransactionContext(t *testing.T) {
}

func TestNotFoundHandler(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand All @@ -194,7 +195,7 @@ func TestNotFoundHandler(t *testing.T) {
}

func TestMethodNotAllowedHandler(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand All @@ -219,7 +220,7 @@ func TestMethodNotAllowedHandler(t *testing.T) {
}

func TestReturnsHTTPError(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -261,7 +262,7 @@ func TestReturnsHTTPError(t *testing.T) {
}

func TestReturnsError(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down Expand Up @@ -303,7 +304,7 @@ func TestReturnsError(t *testing.T) {
}

func TestResponseCode(t *testing.T) {
app := integrationsupport.NewBasicTestApp()
app := integrationsupport.NewTestApp(nil, newrelic.ConfigCodeLevelMetricsEnabled(false))

e := echo.New()
e.Use(Middleware(app.Application))
Expand Down
7 changes: 5 additions & 2 deletions v3/integrations/nrelasticsearch-v7/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ module github.com/newrelic/go-agent/v3/integrations/nrelasticsearch-v7

// As of Jan 2020, the v7 elasticsearch go.mod uses 1.11:
// https://github.com/elastic/go-elasticsearch/blob/7.x/go.mod
go 1.11
go 1.19

require (
github.com/elastic/go-elasticsearch/v7 v7.17.0
github.com/newrelic/go-agent/v3 v3.24.0
github.com/newrelic/go-agent/v3 v3.24.1
)


replace github.com/newrelic/go-agent/v3 => ../..
Loading
Loading