From 06dc02429df1a75a1766787d3dde44fd2192c44e Mon Sep 17 00:00:00 2001 From: Rich Vanderwal Date: Tue, 28 Sep 2021 14:48:59 -0700 Subject: [PATCH 1/5] First try at arm64 Ci (#381) --- .github/workflows/ci.yaml | 49 ++++++++++++++++++++++++++++++ v3/newrelic/trace_observer_test.go | 14 +++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 64250a9e7..4c559b834 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -231,3 +231,52 @@ jobs: env: DIRS: ${{ matrix.dirs }} EXTRATESTING: ${{ matrix.extratesting }} + + go-agent-arm64: + # Run all unit tests on aarch64 emulator to ensure compatibility with AWS + # Graviton instances + runs-on: ubuntu-18.04 + strategy: + # if one test fails, do not abort the rest + fail-fast: false + matrix: + include: + - go-version: 1.17.1 + - go-version: 1.16.8 + steps: + - uses: actions/checkout@v1 + with: + # Required when using older versions of Go that do not support gomod. + # Note the required presence of the /go-agent/ directory at the + # beginning of this path. It is required in order to match the + # ${{ github.workspace }} used by the GOPATH env var. pwd when cloning + # the repo is /go-agent/ whereas ${{ github.workspace }} + # returns Date: Tue, 19 Oct 2021 08:45:13 -0700 Subject: [PATCH 2/5] (fix issue #397) incorrect table name reported --- v3/newrelic/sqlparse/sqlparse.go | 6 +++--- v3/newrelic/sqlparse/sqlparse_test.go | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/v3/newrelic/sqlparse/sqlparse.go b/v3/newrelic/sqlparse/sqlparse.go index 14cc15e7d..3b02dccdb 100644 --- a/v3/newrelic/sqlparse/sqlparse.go +++ b/v3/newrelic/sqlparse/sqlparse.go @@ -25,9 +25,9 @@ var ( extractTableRegex = regexp.MustCompile(`[\s` + "`" + `"'\(\)\{\}\[\]]*`) updateRegex = regexp.MustCompile(`(?is)^update(?:\s+(?:low_priority|ignore|or|rollback|abort|replace|fail|only))*` + tablePattern) sqlOperations = map[string]*regexp.Regexp{ - "select": regexp.MustCompile(`(?is)^.*?\sfrom` + tablePattern), - "delete": regexp.MustCompile(`(?is)^.*?\sfrom` + tablePattern), - "insert": regexp.MustCompile(`(?is)^.*?\sinto?` + tablePattern), + "select": regexp.MustCompile(`(?is)^.*\sfrom` + tablePattern), + "delete": regexp.MustCompile(`(?is)^.*\sfrom` + tablePattern), + "insert": regexp.MustCompile(`(?is)^.*\sinto?` + tablePattern), "update": updateRegex, "call": nil, "create": nil, diff --git a/v3/newrelic/sqlparse/sqlparse_test.go b/v3/newrelic/sqlparse/sqlparse_test.go index 818172dd2..4f6019e53 100644 --- a/v3/newrelic/sqlparse/sqlparse_test.go +++ b/v3/newrelic/sqlparse/sqlparse_test.go @@ -56,6 +56,7 @@ func TestParseSQLSubQuery(t *testing.T) { {Input: "SELECT * FROM (SELECT * FROM foobar)", Operation: "select", Table: "foobar"}, {Input: "SELECT * FROM (SELECT * FROM foobar) WHERE x > y", Operation: "select", Table: "foobar"}, {Input: "SELECT * FROM(SELECT * FROM foobar) WHERE x > y", Operation: "select", Table: "foobar"}, + {Input: "SELECT substring('spam' FROM 2 FOR 3) AS x FROM FROMAGE) FROM fromagier", Operation: "select", Table: "fromagier"}, } { tc.test(t) } @@ -71,6 +72,9 @@ func TestParseSQLOther(t *testing.T) { {Input: "SELECT * FROM[ `something`.'foo' ]", Operation: "select", Table: "foo"}, // Test that we handle the cheese. {Input: "SELECT fromage FROM fromagier", Operation: "select", Table: "fromagier"}, + {Input: "SELECT (x from fromage) FROM fromagier", Operation: "select", Table: "fromagier"}, + {Input: "SELECT (x FROM FROMAGE) FROM fromagier", Operation: "select", Table: "fromagier"}, + {Input: "SELECT substring('spam' FROM 2 FOR 3) AS x FROM FROMAGE) FROM fromagier", Operation: "select", Table: "fromagier"}, } { tc.test(t) } From 6538930ddf0ec7fd53462f579e798383db76e2c5 Mon Sep 17 00:00:00 2001 From: Steve Willoughby Date: Wed, 27 Oct 2021 09:43:41 -0700 Subject: [PATCH 3/5] Upgraded echo/v4 dependency version --- v3/integrations/nrecho-v4/go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v3/integrations/nrecho-v4/go.mod b/v3/integrations/nrecho-v4/go.mod index c540cec42..3363a2217 100644 --- a/v3/integrations/nrecho-v4/go.mod +++ b/v3/integrations/nrecho-v4/go.mod @@ -5,6 +5,6 @@ module github.com/newrelic/go-agent/v3/integrations/nrecho-v4 go 1.12 require ( - github.com/labstack/echo/v4 v4.0.0 - github.com/newrelic/go-agent/v3 v3.0.0 + github.com/labstack/echo/v4 v4.5.0 + github.com/newrelic/go-agent/v3 v3.15.0 ) From 7f454839bfe212773214c487ddbc146c709ae5a1 Mon Sep 17 00:00:00 2001 From: Steve Willoughby Date: Wed, 27 Oct 2021 10:04:31 -0700 Subject: [PATCH 4/5] release 3.15.1 --- CHANGELOG.md | 17 +++++++++++++++++ v3/newrelic/version.go | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6627e4ec..340a7111d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,21 @@ # ChangeLog +## 3.15.1 + +### Fixed + +* Updated support for SQL database instrumentation across the board for the Go Agent’s database integrations to more accurately extract the database table name from SQL queries. Fixes [Issue #397](https://github.com/newrelic/go-agent/issues/397). + +* Updated the `go.mod` file in the `nrecho-v4` integration to require version 4.5.0 of the `github.com/labstack/echo` package. This addresses a security concern arising from downstream dependencies in older versions of the echo package, as described in the [release notes](https://github.com/labstack/echo/releases/tag/v4.5.0) for `echo` v4.5.0. + +### ARM64 Compatibility Note + +The New Relic Go Agent is implemented in platform-independent Go, and supports (among the other platforms which run Go) ARM64/Graviton2 using Go 1.17+. + +### Support Statement + +New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life. + + ## 3.15.0 diff --git a/v3/newrelic/version.go b/v3/newrelic/version.go index b570ffa3a..91c05fdea 100644 --- a/v3/newrelic/version.go +++ b/v3/newrelic/version.go @@ -11,7 +11,7 @@ import ( const ( // Version is the full string version of this Go Agent. - Version = "3.15.0" + Version = "3.15.1" ) var ( From 56ff5a7a1cbb2178fc01f43240f3847de144ffe1 Mon Sep 17 00:00:00 2001 From: Rich Vanderwal Date: Wed, 27 Oct 2021 11:16:42 -0700 Subject: [PATCH 5/5] Make Trace Observer test even slower for arm64 emulator --- v3/newrelic/trace_observer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v3/newrelic/trace_observer_test.go b/v3/newrelic/trace_observer_test.go index da76b8534..71d75a84d 100644 --- a/v3/newrelic/trace_observer_test.go +++ b/v3/newrelic/trace_observer_test.go @@ -902,7 +902,7 @@ func TestTrObsOKSendBackoffNo(t *testing.T) { } // If the default backoff of 15 seconds is used, the second span will not // be received in time. - if !s.DidSpansArrive(t, 2, 2*time.Second) { + if !s.DidSpansArrive(t, 2, 4*time.Second) { t.Error("server did not receive 2 spans") } }