diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b5636a35..9fd0c4ad3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,225 +1,140 @@ -# Copyright 2020 New Relic Corporation. All rights reserved. +# Copyright 2023 New Relic Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 - name: Go Agent CI - on: pull_request +env: + # Specifies which go version to run integration tests on + INTEGRATION_TESTS_GO_VERSION: 1.21.5 jobs: go-agent-v3: runs-on: ubuntu-latest - env: - # Required when using older versions of Go that do not support gomod. - GOPATH: ${{ github.workspace }} - strategy: # if one test fails, do not abort the rest fail-fast: false matrix: include: - - go-version: 1.19.x + # Core Tests on 3 most recent major Go versions + - go-version: 1.19.0 dirs: v3/newrelic,v3/internal,v3/examples - - go-version: 1.20.x + - go-version: 1.20.0 dirs: v3/newrelic,v3/internal,v3/examples - - go-version: 1.21.x + - go-version: 1.21.0 dirs: v3/newrelic,v3/internal,v3/examples - # v3 integrations - - go-version: 1.19.x - dirs: v3/integrations/nramqp - - go-version: 1.19.x - dirs: v3/integrations/nrfasthttp - - go-version: 1.19.x - dirs: v3/integrations/nrsarama - - go-version: 1.19.x - dirs: v3/integrations/logcontext/nrlogrusplugin - # extratesting: go get -u github.com/sirupsen/logrus@master - - go-version: 1.19.x - dirs: v3/integrations/logcontext-v2/nrlogrus - # extratesting: go get -u github.com/sirupsen/logrus@master - - go-version: 1.19.x - dirs: v3/integrations/logcontext-v2/nrzerolog - extratesting: go get -u github.com/rs/zerolog@master - - go-version: 1.19.x - dirs: v3/integrations/logcontext-v2/nrzap - - go-version: 1.19.x - dirs: v3/integrations/logcontext-v2/nrwriter - - go-version: 1.19.x - dirs: v3/integrations/logcontext-v2/zerologWriter - extratesting: go get -u github.com/rs/zerolog@master - - go-version: 1.19.x - dirs: v3/integrations/logcontext-v2/logWriter - - go-version: 1.19.x - dirs: v3/integrations/nrawssdk-v1 - extratesting: go get -u github.com/aws/aws-sdk-go@main - - go-version: 1.19.x - dirs: v3/integrations/nrawssdk-v2 - extratesting: go get -u github.com/aws/aws-sdk-go-v2@main - - go-version: 1.19.x - dirs: v3/integrations/nrecho-v3 - # Test against the latest v3 Echo: - extratesting: go get -u github.com/labstack/echo@v3 - # go/new/http no longer stable under go 1.18.x - - go-version: 1.19.x - dirs: v3/integrations/nrecho-v4 - extratesting: go get -u github.com/labstack/echo/v4@master - - go-version: 1.19.x - dirs: v3/integrations/nrelasticsearch-v7 - extratesting: go get -u github.com/elastic/go-elasticsearch/v7@7.x - - go-version: 1.19.x - dirs: v3/integrations/nrgin - extratesting: go get -u github.com/gin-gonic/gin@master - - go-version: 1.19.x - dirs: v3/integrations/nrgorilla - extratesting: go get -u github.com/gorilla/mux@master - - go-version: 1.19.x - dirs: v3/integrations/nrgraphgophers - - go-version: 1.19.x - dirs: v3/integrations/nrlogrus - - go-version: 1.19.x - dirs: v3/integrations/nrlogxi - extratesting: go get -u github.com/mgutz/logxi@master - - go-version: 1.19.x - dirs: v3/integrations/nrpkgerrors - extratesting: go get -u github.com/pkg/errors@master - - go-version: 1.19.x - dirs: v3/integrations/nrlambda - extratesting: go get -u github.com/aws/aws-lambda-go@master - - go-version: 1.19.x - dirs: v3/integrations/nrmysql - extratesting: go get -u github.com/go-sql-driver/mysql@master - - go-version: 1.19.x - dirs: v3/integrations/nrpq - extratesting: go get -u github.com/lib/pq@master - - go-version: 1.19.x - dirs: v3/integrations/nrpgx5 - - go-version: 1.19.x - dirs: v3/integrations/nrpq/example/sqlx - - go-version: 1.19.x - dirs: v3/integrations/nrredis-v7 - extratesting: go get -u github.com/go-redis/redis/v7@master - - go-version: 1.19.x - dirs: v3/integrations/nrredis-v9 - extratesting: go get -u github.com/redis/go-redis/v9@master - - go-version: 1.19.x - dirs: v3/integrations/nrsqlite3 - extratesting: go get -u github.com/mattn/go-sqlite3@master - - go-version: 1.19.x - dirs: v3/integrations/nrsnowflake - - go-version: 1.19.x - dirs: v3/integrations/nrgrpc - extratesting: go get -u google.golang.org/grpc@master - - go-version: 1.19.x - dirs: v3/integrations/nrmicro - # As of Dec 2019, there is a race condition in when using go-micro@master - # in their logging system. Instead, we'll test against the latest - # released version. - # As of Jan 2019, it is impossible to go get the latest micro version. - # As of June 2020, confirmed errors still result - # extratesting: go get -u github.com/micro/go-micro@latest - # If we are using the latest released version to test, we need to use a newer version of go - - go-version: 1.19.x - dirs: v3/integrations/nrnats - extratesting: go get -u github.com/nats-io/nats.go - goproxy: direct - - go-version: 1.19.x - dirs: v3/integrations/nrstan - extratesting: go get -u github.com/nats-io/stan.go/@master - - go-version: 1.19.x - dirs: v3/integrations/nrstan/test - - go-version: 1.19.x - dirs: v3/integrations/nrstan/examples - - go-version: 1.19.x - dirs: v3/integrations/logcontext - extratesting: go get -u github.com/sirupsen/logrus@master - # nrzap only supports the two most recent minor go releases - - go-version: 1.19.x - dirs: v3/integrations/nrzap - - go-version: 1.19.x - dirs: v3/integrations/nrhttprouter - extratesting: go get -u github.com/julienschmidt/httprouter@master - - go-version: 1.19.x - dirs: v3/integrations/nrb3 - - go-version: 1.19.x - dirs: v3/integrations/nrmongo - - go-version: 1.19.x - dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example - extratesting: go get -u github.com/graphql-go/graphql@master - - go-version: 1.19.x - dirs: v3/integrations/nrmssql - extratesting: go get -u github.com/microsoft/go-mssqldb@main - + # Integration Tests on highest Supported Go Version + - dirs: v3/integrations/nramqp + - dirs: v3/integrations/nrfasthttp + - dirs: v3/integrations/nrsarama + - dirs: v3/integrations/logcontext/nrlogrusplugin + - dirs: v3/integrations/logcontext-v2/nrlogrus + - dirs: v3/integrations/logcontext-v2/nrzerolog + - dirs: v3/integrations/logcontext-v2/nrzap + - dirs: v3/integrations/logcontext-v2/nrwriter + - dirs: v3/integrations/logcontext-v2/zerologWriter + - dirs: v3/integrations/logcontext-v2/logWriter + - dirs: v3/integrations/nrawssdk-v1 + - dirs: v3/integrations/nrawssdk-v2 + - dirs: v3/integrations/nrecho-v3 + - dirs: v3/integrations/nrecho-v4 + - dirs: v3/integrations/nrelasticsearch-v7 + - dirs: v3/integrations/nrgin + - dirs: v3/integrations/nrgorilla + - dirs: v3/integrations/nrgraphgophers + - dirs: v3/integrations/nrlogrus + - dirs: v3/integrations/nrlogxi + - dirs: v3/integrations/nrpkgerrors + - dirs: v3/integrations/nrlambda + - dirs: v3/integrations/nrmysql + - dirs: v3/integrations/nrpq + - dirs: v3/integrations/nrpgx5 + - dirs: v3/integrations/nrpq/example/sqlx + - dirs: v3/integrations/nrredis-v7 + - dirs: v3/integrations/nrredis-v9 + - dirs: v3/integrations/nrsqlite3 + - dirs: v3/integrations/nrsnowflake + - dirs: v3/integrations/nrgrpc + - dirs: v3/integrations/nrmicro + - dirs: v3/integrations/nrnats + - dirs: v3/integrations/nrstan + - dirs: v3/integrations/nrstan/test + - dirs: v3/integrations/nrstan/examples + - dirs: v3/integrations/logcontext + - dirs: v3/integrations/nrzap + - dirs: v3/integrations/nrhttprouter + - dirs: v3/integrations/nrb3 + - dirs: v3/integrations/nrmongo + - dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example + - dirs: v3/integrations/nrmssql steps: - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout Code - uses: actions/checkout@v1 + uses: actions/checkout@v2 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 /go-agent/ whereas ${{ github.workspace }} - # returns ../../.. diff --git a/v3/integrations/logcontext-v2/nrzap/go.mod b/v3/integrations/logcontext-v2/nrzap/go.mod index 7f7a3f466..30bf65bd6 100644 --- a/v3/integrations/logcontext-v2/nrzap/go.mod +++ b/v3/integrations/logcontext-v2/nrzap/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrzap go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 go.uber.org/zap v1.24.0 ) diff --git a/v3/integrations/logcontext-v2/nrzerolog/go.mod b/v3/integrations/logcontext-v2/nrzerolog/go.mod index 1fba1fe6f..b218b34bb 100644 --- a/v3/integrations/logcontext-v2/nrzerolog/go.mod +++ b/v3/integrations/logcontext-v2/nrzerolog/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrzerolog go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/rs/zerolog v1.26.1 ) diff --git a/v3/integrations/logcontext-v2/zerologWriter/go.mod b/v3/integrations/logcontext-v2/zerologWriter/go.mod index af56d3300..a971ac52f 100644 --- a/v3/integrations/logcontext-v2/zerologWriter/go.mod +++ b/v3/integrations/logcontext-v2/zerologWriter/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext-v2/zerologWriter go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrwriter v1.0.0 github.com/rs/zerolog v1.27.0 ) diff --git a/v3/integrations/logcontext/nrlogrusplugin/go.mod b/v3/integrations/logcontext/nrlogrusplugin/go.mod index 2a69317ca..7fe08fead 100644 --- a/v3/integrations/logcontext/nrlogrusplugin/go.mod +++ b/v3/integrations/logcontext/nrlogrusplugin/go.mod @@ -5,7 +5,7 @@ module github.com/newrelic/go-agent/v3/integrations/logcontext/nrlogrusplugin go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 // v1.4.0 is required for for the log.WithContext. github.com/sirupsen/logrus v1.4.0 ) diff --git a/v3/integrations/nramqp/go.mod b/v3/integrations/nramqp/go.mod index fa6049ed2..a7aaf24c1 100644 --- a/v3/integrations/nramqp/go.mod +++ b/v3/integrations/nramqp/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/nramqp go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/rabbitmq/amqp091-go v1.9.0 ) replace github.com/newrelic/go-agent/v3 => ../.. diff --git a/v3/integrations/nrawssdk-v1/go.mod b/v3/integrations/nrawssdk-v1/go.mod index bd5c735c3..c246c15a8 100644 --- a/v3/integrations/nrawssdk-v1/go.mod +++ b/v3/integrations/nrawssdk-v1/go.mod @@ -8,7 +8,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.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrawssdk-v2/go.mod b/v3/integrations/nrawssdk-v2/go.mod index abf08dbaf..14b47fe13 100644 --- a/v3/integrations/nrawssdk-v2/go.mod +++ b/v3/integrations/nrawssdk-v2/go.mod @@ -11,7 +11,7 @@ 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.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrb3/go.mod b/v3/integrations/nrb3/go.mod index 449b727d5..979ffa3de 100644 --- a/v3/integrations/nrb3/go.mod +++ b/v3/integrations/nrb3/go.mod @@ -2,7 +2,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrb3 go 1.19 -require github.com/newrelic/go-agent/v3 v3.29.0 +require github.com/newrelic/go-agent/v3 v3.29.1 replace github.com/newrelic/go-agent/v3 => ../.. diff --git a/v3/integrations/nrecho-v3/go.mod b/v3/integrations/nrecho-v3/go.mod index a99898545..a5ee47299 100644 --- a/v3/integrations/nrecho-v3/go.mod +++ b/v3/integrations/nrecho-v3/go.mod @@ -8,7 +8,7 @@ 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.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrecho-v4/go.mod b/v3/integrations/nrecho-v4/go.mod index 5a4187a9c..4388509cd 100644 --- a/v3/integrations/nrecho-v4/go.mod +++ b/v3/integrations/nrecho-v4/go.mod @@ -6,7 +6,7 @@ go 1.19 require ( github.com/labstack/echo/v4 v4.9.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrelasticsearch-v7/go.mod b/v3/integrations/nrelasticsearch-v7/go.mod index dd57e78dd..058260767 100644 --- a/v3/integrations/nrelasticsearch-v7/go.mod +++ b/v3/integrations/nrelasticsearch-v7/go.mod @@ -6,7 +6,7 @@ go 1.19 require ( github.com/elastic/go-elasticsearch/v7 v7.17.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrfasthttp/examples/client-fasthttp/go.mod b/v3/integrations/nrfasthttp/examples/client-fasthttp/go.mod index e79b77a6f..5addc7cff 100644 --- a/v3/integrations/nrfasthttp/examples/client-fasthttp/go.mod +++ b/v3/integrations/nrfasthttp/examples/client-fasthttp/go.mod @@ -3,7 +3,7 @@ module client-example go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrfasthttp v1.0.0 github.com/valyala/fasthttp v1.49.0 ) diff --git a/v3/integrations/nrfasthttp/examples/server-fasthttp/go.mod b/v3/integrations/nrfasthttp/examples/server-fasthttp/go.mod index e73b032a8..32fa65f5a 100644 --- a/v3/integrations/nrfasthttp/examples/server-fasthttp/go.mod +++ b/v3/integrations/nrfasthttp/examples/server-fasthttp/go.mod @@ -3,7 +3,7 @@ module server-example go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrfasthttp v1.0.0 github.com/valyala/fasthttp v1.49.0 ) diff --git a/v3/integrations/nrfasthttp/go.mod b/v3/integrations/nrfasthttp/go.mod index 8ceeba214..8a0c4f2b6 100644 --- a/v3/integrations/nrfasthttp/go.mod +++ b/v3/integrations/nrfasthttp/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrfasthttp go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/valyala/fasthttp v1.49.0 ) replace github.com/newrelic/go-agent/v3 => ../.. diff --git a/v3/integrations/nrfasthttp/instrumentation.go b/v3/integrations/nrfasthttp/instrumentation.go index b720eecbe..abefb8460 100644 --- a/v3/integrations/nrfasthttp/instrumentation.go +++ b/v3/integrations/nrfasthttp/instrumentation.go @@ -69,9 +69,9 @@ func WrapHandle(app *newrelic.Application, pattern string, handler fasthttp.Requ txn.SetWebResponse(resp) txn.SetWebRequestHTTP(r) + handler(ctx) if newrelic.IsSecurityAgentPresent() { newrelic.GetSecurityAgentInterface().SendEvent("INBOUND_WRITE", resp.Body(), resp.Header()) } - handler(ctx) } } diff --git a/v3/integrations/nrgin/go.mod b/v3/integrations/nrgin/go.mod index ff78e2e91..b5fe9c9d5 100644 --- a/v3/integrations/nrgin/go.mod +++ b/v3/integrations/nrgin/go.mod @@ -6,7 +6,7 @@ go 1.19 require ( github.com/gin-gonic/gin v1.9.1 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrgorilla/go.mod b/v3/integrations/nrgorilla/go.mod index edcd838f9..bf6f98f68 100644 --- a/v3/integrations/nrgorilla/go.mod +++ b/v3/integrations/nrgorilla/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( // v1.7.0 is the earliest version of Gorilla using modules. github.com/gorilla/mux v1.7.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrgraphgophers/go.mod b/v3/integrations/nrgraphgophers/go.mod index 3f0320e48..b2b7d9791 100644 --- a/v3/integrations/nrgraphgophers/go.mod +++ b/v3/integrations/nrgraphgophers/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( // graphql-go has no tagged releases as of Jan 2020. github.com/graph-gophers/graphql-go v1.3.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrgraphqlgo/example/go.mod b/v3/integrations/nrgraphqlgo/example/go.mod index a8857df20..e62e55236 100644 --- a/v3/integrations/nrgraphqlgo/example/go.mod +++ b/v3/integrations/nrgraphqlgo/example/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/graphql-go/graphql v0.8.1 github.com/graphql-go/graphql-go-handler v0.2.3 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrgraphqlgo v1.0.0 ) diff --git a/v3/integrations/nrgraphqlgo/go.mod b/v3/integrations/nrgraphqlgo/go.mod index 150f95c65..d9434d1db 100644 --- a/v3/integrations/nrgraphqlgo/go.mod +++ b/v3/integrations/nrgraphqlgo/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/graphql-go/graphql v0.8.1 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrgrpc/go.mod b/v3/integrations/nrgrpc/go.mod index e7ffc254e..ef93f3f53 100644 --- a/v3/integrations/nrgrpc/go.mod +++ b/v3/integrations/nrgrpc/go.mod @@ -6,7 +6,7 @@ require ( // protobuf v1.3.0 is the earliest version using modules, we use v1.3.1 // because all dependencies were removed in this version. github.com/golang/protobuf v1.5.3 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrsecurityagent v1.1.0 // v1.15.0 is the earliest version of grpc using modules. google.golang.org/grpc v1.56.3 @@ -14,6 +14,6 @@ require ( ) - replace github.com/newrelic/go-agent/v3/integrations/nrsecurityagent => ../../integrations/nrsecurityagent + replace github.com/newrelic/go-agent/v3 => ../.. diff --git a/v3/integrations/nrgrpc/nrgrpc_server.go b/v3/integrations/nrgrpc/nrgrpc_server.go index a0fab1866..8744f5380 100644 --- a/v3/integrations/nrgrpc/nrgrpc_server.go +++ b/v3/integrations/nrgrpc/nrgrpc_server.go @@ -43,6 +43,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" "google.golang.org/grpc/status" protoV2 "google.golang.org/protobuf/proto" ) @@ -62,13 +63,20 @@ func startTransaction(ctx context.Context, app *newrelic.Application, fullMethod target := hdrs.Get(":authority") url := getURL(method, target) + transport := newrelic.TransportHTTP + + p, ok := peer.FromContext(ctx) + if ok && p != nil && p.AuthInfo != nil && p.AuthInfo.AuthType() == "tls" { + transport = newrelic.TransportHTTPS + } webReq := newrelic.WebRequest{ - Header: hdrs, - URL: url, - Method: method, - Transport: newrelic.TransportHTTP, - Type: "gRPC", + Header: hdrs, + URL: url, + Method: method, + Transport: transport, + Type: "gRPC", + ServerName: target, } txn := app.StartTransaction(method) txn.SetWebRequest(webReq) diff --git a/v3/integrations/nrhttprouter/go.mod b/v3/integrations/nrhttprouter/go.mod index 9c90605b8..bad7131a0 100644 --- a/v3/integrations/nrhttprouter/go.mod +++ b/v3/integrations/nrhttprouter/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( // v1.3.0 is the earliest version of httprouter using modules. github.com/julienschmidt/httprouter v1.3.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrlambda/go.mod b/v3/integrations/nrlambda/go.mod index f35e2129b..c08c9c71d 100644 --- a/v3/integrations/nrlambda/go.mod +++ b/v3/integrations/nrlambda/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/aws/aws-lambda-go v1.41.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrlogrus/go.mod b/v3/integrations/nrlogrus/go.mod index d32b04d62..8f10989ad 100644 --- a/v3/integrations/nrlogrus/go.mod +++ b/v3/integrations/nrlogrus/go.mod @@ -5,7 +5,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrlogrus go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrlogrus v1.0.0 // v1.1.0 is required for the Logger.GetLevel method, and is the earliest // version of logrus using modules. diff --git a/v3/integrations/nrlogxi/go.mod b/v3/integrations/nrlogxi/go.mod index 3e77dc57a..5b1b23cc2 100644 --- a/v3/integrations/nrlogxi/go.mod +++ b/v3/integrations/nrlogxi/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( // 'v1', at commit aebf8a7d67ab, is the only logxi release. github.com/mgutz/logxi v0.0.0-20161027140823-aebf8a7d67ab - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrmicro/go.mod b/v3/integrations/nrmicro/go.mod index 858eacc21..e3996c59e 100644 --- a/v3/integrations/nrmicro/go.mod +++ b/v3/integrations/nrmicro/go.mod @@ -7,8 +7,8 @@ go 1.19 require ( github.com/golang/protobuf v1.5.3 github.com/micro/go-micro v1.8.0 - github.com/newrelic/go-agent/v3 v3.29.0 - google.golang.org/protobuf v1.31.0 + github.com/newrelic/go-agent/v3 v3.29.1 + google.golang.org/protobuf v1.32.0 ) diff --git a/v3/integrations/nrmongo/go.mod b/v3/integrations/nrmongo/go.mod index 9722c5b61..ccc654841 100644 --- a/v3/integrations/nrmongo/go.mod +++ b/v3/integrations/nrmongo/go.mod @@ -5,7 +5,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrmongo go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 // mongo-driver does not support modules as of Nov 2019. go.mongodb.org/mongo-driver v1.10.2 ) diff --git a/v3/integrations/nrmongo/nrmongo.go b/v3/integrations/nrmongo/nrmongo.go index ef7bd6b71..c509962c1 100644 --- a/v3/integrations/nrmongo/nrmongo.go +++ b/v3/integrations/nrmongo/nrmongo.go @@ -33,6 +33,7 @@ package nrmongo import ( "context" "regexp" + "strings" "sync" "github.com/newrelic/go-agent/v3/internal" @@ -99,7 +100,14 @@ func (m *mongoMonitor) started(ctx context.Context, e *event.CommandStartedEvent return } if newrelic.IsSecurityAgentPresent() { - secureAgentEvent = newrelic.GetSecurityAgentInterface().SendEvent("MONGO", getJsonQuery(e.Command), e.CommandName) + commandName := e.CommandName + if strings.ToLower(commandName) == "findandmodify" { + value, ok := e.Command.Lookup("remove").BooleanOK() + if ok && value { + commandName = "delete" + } + } + secureAgentEvent = newrelic.GetSecurityAgentInterface().SendEvent("MONGO", getJsonQuery(e.Command), commandName) } host, port := calcHostAndPort(e.ConnectionID) diff --git a/v3/integrations/nrmssql/go.mod b/v3/integrations/nrmssql/go.mod index 93b23230b..72d7c1f5a 100644 --- a/v3/integrations/nrmssql/go.mod +++ b/v3/integrations/nrmssql/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/microsoft/go-mssqldb v0.19.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrmysql/go.mod b/v3/integrations/nrmysql/go.mod index 4802182fe..978899404 100644 --- a/v3/integrations/nrmysql/go.mod +++ b/v3/integrations/nrmysql/go.mod @@ -7,7 +7,7 @@ require ( // v1.5.0 is the first mysql version to support gomod github.com/go-sql-driver/mysql v1.6.0 // v3.3.0 includes the new location of ParseQuery - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrnats/go.mod b/v3/integrations/nrnats/go.mod index 915559ac1..6ed253247 100644 --- a/v3/integrations/nrnats/go.mod +++ b/v3/integrations/nrnats/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( github.com/nats-io/nats-server v1.4.1 github.com/nats-io/nats.go v1.28.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrnats/test/go.mod b/v3/integrations/nrnats/test/go.mod index ee109042d..1d9eb29e0 100644 --- a/v3/integrations/nrnats/test/go.mod +++ b/v3/integrations/nrnats/test/go.mod @@ -8,7 +8,7 @@ replace github.com/newrelic/go-agent/v3/integrations/nrnats v1.0.0 => ../ require ( github.com/nats-io/nats-server v1.4.1 github.com/nats-io/nats.go v1.17.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrnats v1.0.0 ) diff --git a/v3/integrations/nrpgx/example/sqlx/go.mod b/v3/integrations/nrpgx/example/sqlx/go.mod index 1c9f06b85..6b73f19f8 100644 --- a/v3/integrations/nrpgx/example/sqlx/go.mod +++ b/v3/integrations/nrpgx/example/sqlx/go.mod @@ -4,7 +4,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrpgx/example/sqlx go 1.19 require ( github.com/jmoiron/sqlx v1.2.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrpgx v0.0.0 ) replace github.com/newrelic/go-agent/v3/integrations/nrpgx => ../../ diff --git a/v3/integrations/nrpgx/go.mod b/v3/integrations/nrpgx/go.mod index a572b3d3c..d2fecfb54 100644 --- a/v3/integrations/nrpgx/go.mod +++ b/v3/integrations/nrpgx/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/jackc/pgx v3.6.2+incompatible github.com/jackc/pgx/v4 v4.13.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrpgx5/go.mod b/v3/integrations/nrpgx5/go.mod index d08534f2b..80752b454 100644 --- a/v3/integrations/nrpgx5/go.mod +++ b/v3/integrations/nrpgx5/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/egon12/pgsnap v0.0.0-20221022154027-2847f0124ed8 github.com/jackc/pgx/v5 v5.0.3 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/stretchr/testify v1.8.0 ) diff --git a/v3/integrations/nrpkgerrors/go.mod b/v3/integrations/nrpkgerrors/go.mod index e2c9255a9..3f9b3c3c6 100644 --- a/v3/integrations/nrpkgerrors/go.mod +++ b/v3/integrations/nrpkgerrors/go.mod @@ -5,7 +5,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrpkgerrors go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 // v0.8.0 was the last release in 2016, and when // major development on pkg/errors stopped. github.com/pkg/errors v0.8.0 diff --git a/v3/integrations/nrpq/example/sqlx/go.mod b/v3/integrations/nrpq/example/sqlx/go.mod index 3a9092fe9..d2da80385 100644 --- a/v3/integrations/nrpq/example/sqlx/go.mod +++ b/v3/integrations/nrpq/example/sqlx/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/jmoiron/sqlx v1.2.0 github.com/lib/pq v1.1.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrpq v0.0.0 ) replace github.com/newrelic/go-agent/v3/integrations/nrpq => ../../ diff --git a/v3/integrations/nrpq/go.mod b/v3/integrations/nrpq/go.mod index 75dc70749..e27d05943 100644 --- a/v3/integrations/nrpq/go.mod +++ b/v3/integrations/nrpq/go.mod @@ -6,7 +6,7 @@ require ( // NewConnector dsn parsing tests expect v1.1.0 error return behavior. github.com/lib/pq v1.1.0 // v3.3.0 includes the new location of ParseQuery - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrredis-v7/go.mod b/v3/integrations/nrredis-v7/go.mod index a5ef1349a..212e4ea7c 100644 --- a/v3/integrations/nrredis-v7/go.mod +++ b/v3/integrations/nrredis-v7/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/go-redis/redis/v7 v7.0.0-beta.5 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrredis-v8/go.mod b/v3/integrations/nrredis-v8/go.mod index b038e14de..c38c5d8bd 100644 --- a/v3/integrations/nrredis-v8/go.mod +++ b/v3/integrations/nrredis-v8/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/go-redis/redis/v8 v8.4.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrredis-v9/go.mod b/v3/integrations/nrredis-v9/go.mod index ba8c2d2f0..f8a2127ed 100644 --- a/v3/integrations/nrredis-v9/go.mod +++ b/v3/integrations/nrredis-v9/go.mod @@ -4,7 +4,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrredis-v9 go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/redis/go-redis/v9 v9.0.2 ) diff --git a/v3/integrations/nrsarama/go.mod b/v3/integrations/nrsarama/go.mod index 854d87a72..b82aa9b88 100644 --- a/v3/integrations/nrsarama/go.mod +++ b/v3/integrations/nrsarama/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/Shopify/sarama v1.38.1 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/stretchr/testify v1.8.1 ) diff --git a/v3/integrations/nrsecurityagent/go.mod b/v3/integrations/nrsecurityagent/go.mod index ececdbd1a..9e268821e 100644 --- a/v3/integrations/nrsecurityagent/go.mod +++ b/v3/integrations/nrsecurityagent/go.mod @@ -3,8 +3,8 @@ module github.com/newrelic/go-agent/v3/integrations/nrsecurityagent go 1.19 require ( - github.com/newrelic/csec-go-agent v0.5.1 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/csec-go-agent v0.7.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrsqlite3 v1.2.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/v3/integrations/nrsecurityagent/nrsecurityagent.go b/v3/integrations/nrsecurityagent/nrsecurityagent.go index 3dedd4c41..224d1fe7f 100644 --- a/v3/integrations/nrsecurityagent/nrsecurityagent.go +++ b/v3/integrations/nrsecurityagent/nrsecurityagent.go @@ -163,9 +163,9 @@ func ConfigSecurityValidatorServiceEndPointUrl(url string) ConfigOption { } // ConfigSecurityDetectionDisableRxss is used to enable or disable RXSS validation. -func ConfigSecurityDetectionDisableRxss(isEnabled bool) ConfigOption { +func ConfigSecurityDetectionDisableRxss(isDisable bool) ConfigOption { return func(cfg *SecurityConfig) { - cfg.Security.Detection.Rxss.Enabled = isEnabled + cfg.Security.Detection.Rxss.Enabled = !isDisable } } diff --git a/v3/integrations/nrsnowflake/go.mod b/v3/integrations/nrsnowflake/go.mod index 30a381b61..eb865485b 100644 --- a/v3/integrations/nrsnowflake/go.mod +++ b/v3/integrations/nrsnowflake/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrsnowflake go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/snowflakedb/gosnowflake v1.6.19 ) diff --git a/v3/integrations/nrsqlite3/go.mod b/v3/integrations/nrsqlite3/go.mod index eb3d1ee5f..b661bcf73 100644 --- a/v3/integrations/nrsqlite3/go.mod +++ b/v3/integrations/nrsqlite3/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( github.com/mattn/go-sqlite3 v1.0.0 // v3.3.0 includes the new location of ParseQuery - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrstan/examples/go.mod b/v3/integrations/nrstan/examples/go.mod index 0cc4db9f0..b418e5371 100644 --- a/v3/integrations/nrstan/examples/go.mod +++ b/v3/integrations/nrstan/examples/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrstan/examples go 1.19 require ( github.com/nats-io/stan.go v0.5.0 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrnats v0.0.0 github.com/newrelic/go-agent/v3/integrations/nrstan v0.0.0 ) diff --git a/v3/integrations/nrstan/go.mod b/v3/integrations/nrstan/go.mod index fc2c4f3e6..fc826b498 100644 --- a/v3/integrations/nrstan/go.mod +++ b/v3/integrations/nrstan/go.mod @@ -6,7 +6,7 @@ go 1.19 require ( github.com/nats-io/stan.go v0.10.4 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 ) diff --git a/v3/integrations/nrstan/test/go.mod b/v3/integrations/nrstan/test/go.mod index 264d9af9d..7535757f1 100644 --- a/v3/integrations/nrstan/test/go.mod +++ b/v3/integrations/nrstan/test/go.mod @@ -7,7 +7,7 @@ go 1.19 require ( github.com/nats-io/nats-streaming-server v0.25.6 github.com/nats-io/stan.go v0.10.4 - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 github.com/newrelic/go-agent/v3/integrations/nrstan v0.0.0 ) diff --git a/v3/integrations/nrzap/go.mod b/v3/integrations/nrzap/go.mod index e8bf50c28..4dc3856be 100644 --- a/v3/integrations/nrzap/go.mod +++ b/v3/integrations/nrzap/go.mod @@ -5,7 +5,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrzap go 1.19 require ( - github.com/newrelic/go-agent/v3 v3.29.0 + github.com/newrelic/go-agent/v3 v3.29.1 // v1.12.0 is the earliest version of zap using modules. go.uber.org/zap v1.12.0 ) diff --git a/v3/newrelic/sql_driver.go b/v3/newrelic/sql_driver.go index ee3be5d62..c32fa1f08 100644 --- a/v3/newrelic/sql_driver.go +++ b/v3/newrelic/sql_driver.go @@ -292,7 +292,7 @@ func (w *wrapStmt) Query(args []driver.Value) (driver.Rows, error) { var err error if IsSecurityAgentPresent() { - secureAgentevent := sendSecureEventSQLPrepareArgs(args, w) + secureAgentevent := sendSecureEventSQLPrepareArgs(args, w.original) defer func() { secureAgent.SendExitEvent(secureAgentevent, err) }() @@ -317,7 +317,7 @@ func (w *wrapStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (d var err error if IsSecurityAgentPresent() { - secureAgentevent := sendSecureEventSQLPrepareArgs(args, w) + secureAgentevent := sendSecureEventSQLPrepareArgs(args, w.original) defer func() { secureAgent.SendExitEvent(secureAgentevent, err) }() @@ -334,7 +334,7 @@ func (w *wrapStmt) QueryContext(ctx context.Context, args []driver.NamedValue) ( var err error if IsSecurityAgentPresent() { - secureAgentevent := sendSecureEventSQLPrepareArgs(args, w) + secureAgentevent := sendSecureEventSQLPrepareArgs(args, w.original) defer func() { secureAgent.SendExitEvent(secureAgentevent, err) }() diff --git a/v3/newrelic/version.go b/v3/newrelic/version.go index a95cdce13..1b1f68799 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.29.0" + Version = "3.29.1" ) var (