From 76894d8bbda0fecf5454ccac7fede91dea3d57ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20=22Kang=22=20P=C3=A9rez?= Date: Fri, 4 Oct 2024 10:32:49 +0200 Subject: [PATCH] Upgrade integrations SDK (NR-302384) (#180) * upgrade infra-sdk to a compatible v3 version * add entry to changelog * goimports * go mod tidy * go upgrade to 1.23.2 * add entry to changelog for go 1.22.3 --- CHANGELOG.md | 8 ++++++++ build/Dockerfile | 2 +- go.mod | 6 ++---- go.sum | 6 ++---- src/database/db_wrapper.go | 3 ++- src/inventory.go | 4 ++-- src/inventory_test.go | 2 +- src/metric_definitions.go | 4 ++-- src/metrics.go | 8 ++++---- src/metrics_definitions_test.go | 2 +- src/metrics_test.go | 6 +++--- src/oracledb.go | 6 +++--- 12 files changed, 31 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e734a..801e94f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ Unreleased section should follow [Release Toolkit](https://github.com/newrelic/r ## Unreleased +### dependency + +- Upgrade go to 1.23.2 + +### enhancements + +- Upgrade integrations SDK so the interval is variable and allows intervals up to 5 minutes + ## v3.8.3 - 2024-09-10 ### ⛓️ Dependencies diff --git a/build/Dockerfile b/build/Dockerfile index 8339d01..dabbfc8 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23.1-bullseye +FROM golang:1.23.2-bullseye ARG GH_VERSION='1.9.2' diff --git a/go.mod b/go.mod index 8f5fbc9..a5299b8 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/newrelic/nri-oracledb -go 1.23.1 +go 1.23.2 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/godror/godror v0.44.0 github.com/jmoiron/sqlx v1.4.0 github.com/kr/pretty v0.3.1 - github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible + github.com/newrelic/infra-integrations-sdk/v3 v3.9.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -15,9 +15,7 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/godror/knownpb v0.1.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/stretchr/testify v1.9.0 // indirect golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index bc9d579..eb2c390 100644 --- a/go.sum +++ b/go.sum @@ -33,13 +33,11 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= -github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible h1:Ktcm1aPAl7CW3o+FXAIKJ+jygWVXDXaUIWFyf2CXQTk= -github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible/go.mod h1:tMUHRMq6mJS0YyBnbWrTXAnREnQqC1AGO6Lu45u5xAM= +github.com/newrelic/infra-integrations-sdk/v3 v3.9.1 h1:dCtVLsYNHWTQ5aAlAaHroomOUlqxlGTrdi6XTlvBDfI= +github.com/newrelic/infra-integrations-sdk/v3 v3.9.1/go.mod h1:yPeidhcq9Cla0QDquGXH0KqvS2k9xtetFOD7aLA0Z8M= github.com/oklog/ulid/v2 v2.0.2 h1:r4fFzBm+bv0wNKNh5eXTwU7i85y5x+uwkxCUTNVQqLc= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.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/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= diff --git a/src/database/db_wrapper.go b/src/database/db_wrapper.go index 8da6bc4..c3859cf 100644 --- a/src/database/db_wrapper.go +++ b/src/database/db_wrapper.go @@ -3,7 +3,8 @@ package database import ( "database/sql" "errors" - "github.com/newrelic/infra-integrations-sdk/log" + + "github.com/newrelic/infra-integrations-sdk/v3/log" "github.com/jmoiron/sqlx" ) diff --git a/src/inventory.go b/src/inventory.go index f5d4889..a02bd08 100644 --- a/src/inventory.go +++ b/src/inventory.go @@ -5,8 +5,8 @@ import ( "strconv" "sync" - "github.com/newrelic/infra-integrations-sdk/integration" - "github.com/newrelic/infra-integrations-sdk/log" + "github.com/newrelic/infra-integrations-sdk/v3/integration" + "github.com/newrelic/infra-integrations-sdk/v3/log" "github.com/newrelic/nri-oracledb/src/database" ) diff --git a/src/inventory_test.go b/src/inventory_test.go index 8021ecf..3f2a803 100644 --- a/src/inventory_test.go +++ b/src/inventory_test.go @@ -7,7 +7,7 @@ import ( "github.com/DATA-DOG/go-sqlmock" _ "github.com/godror/godror" "github.com/jmoiron/sqlx" - "github.com/newrelic/infra-integrations-sdk/integration" + "github.com/newrelic/infra-integrations-sdk/v3/integration" "github.com/newrelic/nri-oracledb/src/database" ) diff --git a/src/metric_definitions.go b/src/metric_definitions.go index d116155..8f1c721 100644 --- a/src/metric_definitions.go +++ b/src/metric_definitions.go @@ -7,8 +7,8 @@ import ( "sync" "github.com/godror/godror" - "github.com/newrelic/infra-integrations-sdk/data/metric" - "github.com/newrelic/infra-integrations-sdk/log" + "github.com/newrelic/infra-integrations-sdk/v3/data/metric" + "github.com/newrelic/infra-integrations-sdk/v3/log" "github.com/newrelic/nri-oracledb/src/database" ) diff --git a/src/metrics.go b/src/metrics.go index fa47a0e..8e08936 100644 --- a/src/metrics.go +++ b/src/metrics.go @@ -9,10 +9,10 @@ import ( "sync" "github.com/godror/godror" - "github.com/newrelic/infra-integrations-sdk/data/attribute" - nrmetric "github.com/newrelic/infra-integrations-sdk/data/metric" - "github.com/newrelic/infra-integrations-sdk/integration" - "github.com/newrelic/infra-integrations-sdk/log" + "github.com/newrelic/infra-integrations-sdk/v3/data/attribute" + nrmetric "github.com/newrelic/infra-integrations-sdk/v3/data/metric" + "github.com/newrelic/infra-integrations-sdk/v3/integration" + "github.com/newrelic/infra-integrations-sdk/v3/log" "github.com/newrelic/nri-oracledb/src/database" "gopkg.in/yaml.v2" ) diff --git a/src/metrics_definitions_test.go b/src/metrics_definitions_test.go index 2ad8e45..e2eb0c8 100644 --- a/src/metrics_definitions_test.go +++ b/src/metrics_definitions_test.go @@ -8,7 +8,7 @@ import ( sqlmock "github.com/DATA-DOG/go-sqlmock" "github.com/jmoiron/sqlx" "github.com/kr/pretty" - "github.com/newrelic/infra-integrations-sdk/data/metric" + "github.com/newrelic/infra-integrations-sdk/v3/data/metric" "github.com/newrelic/nri-oracledb/src/database" ) diff --git a/src/metrics_test.go b/src/metrics_test.go index c2c5ce8..34910ff 100644 --- a/src/metrics_test.go +++ b/src/metrics_test.go @@ -7,9 +7,9 @@ import ( sqlmock "github.com/DATA-DOG/go-sqlmock" "github.com/jmoiron/sqlx" - "github.com/newrelic/infra-integrations-sdk/data/metric" - "github.com/newrelic/infra-integrations-sdk/integration" - "github.com/newrelic/infra-integrations-sdk/persist" + "github.com/newrelic/infra-integrations-sdk/v3/data/metric" + "github.com/newrelic/infra-integrations-sdk/v3/integration" + "github.com/newrelic/infra-integrations-sdk/v3/persist" "github.com/newrelic/nri-oracledb/src/database" ) diff --git a/src/oracledb.go b/src/oracledb.go index 4ca702c..b60f413 100644 --- a/src/oracledb.go +++ b/src/oracledb.go @@ -12,9 +12,9 @@ import ( "github.com/godror/godror" "github.com/godror/godror/dsn" "github.com/jmoiron/sqlx" - sdkArgs "github.com/newrelic/infra-integrations-sdk/args" - "github.com/newrelic/infra-integrations-sdk/integration" - "github.com/newrelic/infra-integrations-sdk/log" + sdkArgs "github.com/newrelic/infra-integrations-sdk/v3/args" + "github.com/newrelic/infra-integrations-sdk/v3/integration" + "github.com/newrelic/infra-integrations-sdk/v3/log" "github.com/newrelic/nri-oracledb/src/database" )