diff --git a/oracledb-config.yml.k8s_sample b/oracledb-config.yml.k8s_sample deleted file mode 100644 index 506f5ec..0000000 --- a/oracledb-config.yml.k8s_sample +++ /dev/null @@ -1,42 +0,0 @@ - oracledb-config.yml: | - --- - # Run auto discovery to find pods with label "app=oracledb" - # https://docs.newrelic.com/docs/integrations/host-integrations/installation/container-auto-discovery - discovery: - command: - # Run NRI Discovery for Kubernetes - # https://github.com/newrelic/nri-discovery-kubernetes - exec: /var/db/newrelic-infra/nri-discovery-kubernetes - match: - label.app: oracledb - integrations: - - name: nri-oracledb - env: - # The service name for the Oracle instance - SERVICE_NAME: ORCL - # The host on which Oracle is listening. Using the discovered IP as the host address. - HOSTNAME: ${discovery.ip} - # The port on which Oracle is listening. If omitted, defaults to 1521 - PORT: 12345 - # Alternatively, a full connection string can be used. This takes priority over host, port, and service_name. - # connection_string: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oraclehost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl))) - # The username for the monitoring user. - USERNAME: oracle_monitor - # The password for the monitoring user. - PASSWORD: password - # True if the monitoring user is a SysDBA. If omitted, defaults to false. - IS_SYS_DBA: true - # The location of ORACLE_HOME. Only available if mounted in the Agent containrt - # ORACLE_HOME: /u01/app/oracle/product/version/database - # True if the monitoring user is a SysOper. If omitted, defaults to false. - IS_SYS_OPER: false - # Disable connection pool. Might fix issues with the applciation not being able to execute some queries - DISABLE_CONNECTION_POOL: false - # Maximum number of connections opened by the integration - # MAX_OPEN_CONNECTIONS: 5 - # A JSON array of tablespaces to collect. If omitted, collects all tablespaces. - TABLESPACES: '["tablespace1", "tablespace2"]' - # Collect extended metrics. If omitted, defaults to false. - EXTENDED_METRICS: true - labels: - env: production diff --git a/src/metric_definitions.go b/src/metric_definitions.go index a0233e7..d94c842 100644 --- a/src/metric_definitions.go +++ b/src/metric_definitions.go @@ -508,7 +508,6 @@ var oracleSysstat = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricsChan chan<- newrelicMetricSender) error { - var sysScanner struct { value int instID int @@ -574,7 +573,6 @@ var oracleSGA = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricsChan chan<- newrelicMetricSender) error { - var sysScanner struct { value int instID int @@ -714,7 +712,6 @@ var oracleRedoLogWaits = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricsChan chan<- newrelicMetricSender) error { - var sysScanner struct { totalWaits int instID int @@ -794,7 +791,6 @@ var oraclePDBDatafilesOffline = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - columnNames, err := rows.Columns() if err != nil { return fmt.Errorf("failed to retrieve columns from rows") @@ -881,7 +877,6 @@ var oracleCDBDatafilesOffline = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - columnNames, err := rows.Columns() if err != nil { return fmt.Errorf("failed to retrieve columns from rows") @@ -958,7 +953,6 @@ var oracleLockedAccounts = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - columnNames, err := rows.Columns() if err != nil { return fmt.Errorf("failed to retrieve columns from rows") @@ -1030,7 +1024,6 @@ var oraclePDBNonWrite = oracleMetricGroup{ query += ` GROUP BY TABLESPACE_NAME` return query - }, metrics: []*oracleMetric{ @@ -1043,7 +1036,6 @@ var oraclePDBNonWrite = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - columnNames, err := rows.Columns() if err != nil { return fmt.Errorf("failed to retrieve columns from rows") @@ -1095,16 +1087,17 @@ var oracleTablespaceMetrics = oracleMetricGroup{ query := ` SELECT a.TABLESPACE_NAME, a.USED_PERCENT, - a.USED_SPACE AS "USED", - a.TABLESPACE_SIZE AS "SIZE", + a.USED_SPACE * b.BLOCK_SIZE AS "USED", + a.TABLESPACE_SIZE * b.BLOCK_SIZE AS "SIZE", b.TABLESPACE_OFFLINE AS "OFFLINE" FROM DBA_TABLESPACE_USAGE_METRICS a JOIN ( SELECT TABLESPACE_NAME, + BLOCK_SIZE, MAX( CASE WHEN status = 'OFFLINE' THEN 1 ELSE 0 END) AS "TABLESPACE_OFFLINE" FROM DBA_TABLESPACES - GROUP BY TABLESPACE_NAME + GROUP BY TABLESPACE_NAME, BLOCK_SIZE ) b ON a.TABLESPACE_NAME = b.TABLESPACE_NAME` @@ -1154,7 +1147,6 @@ var oracleTablespaceMetrics = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - columnNames, err := rows.Columns() if err != nil { return fmt.Errorf("failed to retrieve columns from rows") @@ -1225,7 +1217,6 @@ var globalNameInstanceMetric = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - type pgaRow struct { instID int value string @@ -1282,7 +1273,6 @@ var globalNameTablespaceMetric = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - type pgaRow struct { tableName string value string @@ -1339,7 +1329,6 @@ var dbIDInstanceMetric = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - type pgaRow struct { instID int value string @@ -1396,7 +1385,6 @@ var dbIDTablespaceMetric = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - type pgaRow struct { tableName string value string @@ -1488,7 +1476,6 @@ var oracleReadWriteMetrics = oracleMetricGroup{ }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - columnNames, err := rows.Columns() if err != nil { return fmt.Errorf("failed to get column names from rows") @@ -1568,7 +1555,6 @@ var oraclePgaMetrics = oracleMetricGroup{ }, }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricChan chan<- newrelicMetricSender) error { - type pgaRow struct { instID int name string @@ -2423,7 +2409,6 @@ var oracleSysMetrics = oracleMetricGroup{ }, }, metricsGenerator: func(rows database.Rows, metrics []*oracleMetric, metricsChan chan<- newrelicMetricSender) error { - var sysScanner struct { instID int metricName string