Skip to content

Commit ac0e154

Browse files
mirackarasiddhesh-tamhanekarfrankywahlEmilio GarciaMitulShah1
authored
Release 3.39.0 (#1030)
* added SessionResetter into driver_conn optional interfaces * Update nrslog example * nrslog in logs in context used a deprecated version of the nrslog API. We update the example to reflect better how to use it using the new API so that users can reference it and integrate the new API in their code. * move linking metadata to the log message * Implemented Go Fiber framework new relic middleware * added read me file * support time objects for attribute values * fix broken EOL policy link * improve logs in context unit test tools for attributes * more tests for time objects that can be strings * redis datastore enhancements * feat(filterpath-gin-middleware): add optional filter function on middleware of gingonic * fix nitpicks and improve code * Switch to GitHub Actions Arm Runners (#1024) * switch to native arm runner * version bump --------- Co-authored-by: Siddhesh Tamhanekar <[email protected]> Co-authored-by: Franky W. <[email protected]> Co-authored-by: Emilio Garcia <[email protected]> Co-authored-by: MitulShah1 <[email protected]> Co-authored-by: Steve Willoughby <[email protected]> Co-authored-by: Furkan <[email protected]> Co-authored-by: Steve Willoughby <[email protected]>
1 parent 2003267 commit ac0e154

File tree

84 files changed

+4085
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4085
-205
lines changed

.github/workflows/ci.yaml

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
matrix:
1616
include:
1717
# Core Tests on 3 most recent major Go versions
18-
- go-version: 1.21.13
18+
- go-version: 1.24.0
1919
dirs: v3/newrelic,v3/internal,v3/examples
20-
- go-version: 1.22.7
20+
- go-version: 1.23.0
2121
dirs: v3/newrelic,v3/internal,v3/examples
2222
- go-version: latest
2323
dirs: v3/newrelic,v3/internal,v3/examples
@@ -40,6 +40,7 @@ jobs:
4040
- dirs: v3/integrations/nrecho-v4
4141
- dirs: v3/integrations/nrelasticsearch-v7
4242
- dirs: v3/integrations/nrgin
43+
- dirs: v3/integrations/nrfiber
4344
- dirs: v3/integrations/nrgorilla
4445
- dirs: v3/integrations/nrgraphgophers
4546
- dirs: v3/integrations/nrlogrus
@@ -76,7 +77,46 @@ jobs:
7677
uses: actions/checkout@v2
7778
with:
7879
path: "go-agent"
79-
80+
81+
- name: Set up Go
82+
uses: actions/setup-go@v5
83+
with:
84+
go-version: 1.24.0
85+
check-latest: true
86+
87+
- name: Install dependencies
88+
run: |
89+
IFS=',' read -ra DIR_LIST <<< "${{ matrix.dirs }}"
90+
for dir in "${DIR_LIST[@]}"; do
91+
cd go-agent/$dir
92+
if [[ "$dir" == "v3/integrations/nrnats" ]]; then
93+
GOPROXY=direct go mod tidy
94+
else
95+
go mod tidy
96+
fi
97+
cd - # Return to the root to avoid path issues
98+
done
99+
100+
- name: Run tests
101+
run: |
102+
IFS=',' read -ra DIR_LIST <<< "${{ matrix.dirs }}"
103+
for dir in "${DIR_LIST[@]}"; do
104+
if [[ "$dir" == "v3/examples" ]]; then
105+
echo "Skipping tests for $dir"
106+
continue
107+
fi
108+
cd go-agent/$dir
109+
# Generate coverage profile
110+
go test -coverprofile=coverage.txt
111+
cd - # Return to root to avoid path issues
112+
done
113+
114+
- name: Upload results to Codecov
115+
uses: codecov/codecov-action@v5
116+
with:
117+
token: ${{ secrets.CODECOV_TOKEN }}
118+
files: go-agent/${{ matrix.dirs }}/coverage.txt
119+
80120

81121
- name: Build Docker Image
82122
run: docker build -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-amd64
@@ -102,16 +142,16 @@ jobs:
102142
103143
# Arm64 tests
104144
go-agent-v3-arm64:
105-
runs-on: ubuntu-latest
145+
runs-on: ubuntu-24.04-arm
106146
strategy:
107147
# if one test fails, do not abort the rest
108148
fail-fast: false
109149
matrix:
110150
include:
111151
# Core Tests on 3 most recent major Go versions
112-
- go-version: 1.21.13
152+
- go-version: 1.24.0
113153
dirs: v3/newrelic,v3/internal,v3/examples
114-
- go-version: 1.22.7
154+
- go-version: 1.23.0
115155
dirs: v3/newrelic,v3/internal,v3/examples
116156
- go-version: latest
117157
dirs: v3/newrelic,v3/internal,v3/examples
@@ -121,25 +161,25 @@ jobs:
121161
with:
122162
path: "go-agent"
123163

124-
- name: Set up QEMU
125-
uses: docker/setup-qemu-action@v1
126-
127-
- name: Set up Docker Buildx
128-
uses: docker/setup-buildx-action@v1
129-
164+
130165
- name: Build Docker Image
131-
run: |
132-
docker buildx create --use
133-
docker buildx build --platform linux/arm64 -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-arm64 --load
134-
- name: Run Tests in Docker
166+
run: docker build -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-amd64
167+
168+
- name: Set up Docker container and run tests
135169
run: |
136170
IFS=',' read -ra DIRS <<< "${{ matrix.dirs }}"
137171
for dir in "${DIRS[@]}"; do
138172
if [ -d "go-agent/$dir" ]; then
173+
# Create Coverage Report Directory for CodeCov
139174
coverage_dir="${{ github.workspace }}/coverage-reports"
140175
mkdir -p "$coverage_dir"
141-
docker run -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e GITHUB_HEAD_REF=${GITHUB_HEAD_REF} -v "$coverage_dir:/coverage" go-agent-tests-arm64 ./go-agent/run-tests.sh "$dir" "/coverage"
176+
# Special case for nrnats, which requires direct module proxying
177+
if [[ "$dir" == *"nrnats"* ]]; then
178+
docker run -e GOPROXY=direct -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e GITHUB_HEAD_REF=${GITHUB_HEAD_REF} -v "$coverage_dir:/coverage" go-agent-tests-amd64 ./go-agent/run-tests.sh "$dir" "/coverage"
179+
else
180+
docker run -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e GITHUB_HEAD_REF=${GITHUB_HEAD_REF} -v "$coverage_dir:/coverage" go-agent-tests-amd64 ./go-agent/run-tests.sh "$dir" "/coverage"
181+
fi
142182
else
143183
echo "Directory /app/$dir does not exist."
144184
fi
145-
done
185+
done

CHANGELOG.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 3.39.0
2+
### Added
3+
* Added nrfiber integration for go fiber framework
4+
* Thank you to community member @MitulShah1 for contributing to this solution
5+
* Updated nrslog example with new API
6+
* Thank you to community member @frankywahl for contributing to this solution
7+
* Add Optional Path Filtering Function to nrgin Middleware
8+
* Thank you to community member @frknikiz for contributing to this solution
9+
* Added ConfigDatastoreKeysEnabled to nrreddis integration allowing for reporting the names of keys along with the datastore operations
10+
* Switched GitHub Action Testing Suite from an Emulated ARM layer to Native ARM layers
11+
* Added support for time objects for attribute values for nrslog
12+
### Fixed
13+
* Fixed linking metadata location in log messages
14+
### Support statement
15+
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.
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.38.0
220
### Added
321
* Added new integration nrgochi v1.0.0 for support for go-chi library
@@ -10,7 +28,7 @@
1028

1129
### Support statement
1230
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.
13-
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.
31+
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.
1432

1533
## 3.37.0
1634
### Enhanced
@@ -32,7 +50,7 @@ See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol
3250

3351
### Support statement
3452
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.
35-
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.
53+
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.
3654

3755

3856
## 3.36.0
@@ -53,7 +71,7 @@ See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol
5371

5472
### Support statement
5573
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.
56-
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.
74+
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.
5775

5876
## 3.35.1
5977
### Fixed
@@ -63,7 +81,7 @@ See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol
6381

6482
### Support statement
6583
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.
66-
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.
84+
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.
6785

6886
## 3.35.0
6987
### Added
@@ -94,7 +112,7 @@ See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol
94112

95113
### Support statement
96114
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.
97-
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.
115+
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.
98116

99117
## 3.34.0
100118
### Added
@@ -108,7 +126,7 @@ See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol
108126
- switched protobuff to google.golang.org/protobuff in modfile
109127
### Support statement
110128
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.
111-
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.
129+
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.
112130

113131

114132
## 3.33.1
@@ -123,7 +141,7 @@ See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol
123141
- Fixed a minor bug relating to ExpectStatusCodes in `app_run.go`
124142
### Support statement
125143
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.
126-
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.
144+
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.
127145

128146

129147
## 3.33.0
@@ -143,7 +161,7 @@ These changes increment the affected integration package version numbers to:
143161

144162
### Support statement
145163
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.
146-
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.
164+
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.
147165
## 3.32.0
148166
### Added
149167
* Updates to support for the New Relic security agent to report API endpoints.
@@ -313,7 +331,7 @@ Since the erroneous `v3.25.0` tag was already visible publicly and may already h
313331
### Support statement
314332
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).
315333
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/)
316-
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.
334+
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.
317335

318336
## 3.24.1
319337
### Fixed
@@ -342,7 +360,7 @@ We use the latest version of the Go language. At minimum, you should be using no
342360

343361
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/)
344362

345-
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.
363+
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.
346364

347365
## 3.24.0
348366

@@ -365,7 +383,7 @@ We use the latest version of the Go language. At minimum, you should be using no
365383

366384
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/)
367385

368-
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.
386+
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.
369387

370388

371389

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ https://docs.newrelic.com/docs/agents/go-agent/get-started/go-agent-compatibilit
7272
| Project | Integration Package | |
7373
| ------------- | ------------- | - |
7474
| [gin-gonic/gin](https://github.com/gin-gonic/gin) | [v3/integrations/nrgin](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgin) | Instrument inbound requests through the Gin framework |
75+
| [gofiber/fiber](https://github.com/gofiber/fiber) | [v3/integrations/nrfiber](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrfiber) | Instrument inbound requests through the Fiber framework |
7576
| [gorilla/mux](https://github.com/gorilla/mux) | [v3/integrations/nrgorilla](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgorilla) | Instrument inbound requests through the Gorilla framework |
7677
| [google.golang.org/grpc](https://github.com/grpc/grpc-go) | [v3/integrations/nrgrpc](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgrpc) | Instrument gRPC servers and clients |
7778
| [labstack/echo](https://github.com/labstack/echo) | [v3/integrations/nrecho-v3](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrecho-v3) | Instrument inbound requests through version 3 of the Echo framework |

codecov.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coverage:
2+
status:
3+
project: true
4+
patch: true
5+
changes: false
6+
7+
ignore:
8+
- "go-agent/v3/newrelic/sql_driver_optional_methods.go"
9+
10+
comment:
11+
layout: "reach,diff,flags,files,footer"
12+
behavior: default
13+
require_changes: false

run-tests.sh

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
export PATH=$PATH:/usr/local/go/bin
44
# Test directory is passed in as an argument
55
TEST_DIR=$1
6-
COVERAGE_DIR=$2
7-
COVERAGE_FILE="$COVERAGE_DIR/coverage.out"
8-
9-
echo "Coverage profile will be created at $COVERAGE_FILE"
106

117
# Function for checking Go Code Formatting
128
verify_go_fmt() {
@@ -20,25 +16,12 @@ verify_go_fmt() {
2016

2117
# Replace go-agent with local pull
2218
cd go-agent/v3
23-
go mod edit -replace github.com/newrelic/go-agent/v3="$pwd"/v3
19+
go mod edit -replace github.com/newrelic/go-agent/v3="$(pwd)/v3"
2420
cd ../
2521
cd $TEST_DIR
2622

2723
go mod tidy
2824
# Run Tests and Create Cover Profile for Code Coverage
29-
go test -race -benchtime=1ms -bench=. -coverprofile="$COVERAGE_FILE" -covermode=atomic -coverpkg=./... ./...
25+
go test -race -benchtime=1ms -bench=. ./...
3026
go vet ./...
31-
verify_go_fmt
32-
33-
# Remove sql_driver_optional_methods from coverage.out file if it exists
34-
sed -i '/sql_driver_optional_methods/d' "$COVERAGE_FILE"
35-
36-
## CodeCov Uploader
37-
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step
38-
curl -Os https://uploader.codecov.io/latest/linux/codecov
39-
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
40-
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
41-
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM
42-
shasum -a 256 -c codecov.SHA256SUM
43-
chmod +x codecov
44-
./codecov -t ${CODECOV_TOKEN} -f "$COVERAGE_FILE" -B "${GITHUB_HEAD_REF:-$GITHUB_REF}"
27+
verify_go_fmt

v3/integrations/logcontext-v2/logWriter/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/logWriter
33
go 1.22
44

55
require (
6-
github.com/newrelic/go-agent/v3 v3.38.0
6+
github.com/newrelic/go-agent/v3 v3.39.0
77
github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrwriter v1.0.0
88
)
99

v3/integrations/logcontext-v2/nrlogrus/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrlogrus
33
go 1.22
44

55
require (
6-
github.com/newrelic/go-agent/v3 v3.38.0
6+
github.com/newrelic/go-agent/v3 v3.39.0
77
github.com/sirupsen/logrus v1.8.1
88
)
99

v3/integrations/logcontext-v2/nrslog/example/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ func main() {
2121
}
2222

2323
app.WaitForConnection(time.Second * 5)
24-
log := slog.New(nrslog.TextHandler(app, os.Stdout, &slog.HandlerOptions{}))
24+
25+
handler := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{})
26+
nrHandler := nrslog.WrapHandler(app, handler)
27+
log := slog.New(nrHandler)
2528

2629
log.Info("I am a log message")
2730

v3/integrations/logcontext-v2/nrslog/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrslog
22

33
go 1.22
44

5-
require github.com/newrelic/go-agent/v3 v3.38.0
5+
require github.com/newrelic/go-agent/v3 v3.39.0
66

77

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

0 commit comments

Comments
 (0)