diff --git a/.gitignore b/.gitignore index d5a32627a..192a538ed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.out docs/html build +.idea diff --git a/module/apmgormv2/README.md b/module/apmgormv2/README.md new file mode 100644 index 000000000..869b0fecc --- /dev/null +++ b/module/apmgormv2/README.md @@ -0,0 +1,20 @@ +# apmgormv2 + +Package apmgormv2 provides drivers to gorm.io/gorm +for tracing database operations as spans of a transaction traced +by Elastic APM. + +## Usage + +Swap `gorm.io/driver/*` to `go.elastic.co/apm/module/apmgormv2/driver/*` + +Example :- + +```golang +import ( + mysql "go.elastic.co/apm/module/apmgormv2/driver/mysql" + "gorm.io/gorm" +) + +db, err := gorm.Open(mysql.Open("dsn"), &gorm.Config{}) +``` \ No newline at end of file diff --git a/module/apmgormv2/apmgorm_test.go b/module/apmgormv2/apmgorm_test.go new file mode 100644 index 000000000..382391293 --- /dev/null +++ b/module/apmgormv2/apmgorm_test.go @@ -0,0 +1,229 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// +build go1.14 + +package apmgormv2_test + +import ( + "context" + "os" + "strings" + "testing" + + "gorm.io/gorm/logger" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gorm.io/gorm" + + "go.elastic.co/apm/apmtest" + mysql "go.elastic.co/apm/module/apmgormv2/driver/mysql" + sqlite "go.elastic.co/apm/module/apmgormv2/driver/sqlite" + "go.elastic.co/apm/module/apmsql" +) + +type Product struct { + gorm.Model + Code string + Price uint +} + +func TestWithContext(t *testing.T) { + t.Run("sqlite3", func(t *testing.T) { + testWithContext(t, + apmsql.DSNInfo{Database: ":memory:"}, + sqlite.Open(":memory:"), &gorm.Config{}, + ) + }) + + if mysqlHost := os.Getenv("MYSQL_HOST"); mysqlHost == "" { + t.Logf("MYSQL_HOST not specified, skipping") + } else { + t.Run("mysql", func(t *testing.T) { + testWithContext(t, + apmsql.DSNInfo{ + Address: mysqlHost, + Port: 3306, + Database: "test_db", + User: "root", + }, + mysql.Open("root:hunter2@tcp("+mysqlHost+")/test_db?parseTime=true"), &gorm.Config{}, + ) + }) + } +} + +func testWithContext(t *testing.T, dsnInfo apmsql.DSNInfo, dialect gorm.Dialector, config *gorm.Config) { + _, spans, errors := apmtest.WithTransaction(func(ctx context.Context) { + db, err := gorm.Open(dialect, config) + require.NoError(t, err) + ddb, _ := db.DB() + defer ddb.Close() + + db = db.WithContext(ctx) + + if db.Migrator().HasTable(&Product{}) { + db.Migrator().DropTable(&Product{}) + } + db.AutoMigrate(&Product{}) + db.Create(&Product{Code: "L1212", Price: 1000}) + + var product Product + var count int64 + assert.NoError(t, db.Model(&product).Count(&count).Error) + assert.Equal(t, int64(1), count) + assert.NoError(t, db.First(&product, "code = ?", "L1212").Error) + assert.NoError(t, db.Model(&product).Update("Price", 2000).Error) + assert.NoError(t, db.Delete(&product).Error) // soft + assert.NoError(t, db.Unscoped().Delete(&product).Error) // hard + }) + require.NotEmpty(t, spans) + assert.Empty(t, errors) + + var spanNames []string + for _, span := range spans { + if strings.Contains(span.Name, "products") && span.Action != "prepare" { + spanNames = append(spanNames, span.Name) + } + require.NotNil(t, span.Context) + require.NotNil(t, span.Context.Database) + assert.Equal(t, dsnInfo.Database, span.Context.Database.Instance) + assert.NotEmpty(t, span.Context.Database.Statement) + assert.Equal(t, "sql", span.Context.Database.Type) + assert.Equal(t, dsnInfo.User, span.Context.Database.User) + if dsnInfo.Address == "" { + assert.Nil(t, span.Context.Destination) + } else { + assert.Equal(t, dsnInfo.Address, span.Context.Destination.Address) + assert.Equal(t, dsnInfo.Port, span.Context.Destination.Port) + } + } + assert.Equal(t, []string{ + "INSERT INTO products", + "SELECT FROM products", // count + "SELECT FROM products", + "UPDATE products", + "UPDATE products", // soft delete + "DELETE FROM products", + }, spanNames) +} + +// TestWithContextNoTransaction checks that using WithContext without +// a transaction won't cause any issues. +func TestWithContextNoTransaction(t *testing.T) { + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + ddb, _ := db.DB() + defer ddb.Close() + + db = db.WithContext(context.Background()) + if db.Migrator().HasTable(&Product{}) { + db.Migrator().DropTable(&Product{}) + } + db.AutoMigrate(&Product{}) + db.Create(&Product{Code: "L1212", Price: 1000}) + + var product Product + assert.NoError(t, db.Where("code=?", "L1212").First(&product).Error) +} + +func TestWithContextNonSampled(t *testing.T) { + os.Setenv("ELASTIC_APM_TRANSACTION_SAMPLE_RATE", "0") + defer os.Unsetenv("ELASTIC_APM_TRANSACTION_SAMPLE_RATE") + + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + + require.NoError(t, err) + + ddb, _ := db.DB() + defer ddb.Close() + + if db.Migrator().HasTable(&Product{}) { + db.Migrator().DropTable(&Product{}) + } + db.AutoMigrate(&Product{}) + + _, spans, _ := apmtest.WithTransaction(func(ctx context.Context) { + db = db.WithContext(ctx) + db.Create(&Product{Code: "L1212", Price: 1000}) + }) + require.Empty(t, spans) +} + +func TestCaptureErrors(t *testing.T) { + t.Run("sqlite3", func(t *testing.T) { + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + require.NoError(t, err) + + ddb, _ := db.DB() + defer ddb.Close() + + testCaptureErrors(t, db) + }) +} + +func testCaptureErrors(t *testing.T, db *gorm.DB) { + db.Config.Logger = logger.Default.LogMode(logger.Silent) + if db.Migrator().HasTable(&Product{}) { + db.Migrator().DropTable(&Product{}) + } + db.AutoMigrate(&Product{}) + + _, spans, errors := apmtest.WithTransaction(func(ctx context.Context) { + db = db.WithContext(ctx) + + // gorm.ErrRecordNotFound should not cause an error + db.Where("code=?", "L1212").First(&Product{}) + + product := Product{ + Model: gorm.Model{ + ID: 1001, + }, + Code: "1001", + Price: 1001, + } + require.NoError(t, db.Create(&product).Error) + + // invalid SQL should + db.Where("bananas").First(&Product{}) + }) + assert.Len(t, spans, 3) + require.Len(t, errors, 1) + assert.Regexp(t, `.*bananas.*`, errors[0].Exception.Message) +} + +func TestOpenWithDriver(t *testing.T) { + db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + + require.NoError(t, err) + + ddb, _ := db.DB() + defer ddb.Close() + + if db.Migrator().HasTable(&Product{}) { + db.Migrator().DropTable(&Product{}) + } + db.AutoMigrate(&Product{}) + + _, spans, _ := apmtest.WithTransaction(func(ctx context.Context) { + db = db.WithContext(ctx) + db.Create(&Product{Code: "L1212", Price: 1000}) + }) + require.Len(t, spans, 1) + assert.Equal(t, ":memory:", spans[0].Context.Database.Instance) +} diff --git a/module/apmgormv2/doc.go b/module/apmgormv2/doc.go new file mode 100644 index 000000000..a0056afa5 --- /dev/null +++ b/module/apmgormv2/doc.go @@ -0,0 +1,19 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Package apmgormv2 provides wrappers for tracing GORM operations. +package apmgormv2 diff --git a/module/apmgormv2/driver/mysql/init.go b/module/apmgormv2/driver/mysql/init.go new file mode 100644 index 000000000..21e4a42af --- /dev/null +++ b/module/apmgormv2/driver/mysql/init.go @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// +build go1.14 + +// Package apmmysql imports the gorm mysql dialect package, +// and also registers the mysql driver with apmsql. +package apmmysql + +import ( + "gorm.io/driver/mysql" + "gorm.io/gorm" + + "go.elastic.co/apm/module/apmsql" + + _ "go.elastic.co/apm/module/apmsql/mysql" // register mysql with apmsql +) + +// Open creates a dialect with apmsql +func Open(dsn string) gorm.Dialector { + driverName := mysql.Dialector{}.Name() + dialect := &mysql.Dialector{ + Config: &mysql.Config{ + DriverName: apmsql.DriverPrefix + driverName, + DSN: dsn, + }, + } + + return dialect +} diff --git a/module/apmgormv2/driver/sqlite/init.go b/module/apmgormv2/driver/sqlite/init.go new file mode 100644 index 000000000..517d59aa5 --- /dev/null +++ b/module/apmgormv2/driver/sqlite/init.go @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// +build go1.14 + +// Package apmsqlite imports the gorm sqlite dialect package, +// and also registers the sqlite3 driver with apmsql. +package apmsqlite + +import ( + "gorm.io/driver/sqlite" + "gorm.io/gorm" + + "go.elastic.co/apm/module/apmsql" + + _ "go.elastic.co/apm/module/apmsql/sqlite3" // register sqlite3 with apmsql +) + +// Open creates a dialect with apmsql +func Open(dsn string) gorm.Dialector { + + dialect := &sqlite.Dialector{ + DSN: dsn, + DriverName: apmsql.DriverPrefix + sqlite.DriverName, + } + + return dialect +} diff --git a/module/apmgormv2/go.mod b/module/apmgormv2/go.mod new file mode 100644 index 000000000..ece3a06ff --- /dev/null +++ b/module/apmgormv2/go.mod @@ -0,0 +1,17 @@ +module go.elastic.co/apm/module/apmgormv2 + +require ( + github.com/stretchr/testify v1.5.1 + go.elastic.co/apm v1.8.0 + go.elastic.co/apm/module/apmsql v1.8.0 + golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect + gorm.io/driver/mysql v1.0.2 + gorm.io/driver/sqlite v1.1.4-0.20200928065301-698e250a3b0d + gorm.io/gorm v1.20.2 +) + +replace go.elastic.co/apm => ../.. + +replace go.elastic.co/apm/module/apmsql => ../apmsql + +go 1.13 diff --git a/module/apmgormv2/go.sum b/module/apmgormv2/go.sum new file mode 100644 index 000000000..7e60a22f5 --- /dev/null +++ b/module/apmgormv2/go.sum @@ -0,0 +1,93 @@ +github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8= +github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/elastic/go-sysinfo v1.1.1 h1:ZVlaLDyhVkDfjwPGU55CQRCRolNpc7P0BbyhhQZQmMI= +github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= +github.com/elastic/go-windows v1.0.0 h1:qLURgZFkkrYyTTkvYpsZIgf83AUsdIHfvlJaqaZ7aSY= +github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E= +github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4= +github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= +github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.3 h1:j7a/xn1U6TKA/PHHxqZuzh64CdtRc7rU9M+AvkOl5bA= +github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis= +github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.elastic.co/fastjson v1.1.0 h1:3MrGBWWVIxe/xvsbpghtkFoPciPhOCmjsR/HfwEeQR4= +go.elastic.co/fastjson v1.1.0/go.mod h1:boNGISWMjQsUPy/t6yqt2/1Wx4YNPSe+mZjlyw9vKKI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e h1:9vRrk9YW2BTzLP0VCB9ZDjU4cPqkg+IDWL7XgxA1yxQ= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gorm.io/driver/mysql v1.0.2 h1:xm21Um8cR/Cg+nMwSrajf8aBUxOIC+WmH72ir/ByYR8= +gorm.io/driver/mysql v1.0.2/go.mod h1:T+Fv7Rq/8+lpS3X1KKVUbj8Y/SzbPa5esK9KpPAKXR8= +gorm.io/driver/sqlite v1.1.4-0.20200928065301-698e250a3b0d h1:oT3yy0p2Z+MkLvaQlkY4g2jpO16E3nA8wU7+1DSdJUk= +gorm.io/driver/sqlite v1.1.4-0.20200928065301-698e250a3b0d/go.mod h1:DV58HRJvX3ANmQbY3Lkhohs+CtWo2aiJ4n0OPwzSrDI= +gorm.io/gorm v1.20.2 h1:bZzSEnq7NDGsrd+n3evOOedDrY5oLM5QPlCjZJUK2ro= +gorm.io/gorm v1.20.2/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= +howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M= +howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= diff --git a/scripts/Dockerfile-testing b/scripts/Dockerfile-testing index fe393834b..2b76a0bfc 100644 --- a/scripts/Dockerfile-testing +++ b/scripts/Dockerfile-testing @@ -19,6 +19,7 @@ COPY module/apmgoredis/go.mod module/apmgoredis/go.sum /go/src/go.elastic.co/apm COPY module/apmgoredisv8/go.mod module/apmgoredisv8/go.sum /go/src/go.elastic.co/apm/module/apmgoredisv8/ COPY module/apmgorilla/go.mod module/apmgorilla/go.sum /go/src/go.elastic.co/apm/module/apmgorilla/ COPY module/apmgorm/go.mod module/apmgorm/go.sum /go/src/go.elastic.co/apm/module/apmgorm/ +COPY module/apmgormv2/go.mod module/apmgormv2/go.sum /go/src/go.elastic.co/apm/module/apmgormv2/ COPY module/apmgrpc/go.mod module/apmgrpc/go.sum /go/src/go.elastic.co/apm/module/apmgrpc/ COPY module/apmhttp/go.mod module/apmhttp/go.sum /go/src/go.elastic.co/apm/module/apmhttp/ COPY module/apmhttprouter/go.mod module/apmhttprouter/go.sum /go/src/go.elastic.co/apm/module/apmhttprouter/ @@ -52,6 +53,7 @@ RUN cd /go/src/go.elastic.co/apm/module/apmgoredis && go mod download RUN cd /go/src/go.elastic.co/apm/module/apmgoredisv8 && go mod download RUN cd /go/src/go.elastic.co/apm/module/apmgorilla && go mod download RUN cd /go/src/go.elastic.co/apm/module/apmgorm && go mod download +RUN cd /go/src/go.elastic.co/apm/module/apmgormv2 && go mod download RUN cd /go/src/go.elastic.co/apm/module/apmgrpc && go mod download RUN cd /go/src/go.elastic.co/apm/module/apmhttp && go mod download RUN cd /go/src/go.elastic.co/apm/module/apmhttprouter && go mod download