diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff95e47ec..e98575f41 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -85,8 +85,41 @@ jobs: dirs: _integrations/nrb3 - go-version: 1.13.x dirs: _integrations/nrmongo + steps: + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} - # v3 agent + - name: Checkout Code + 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 ../../ +go 1.17 require ( - github.com/aws/aws-sdk-go-v2 v1.4.0 - github.com/aws/aws-sdk-go-v2/config v1.1.7 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.2.3 - github.com/aws/aws-sdk-go-v2/service/lambda v1.2.3 - github.com/aws/aws-sdk-go-v2/service/s3 v1.6.0 - github.com/aws/smithy-go v1.4.0 - github.com/newrelic/go-agent/v3 v3.0.0 - golang.org/x/tools v0.1.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.16.15 + github.com/aws/aws-sdk-go-v2/config v1.17.6 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.0 + 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.18.2 ) diff --git a/v3/integrations/nrecho-v4/go.mod b/v3/integrations/nrecho-v4/go.mod index 2023c8b94..42b87228b 100644 --- a/v3/integrations/nrecho-v4/go.mod +++ b/v3/integrations/nrecho-v4/go.mod @@ -4,24 +4,7 @@ module github.com/newrelic/go-agent/v3/integrations/nrecho-v4 // https://github.com/labstack/echo/blob/master/go.mod go 1.17 - require ( github.com/labstack/echo/v4 v4.5.0 - github.com/newrelic/go-agent/v3 v3.16.1 -) - -require ( - github.com/golang/protobuf v1.4.3 // indirect - github.com/labstack/gommon v0.3.0 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.1 // indirect - golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect - golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect - golang.org/x/text v0.3.6 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect - google.golang.org/grpc v1.39.0 // indirect - google.golang.org/protobuf v1.25.0 // indirect + github.com/newrelic/go-agent/v3 v3.18.2 ) diff --git a/v3/integrations/nrgin/example/main.go b/v3/integrations/nrgin/example/main.go index 34e60f7b1..2b0b845bf 100644 --- a/v3/integrations/nrgin/example/main.go +++ b/v3/integrations/nrgin/example/main.go @@ -58,6 +58,7 @@ func main() { newrelic.ConfigAppName("Gin App"), newrelic.ConfigLicense(os.Getenv("NEW_RELIC_LICENSE_KEY")), newrelic.ConfigDebugLogger(os.Stdout), + newrelic.ConfigCodeLevelMetricsEnabled(true), ) if nil != err { fmt.Println(err) diff --git a/v3/integrations/nrgin/go.mod b/v3/integrations/nrgin/go.mod index 2293e6c2d..8ee5f5d72 100644 --- a/v3/integrations/nrgin/go.mod +++ b/v3/integrations/nrgin/go.mod @@ -6,5 +6,5 @@ go 1.12 require ( github.com/gin-gonic/gin v1.8.0 - github.com/newrelic/go-agent/v3 v3.17.0 + github.com/newrelic/go-agent/v3 v3.18.2 ) diff --git a/v3/integrations/nrgin/nrgin.go b/v3/integrations/nrgin/nrgin.go index ac279e744..536b6b01e 100644 --- a/v3/integrations/nrgin/nrgin.go +++ b/v3/integrations/nrgin/nrgin.go @@ -144,7 +144,7 @@ func middleware(app *newrelic.Application, useNewNames bool) gin.HandlerFunc { name := c.Request.Method + " " + getName(c, useNewNames) w := &headerResponseWriter{w: c.Writer} - txn := app.StartTransaction(name) + txn := app.StartTransaction(name, newrelic.WithFunctionLocation(c.Handler())) txn.SetWebRequestHTTP(c.Request) defer txn.End() diff --git a/v3/integrations/nrgrpc/go.mod b/v3/integrations/nrgrpc/go.mod index 6f094e377..07a866d15 100644 --- a/v3/integrations/nrgrpc/go.mod +++ b/v3/integrations/nrgrpc/go.mod @@ -2,13 +2,21 @@ module github.com/newrelic/go-agent/v3/integrations/nrgrpc // As of Dec 2019, the grpc go.mod file uses 1.11: // https://github.com/grpc/grpc-go/blob/master/go.mod -go 1.11 +go 1.17 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.3.3 - github.com/newrelic/go-agent/v3 v3.12.0 + github.com/golang/protobuf v1.5.2 + github.com/newrelic/go-agent/v3 v3.18.2 // v1.15.0 is the earliest version of grpc using modules. - google.golang.org/grpc v1.39.0 + google.golang.org/grpc v1.49.0 +) + +require ( + golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect + golang.org/x/text v0.3.3 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + google.golang.org/protobuf v1.27.1 // indirect ) diff --git a/v3/integrations/nrgrpc/nrgrpc_client_test.go b/v3/integrations/nrgrpc/nrgrpc_client_test.go index f91d568d4..e81356dd5 100644 --- a/v3/integrations/nrgrpc/nrgrpc_client_test.go +++ b/v3/integrations/nrgrpc/nrgrpc_client_test.go @@ -6,6 +6,7 @@ package nrgrpc import ( "context" "encoding/json" + "fmt" "io" "testing" @@ -364,9 +365,9 @@ func TestStreamStreamClientInterceptor(t *testing.T) { if err != nil { t.Fatal("client call to DoStreamStream failed", err) } - waitc := make(chan struct{}) - go func() { - defer close(waitc) + + errC := make(chan error) + go func(errC chan error) { var recved int for { msg, err := stream.Recv() @@ -374,29 +375,40 @@ func TestStreamStreamClientInterceptor(t *testing.T) { break } if err != nil { - t.Fatal("failure to Recv", err) + errC <- fmt.Errorf("failure to Recv: %v", err) + return } var hdrs map[string][]string err = json.Unmarshal([]byte(msg.Text), &hdrs) if err != nil { - t.Fatal("cannot unmarshall client response", err) + errC <- fmt.Errorf("cannot unmarshall client response: %v", err) + return } if hdr, ok := hdrs["newrelic"]; !ok || len(hdr) != 1 || hdr[0] == "" { - t.Error("distributed trace header not sent", hdrs) + errC <- fmt.Errorf("distributed trace header not sent: %v", hdrs) + return } recved++ } if recved != 3 { - t.Fatal("received incorrect number of messages from server", recved) + errC <- fmt.Errorf("received incorrect number of messages from server: %v", recved) + return } - }() + errC <- nil + }(errC) for i := 0; i < 3; i++ { if err := stream.Send(&testapp.Message{Text: "Hello DoStreamStream"}); err != nil { t.Fatal("failure to Send", err) } } stream.CloseSend() - <-waitc + + err = <-errC + close(errC) + if err != nil { + t.Fatal(err) + } + txn.End() app.ExpectMetrics(t, []internal.WantMetric{ diff --git a/v3/integrations/nrgrpc/nrgrpc_server_test.go b/v3/integrations/nrgrpc/nrgrpc_server_test.go index 103379b61..cfb961cc7 100644 --- a/v3/integrations/nrgrpc/nrgrpc_server_test.go +++ b/v3/integrations/nrgrpc/nrgrpc_server_test.go @@ -5,12 +5,14 @@ package nrgrpc import ( "context" + "fmt" "io" "net" "strings" "testing" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/test/bufconn" "github.com/newrelic/go-agent/v3/integrations/nrgrpc/testapp" @@ -39,7 +41,7 @@ func newTestServerAndConn(t *testing.T, app *newrelic.Application) (*grpc.Server } conn, err := grpc.Dial("bufnet", grpc.WithContextDialer(bufDialer), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock(), // create the connection synchronously grpc.WithUnaryInterceptor(UnaryClientInterceptor), grpc.WithStreamInterceptor(StreamClientInterceptor), @@ -446,9 +448,9 @@ func TestStreamStreamServerInterceptor(t *testing.T) { if err != nil { t.Fatal("client call to DoStreamStream failed", err) } - waitc := make(chan struct{}) - go func() { - defer close(waitc) + + errc := make(chan error) + go func(errc chan error) { var recved int for { _, err := stream.Recv() @@ -456,21 +458,29 @@ func TestStreamStreamServerInterceptor(t *testing.T) { break } if err != nil { - t.Fatal("failure to Recv", err) + errc <- fmt.Errorf("failure to Recv: %v", err) + return } recved++ } if recved != 3 { - t.Fatal("received incorrect number of messages from server", recved) + errc <- fmt.Errorf("received incorrect number of messages from server: %v", recved) + return } - }() + errc <- nil + }(errc) for i := 0; i < 3; i++ { if err := stream.Send(&testapp.Message{Text: "Hello DoStreamStream"}); err != nil { t.Fatal("failure to Send", err) } } stream.CloseSend() - <-waitc + + err = <-errc + close(errc) + if err != nil { + t.Fatal(err) + } app.ExpectMetrics(t, []internal.WantMetric{ {Name: "Apdex", Scope: "", Forced: true, Data: nil}, diff --git a/v3/integrations/nrmongo/go.mod b/v3/integrations/nrmongo/go.mod index 68897d286..8a7c7d4fb 100644 --- a/v3/integrations/nrmongo/go.mod +++ b/v3/integrations/nrmongo/go.mod @@ -2,10 +2,10 @@ module github.com/newrelic/go-agent/v3/integrations/nrmongo // As of Dec 2019, 1.10 is the mongo-driver requirement: // https://github.com/mongodb/mongo-go-driver#requirements -go 1.10 +go 1.17 require ( - github.com/newrelic/go-agent/v3 v3.6.0 + github.com/newrelic/go-agent/v3 v3.18.2 // mongo-driver does not support modules as of Nov 2019. - go.mongodb.org/mongo-driver v1.5.1 + go.mongodb.org/mongo-driver v1.10.2 ) diff --git a/v3/integrations/nrmysql/go.mod b/v3/integrations/nrmysql/go.mod index dc981306b..5954af5cc 100644 --- a/v3/integrations/nrmysql/go.mod +++ b/v3/integrations/nrmysql/go.mod @@ -1,11 +1,11 @@ module github.com/newrelic/go-agent/v3/integrations/nrmysql // 1.10 is the Go version in mysql's go.mod -go 1.10 +go 1.17 require ( // v1.5.0 is the first mysql version to support gomod - github.com/go-sql-driver/mysql v1.5.0 + 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.3.0 + github.com/newrelic/go-agent/v3 v3.18.2 ) diff --git a/v3/integrations/nrnats/go.mod b/v3/integrations/nrnats/go.mod index aec49dda6..c8d0d40d8 100644 --- a/v3/integrations/nrnats/go.mod +++ b/v3/integrations/nrnats/go.mod @@ -2,10 +2,9 @@ module github.com/newrelic/go-agent/v3/integrations/nrnats // As of Dec 2019, 1.11 is the earliest version of Go tested by nats: // https://github.com/nats-io/nats.go/blob/master/.travis.yml -go 1.11 +go 1.17 require ( - // v1.8.0 is the first nats version with a go.mod. - github.com/nats-io/nats.go v1.8.0 - github.com/newrelic/go-agent/v3 v3.4.0 + github.com/nats-io/nats.go v1.17.0 + github.com/newrelic/go-agent/v3 v3.18.2 ) diff --git a/v3/integrations/nrnats/test/go.mod b/v3/integrations/nrnats/test/go.mod index 5c0c23764..b8e73a03d 100644 --- a/v3/integrations/nrnats/test/go.mod +++ b/v3/integrations/nrnats/test/go.mod @@ -2,16 +2,31 @@ module github.com/newrelic/go-agent/v3/integrations/test // This module exists to avoid having extra nrnats module dependencies. -go 1.13 +go 1.17 + +replace github.com/newrelic/go-agent/v3/integrations/nrnats v1.0.0 => ../ + +replace github.com/newrelic/go-agent/v3 v3.18.2 => ../../../ require ( - github.com/nats-io/gnatsd v1.4.1 // indirect github.com/nats-io/nats-server v1.4.1 - github.com/nats-io/nats.go v1.8.0 - github.com/newrelic/go-agent/v3 v3.4.0 - github.com/newrelic/go-agent/v3/integrations/nrnats v0.0.0 + github.com/nats-io/nats.go v1.17.0 + github.com/newrelic/go-agent/v3 v3.18.2 + github.com/newrelic/go-agent/v3/integrations/nrnats v1.0.0 ) -replace github.com/newrelic/go-agent/v3 => ../../../ - -replace github.com/newrelic/go-agent/v3/integrations/nrnats => ../ +require ( + github.com/golang/protobuf v1.5.2 // indirect + github.com/nats-io/gnatsd v1.4.1 // indirect + github.com/nats-io/go-nats v1.7.2 // indirect + github.com/nats-io/nats-server/v2 v2.9.0 // indirect + github.com/nats-io/nkeys v0.3.0 // indirect + github.com/nats-io/nuid v1.0.1 // indirect + golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/sys v0.0.0-20220906135438-9e1f76180b77 // indirect + golang.org/x/text v0.3.6 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + google.golang.org/grpc v1.49.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect +) diff --git a/v3/integrations/nrstan/go.mod b/v3/integrations/nrstan/go.mod index 9144df8ed..865852338 100644 --- a/v3/integrations/nrstan/go.mod +++ b/v3/integrations/nrstan/go.mod @@ -2,9 +2,9 @@ module github.com/newrelic/go-agent/v3/integrations/nrstan // As of Dec 2019, 1.11 is the earliest Go version tested by Stan: // https://github.com/nats-io/stan.go/blob/master/.travis.yml -go 1.11 +go 1.17 require ( - github.com/nats-io/stan.go v0.5.0 - github.com/newrelic/go-agent/v3 v3.4.0 + github.com/nats-io/stan.go v0.10.3 + github.com/newrelic/go-agent/v3 v3.18.2 ) diff --git a/v3/newrelic/version.go b/v3/newrelic/version.go index 18c42eb63..255032812 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.19.1" + Version = "3.19.2" ) var (