Skip to content

Commit c611087

Browse files
Merge pull request #581 from nr-swilloughby/master
Release v3.19.2
2 parents 6b4e605 + 09c4fca commit c611087

File tree

19 files changed

+218
-83
lines changed

19 files changed

+218
-83
lines changed

.github/workflows/ci.yaml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,41 @@ jobs:
8585
dirs: _integrations/nrb3
8686
- go-version: 1.13.x
8787
dirs: _integrations/nrmongo
88+
steps:
89+
- name: Install Go
90+
uses: actions/setup-go@v1
91+
with:
92+
go-version: ${{ matrix.go-version }}
8893

89-
# v3 agent
94+
- name: Checkout Code
95+
uses: actions/checkout@v1
96+
with:
97+
# Required when using older versions of Go that do not support gomod.
98+
# Note the required presence of the /go-agent/ directory at the
99+
# beginning of this path. It is required in order to match the
100+
# ${{ github.workspace }} used by the GOPATH env var. pwd when cloning
101+
# the repo is <something>/go-agent/ whereas ${{ github.workspace }}
102+
# returns <something/go-agent/go-agent/.
103+
path: ./go-agent/src/github.com/newrelic/go-agent
104+
105+
- name: Run Tests
106+
run: bash build-script.sh
107+
env:
108+
DIRS: ${{ matrix.dirs }}
109+
EXTRATESTING: ${{ matrix.extratesting }}
110+
PIN: ${{ matrix.pin }}
111+
112+
go-agent-v3:
113+
runs-on: ubuntu-18.04
114+
env:
115+
# Required when using older versions of Go that do not support gomod.
116+
GOPATH: ${{ github.workspace }}
117+
118+
strategy:
119+
# if one test fails, do not abort the rest
120+
fail-fast: false
121+
matrix:
122+
include:
90123
- go-version: 1.17.x
91124
dirs: v3/newrelic,v3/internal,v3/examples
92125
- go-version: 1.18.x
@@ -183,16 +216,13 @@ jobs:
183216
extratesting: go get -u github.com/nats-io/nats.go/@master
184217
- go-version: 1.17.x
185218
dirs: v3/integrations/nrnats/test
186-
extratesting: go get -u github.com/nats-io/nats.go/@master
187219
- go-version: 1.17.x
188220
dirs: v3/integrations/nrstan
189221
extratesting: go get -u github.com/nats-io/stan.go/@master
190222
- go-version: 1.17.x
191223
dirs: v3/integrations/nrstan/test
192-
extratesting: go get -u github.com/nats-io/stan.go/@master
193224
- go-version: 1.17.x
194225
dirs: v3/integrations/nrstan/examples
195-
extratesting: go get -u github.com/nats-io/stan.go/@master
196226
- go-version: 1.17.x
197227
dirs: v3/integrations/logcontext
198228
extratesting: go get -u github.com/sirupsen/logrus@master
@@ -233,7 +263,7 @@ jobs:
233263
path: ./go-agent/src/github.com/newrelic/go-agent
234264

235265
- name: Run Tests
236-
run: bash build-script.sh
266+
run: bash v3/build-script.sh
237267
env:
238268
DIRS: ${{ matrix.dirs }}
239269
EXTRATESTING: ${{ matrix.extratesting }}

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 3.19.2
2+
3+
### Changed
4+
* Updated nrgin integration to more accurately report code locations when code level metrics are enabled.
5+
* The Go Agent and all integrations now require Go version 1.17 or later.
6+
* Updated minimum versions for third-party modules.
7+
* nrawssdk-v2, nrecho-v4, nrgrpc, nrmongo, nrmysql, nrnats, and nrstan now require Go Agent 3.18.2 or later
8+
* the Go Agent now requires protobuf 1.5.2 and grpc 1.49.0
9+
* Internal dev process and unit test improvements.
10+
11+
### Support Statement
12+
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.
13+
14+
We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
15+
16+
See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
17+
18+
119
## 3.19.1 - Hotfix Release
220

321
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Go is a compiled language, and doesn’t use a virtual machine. This means that
1414

1515
### Compatibility and Requirements
1616

17-
For the latest version of the agent, Go 1.7+ is required, due to the use of `context.Context`.
17+
For the latest version of the agent, Go 1.17+ is required.
1818

1919
Linux, OS X, and Windows (Vista, Server 2008 and later) are supported.
2020

v3/build-script.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright 2020 New Relic Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
set -x
5+
set -e
6+
7+
# inputs
8+
# 1: repo pin; example: github.com/rewrelic/[email protected]
9+
pin_go_dependency() {
10+
if [[ ! -z "$1" ]]; then
11+
echo "Pinning: $1"
12+
repo=$(echo "$1" | cut -d '@' -f1)
13+
pinTo=$(echo "$1" | cut -d '@' -f2)
14+
set +e
15+
go get -u "$repo" # this go get will fail to build
16+
set -e
17+
cd "$GOPATH"/src/"$repo"
18+
git checkout "$pinTo"
19+
cd -
20+
fi
21+
}
22+
23+
verify_go_fmt() {
24+
needsFMT=$(gofmt -d .)
25+
if [ ! -z "$needsFMT" ]; then
26+
echo "$needsFMT"
27+
echo "Please format your code with \"gofmt .\""
28+
# exit 1
29+
fi
30+
}
31+
32+
pwd=$(pwd)
33+
version=$(go version)
34+
echo $version
35+
36+
tmp=$(echo $version | cut -d 'o' -f4)
37+
shortVersion=${tmp%.*}
38+
39+
IFS=","
40+
for dir in $DIRS; do
41+
cd "$pwd/$dir"
42+
43+
# replace go-agent with local pull
44+
go mod edit -replace github.com/newrelic/go-agent/v3="$pwd"/v3
45+
46+
# manage dependencies
47+
go mod tidy -go=$shortVersion -compat=$shortVersion
48+
pin_go_dependency "$PIN"
49+
50+
# run tests
51+
go test -race -benchtime=1ms -bench=. ./...
52+
go vet ./...
53+
verify_go_fmt
54+
55+
# Test again against the latest version of the dependencies to ensure that
56+
# our instrumentation is up to date. TODO: Perhaps it is possible to
57+
# upgrade all go.mod dependencies to latest master with a go command.
58+
if [ -n "$EXTRATESTING" ]; then
59+
eval "$EXTRATESTING"
60+
go test -race -benchtime=1ms -bench=. ./...
61+
fi
62+
done

v3/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/newrelic/go-agent/v3
22

3-
go 1.7
3+
go 1.17
44

55
require (
6-
github.com/golang/protobuf v1.4.3
7-
google.golang.org/grpc v1.39.0
6+
github.com/golang/protobuf v1.5.2
7+
google.golang.org/grpc v1.49.0
88
)

v3/integrations/nrawssdk-v2/go.mod

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ module github.com/newrelic/go-agent/v3/integrations/nrawssdk-v2
22

33
// As of May 2021, the aws-sdk-go-v2 go.mod file uses 1.15:
44
// https://github.com/aws/aws-sdk-go-v2/blob/master/go.mod
5-
go 1.15
6-
7-
replace github.com/newrelic/go-agent/v3 => ../../
5+
go 1.17
86

97
require (
10-
github.com/aws/aws-sdk-go-v2 v1.4.0
11-
github.com/aws/aws-sdk-go-v2/config v1.1.7
12-
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.3
13-
github.com/aws/aws-sdk-go-v2/service/lambda v1.2.3
14-
github.com/aws/aws-sdk-go-v2/service/s3 v1.6.0
15-
github.com/aws/smithy-go v1.4.0
16-
github.com/newrelic/go-agent/v3 v3.0.0
17-
golang.org/x/tools v0.1.0 // indirect
8+
github.com/aws/aws-sdk-go-v2 v1.16.15
9+
github.com/aws/aws-sdk-go-v2/config v1.17.6
10+
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.0
11+
github.com/aws/aws-sdk-go-v2/service/lambda v1.24.5
12+
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.10
13+
github.com/aws/smithy-go v1.13.3
14+
github.com/newrelic/go-agent/v3 v3.18.2
1815
)

v3/integrations/nrecho-v4/go.mod

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrecho-v4
44
// https://github.com/labstack/echo/blob/master/go.mod
55
go 1.17
66

7-
87
require (
98
github.com/labstack/echo/v4 v4.5.0
10-
github.com/newrelic/go-agent/v3 v3.16.1
11-
)
12-
13-
require (
14-
github.com/golang/protobuf v1.4.3 // indirect
15-
github.com/labstack/gommon v0.3.0 // indirect
16-
github.com/mattn/go-colorable v0.1.8 // indirect
17-
github.com/mattn/go-isatty v0.0.12 // indirect
18-
github.com/valyala/bytebufferpool v1.0.0 // indirect
19-
github.com/valyala/fasttemplate v1.2.1 // indirect
20-
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
21-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
22-
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
23-
golang.org/x/text v0.3.6 // indirect
24-
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
25-
google.golang.org/grpc v1.39.0 // indirect
26-
google.golang.org/protobuf v1.25.0 // indirect
9+
github.com/newrelic/go-agent/v3 v3.18.2
2710
)

v3/integrations/nrgin/example/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func main() {
5858
newrelic.ConfigAppName("Gin App"),
5959
newrelic.ConfigLicense(os.Getenv("NEW_RELIC_LICENSE_KEY")),
6060
newrelic.ConfigDebugLogger(os.Stdout),
61+
newrelic.ConfigCodeLevelMetricsEnabled(true),
6162
)
6263
if nil != err {
6364
fmt.Println(err)

v3/integrations/nrgin/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ go 1.12
66

77
require (
88
github.com/gin-gonic/gin v1.8.0
9-
github.com/newrelic/go-agent/v3 v3.17.0
9+
github.com/newrelic/go-agent/v3 v3.18.2
1010
)

v3/integrations/nrgin/nrgin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func middleware(app *newrelic.Application, useNewNames bool) gin.HandlerFunc {
144144
name := c.Request.Method + " " + getName(c, useNewNames)
145145

146146
w := &headerResponseWriter{w: c.Writer}
147-
txn := app.StartTransaction(name)
147+
txn := app.StartTransaction(name, newrelic.WithFunctionLocation(c.Handler()))
148148
txn.SetWebRequestHTTP(c.Request)
149149
defer txn.End()
150150

0 commit comments

Comments
 (0)