diff --git a/internal/pgutil/parser_test.go b/internal/pgutil/parser_test.go index fc2d407bf..cb9a87b03 100644 --- a/internal/pgutil/parser_test.go +++ b/internal/pgutil/parser_test.go @@ -21,9 +21,11 @@ import ( "os" "testing" + apmpq "go.elastic.co/apm/module/apmsql/pq" + "github.com/stretchr/testify/assert" - apmpq "go.elastic.co/apm/internal/pgutil" + "go.elastic.co/apm/internal/pgutil" "go.elastic.co/apm/module/apmsql" ) @@ -44,7 +46,7 @@ func TestParseDSNURL(t *testing.T) { } test := func(url, addr string, port int) { - info := apmpq.ParseDSN(url) + info := pgutil.ParseDSN(url) assert.Equal(t, apmsql.DSNInfo{ Address: addr, Port: port, diff --git a/module/apmsql/pgxv4/init.go b/module/apmsql/pgxv4/init.go index 8456b2df1..903d729b5 100644 --- a/module/apmsql/pgxv4/init.go +++ b/module/apmsql/pgxv4/init.go @@ -28,5 +28,5 @@ import ( ) func init() { - apmsql.Register("pgxv4", &stdlib.Driver{}, apmsql.WithDSNParser(pgutil.ParseDSN)) + apmsql.Register("pgx", &stdlib.Driver{}, apmsql.WithDSNParser(pgutil.ParseDSN)) } diff --git a/module/apmsql/pgxv4/pq_test.go b/module/apmsql/pgxv4/pq_test.go index 85651af2e..bc26dc17c 100644 --- a/module/apmsql/pgxv4/pq_test.go +++ b/module/apmsql/pgxv4/pq_test.go @@ -38,7 +38,7 @@ func TestQueryContext(t *testing.T) { t.Skipf("PGHOST not specified") } - db, err := apmsql.Open("pgxv4", "user=postgres password=hunter2 dbname=test_db sslmode=disable") + db, err := apmsql.Open("pgx", "user=postgres password=hunter2 dbname=test_db sslmode=disable") require.NoError(t, err) defer db.Close()