Preview
We're still working on this feature, but we'd love for you to try it out!
This feature is currently provided as part of a preview pursuant to our pre-release policies.
New Relic now empower your team to monitor your Oracle database performance using New Relic Distribution of OpenTelemetry (NRDOT) with New Relic's database monitoring capabilities. This integration provides comprehensive insights into database metrics, query performance, and system health using the NRDOT collector.
This NRDOT-based approach complements our existing On-Host Integration (OHI) by leveraging OpenTelemetry standards for database monitoring, making it easier to integrate with your existing observability stack.
Prerequisites
Before you begin, ensure you have the following:
- Valid New Relic license key
- Supported architecture: Linux with AMD64 and ARM64
- Network connectivity to New Relic's OTLP endpoint
- Oracle Database 19c or later
- On the Oracle database, you've Oracle Instant Client on the machine running the NRDOT collector
Set-up the NRDOT Collector for Oracle Database monitoring
You can set up Oracle Database monitoring using the NRDOT Collector in on-host (multitenant) or RDS environments. Select the appropriate configuration based on your database environment and follow the steps.
Sugerencia
The NRDOT Collector collects the both infrastructure and database related telemetry data, so you can have a unified observability solution for your Oracle Database environment in New Relic.
You can set up Oracle Database monitoring using the NRDOT Collector in on-host or multitenant environments. To install the NRDOT Collector in on-host (multitenant) environments, follow these steps:
Installation method
Select the appropriate installation distribution method for your Linux environment:
Importante
It is recommended to install the NRDOT Collector on the same host as your Oracle Database instance to view infra-level metrics for query performance monitoring.
Configure database user
Create a monitoring user with necessary privileges for your multitenant Oracle Database This requires creating a common user with the C## prefix.
Log in to the root database as an administrator:
CREATE USER c##<YOUR_DB_USERNAME> IDENTIFIED BY "<USER_PASSWORD>";Sugerencia
Ensure that your
USER_PASSWORDmeets with Oracle new user's password requirements.
Grant monitoring privileges for multitenant database
Execute the following SQL statements to grant monitoring privileges. Use the correct username format with C## prefix for multitenant database:
ALTER USER c##<YOUR_DB_USERNAME> SET CONTAINER_DATA=ALL CONTAINER=CURRENT;GRANT CREATE SESSION TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SET CONTAINER TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT CONNECT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SESSION TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SYSSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SESSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$STATNAME TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SYSTEM_EVENT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SHARED_SERVER TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$DISPATCHER TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$CIRCUIT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$RESOURCE_LIMIT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$LOCK TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$DATABASE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$PARAMETER TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SQLAREA TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SQL TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$SQL_PLAN TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.V_$PDBS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$INSTANCE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SGA TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SESSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$STATNAME TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SYSSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SQLAREA TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$LIBRARYCACHE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$ROWCACHE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$PGASTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$CONTAINERS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$PDBS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$CON_SYSMETRIC TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SYSMETRIC TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$FILESTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SYSTEM_EVENT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$ACTIVE_SERVICES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SESSION TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$SESSION_WAIT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON SYS.GV_$ROLLSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_OBJECTS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_TABLESPACES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_TABLESPACE_USAGE_METRICS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_DATA_FILES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_USERS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_SERVICES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_DATA_FILES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_TABLESPACE_USAGE_METRICS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_USERS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_PDBS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON ALL_USERS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON ALL_VIEWS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON GLOBAL_NAME TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;Configure NRDOT Collector
Edit your
config.yamlfile available at/etc/nrdot-collector-host/, then add the following code snippet:Importante
If you're an existing NRDOT Collector user, ensure to merge the above configuration with your existing
config.yamlfile. This includes adding the new receivers, processors, and exporters for Oracle Database monitoring while retaining your current configurations.extensions:health_check:receivers:otlp:protocols:grpc:http:hostmetrics:collection_interval: 60sscrapers:cpu:metrics:system.cpu.time:enabled: falsesystem.cpu.utilization:enabled: trueload:memory:metrics:system.memory.utilization:enabled: truepaging:metrics:system.paging.utilization:enabled: falsesystem.paging.faults:enabled: falsefilesystem:metrics:system.filesystem.utilization:enabled: truedisk:metrics:system.disk.merged:enabled: falsesystem.disk.pending_operations:enabled: falsesystem.disk.weighted_io_time:enabled: falsenetwork:metrics:system.network.connections:enabled: false# Uncomment to enable process metrics, which can be noisy but valuable.# processes:# process:# metrics:# process.cpu.utilization:# enabled: true# process.cpu.time:# enabled: falsefilelog:include:- /var/log/alternatives.log- /var/log/cloud-init.log- /var/log/auth.log- /var/log/dpkg.log- /var/log/syslog- /var/log/messages- /var/log/secure- /var/log/yum.lognewrelicoracledb/cdb:endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>"username: "<USERNAME>"password: "<PASSWORD>"service: "<YOUR_CDB_SERVICE_NAME>"collection_interval: 30stimeout: 30s# enable_tablespace_scraper: true# enable_core_scraper: true# enable_system_scraper: true# enable_connection_scraper: true# enable_container_scraper: true# enable_database_info_scraper: truenewrelicoracledb/pdb:endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>"username: "<USERNAME>"password: "<PASSWORD>"service: "<YOUR_CDB_SERVICE_NAME>"collection_interval: 30stimeout: 30spdb_services: ["ALL"]# query_monitoring_response_time_threshold: 500# query_monitoring_count_threshold: 30# enable_query_monitoring: true# enable_pdb_scraper: trueprocessors:metricstransform:transforms:- include: system.cpu.utilizationaction: updateoperations:- action: aggregate_labelslabel_set: [ state ]aggregation_type: mean- include: system.paging.operationsaction: updateoperations:- action: aggregate_labelslabel_set: [ direction ]aggregation_type: sumfilter/exclude_cpu_utilization:metrics:datapoint:- 'metric.name == "system.cpu.utilization" and attributes["state"] == "interrupt"'- 'metric.name == "system.cpu.utilization" and attributes["state"] == "nice"'- 'metric.name == "system.cpu.utilization" and attributes["state"] == "softirq"'filter/exclude_memory_utilization:metrics:datapoint:- 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_unreclaimable"'- 'metric.name == "system.memory.utilization" and attributes["state"] == "inactive"'- 'metric.name == "system.memory.utilization" and attributes["state"] == "cached"'- 'metric.name == "system.memory.utilization" and attributes["state"] == "buffered"'- 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_reclaimable"'filter/exclude_memory_usage:metrics:datapoint:- 'metric.name == "system.memory.usage" and attributes["state"] == "slab_unreclaimable"'- 'metric.name == "system.memory.usage" and attributes["state"] == "inactive"'filter/exclude_filesystem_utilization:metrics:datapoint:- 'metric.name == "system.filesystem.utilization" and attributes["type"] == "squashfs"'filter/exclude_filesystem_usage:metrics:datapoint:- 'metric.name == "system.filesystem.usage" and attributes["type"] == "squashfs"'- 'metric.name == "system.filesystem.usage" and attributes["state"] == "reserved"'filter/exclude_filesystem_inodes_usage:metrics:datapoint:- 'metric.name == "system.filesystem.inodes.usage" and attributes["type"] == "squashfs"'- 'metric.name == "system.filesystem.inodes.usage" and attributes["state"] == "reserved"'filter/exclude_system_disk:metrics:datapoint:- 'metric.name == "system.disk.operations" and IsMatch(attributes["device"], "^loop.*") == true'- 'metric.name == "system.disk.merged" and IsMatch(attributes["device"], "^loop.*") == true'- 'metric.name == "system.disk.io" and IsMatch(attributes["device"], "^loop.*") == true'- 'metric.name == "system.disk.io_time" and IsMatch(attributes["device"], "^loop.*") == true'- 'metric.name == "system.disk.operation_time" and IsMatch(attributes["device"], "^loop.*") == true'filter/exclude_system_paging:metrics:datapoint:- 'metric.name == "system.paging.usage" and attributes["state"] == "cached"'- 'metric.name == "system.paging.operations" and attributes["type"] == "cached"'filter/exclude_network:metrics:datapoint:- 'IsMatch(metric.name, "^system.network.*") == true and attributes["device"] == "lo"'attributes/exclude_system_paging:include:match_type: strictmetric_names:- system.paging.operationsactions:- key: typeaction: deletetransform/clear_metadata:metric_statements:- context: metricstatements:- set(metric.description, "")- set(metric.unit, "")filter/exec_plan_and_query_details_include:metrics:include:match_type: strictmetric_names:- newrelicoracledb.execution_plan- newrelicoracledb.slow_queries.query_detailsfilter/exec_plan_and_query_details_exclude:metrics:exclude:match_type: strictmetric_names:- newrelicoracledb.execution_plan- newrelicoracledb.slow_queries.query_detailscumulativetodelta/oracle:include:match_type: strictmetrics:- newrelicoracledb.connection.bytes_received- newrelicoracledb.connection.bytes_sent- newrelicoracledb.connection.execute_count- newrelicoracledb.connection.logons_cumulative- newrelicoracledb.connection.parse_count_hard- newrelicoracledb.connection.parse_count_total- newrelicoracledb.connection.sqlnet_roundtrips- newrelicoracledb.connection.user_commits- newrelicoracledb.connection.user_rollbackstransform/host:metric_statements:- context: metricstatements:- set(metric.description, "")- set(metric.unit, "")transform:trace_statements:- context: spanstatements:- truncate_all(span.attributes, 4095)- truncate_all(resource.attributes, 4095)log_statements:- context: logstatements:- truncate_all(log.attributes, 4095)- truncate_all(resource.attributes, 4095)memory_limiter:check_interval: 1slimit_mib: ${env:NEW_RELIC_MEMORY_LIMIT_MIB:-100}batch:resourcedetection:detectors: ["system"]system:hostname_sources: ["os"]resource_attributes:host.id:enabled: trueresourcedetection/db_safe:detectors: ["system"]override: falsesystem:hostname_sources: ["os"]resource_attributes:host.id:enabled: trueresourcedetection/cloud:detectors: ["gcp", "ec2", "azure"]timeout: 2soverride: trueresourcedetection/env:detectors: ["env"]timeout: 2soverride: trueconnectors:metricsaslogs:include_resource_attributes: trueinclude_scope_info: trueexporters:otlp:endpoint: "<YOUR_NEWRELIC_OTLP_ENDPOINT>"headers:api-key: "<YOUR_NEWRELIC_API_KEY>"compression: gzipservice:pipelines:metrics/host:receivers: [hostmetrics]processors:- memory_limiter- metricstransform- filter/exclude_cpu_utilization- filter/exclude_memory_utilization- filter/exclude_memory_usage- filter/exclude_filesystem_utilization- filter/exclude_filesystem_usage- filter/exclude_filesystem_inodes_usage- filter/exclude_system_disk- filter/exclude_network- attributes/exclude_system_paging- transform/host- resourcedetection- resourcedetection/cloud- resourcedetection/env- cumulativetodelta/oracle- batchexporters: [otlp]traces:receivers: [otlp]processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch]exporters: [otlp]metrics:receivers: [otlp]processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch]exporters: [otlp]logs:receivers: [otlp]processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch]exporters: [otlp]metrics/oracledb:receivers: [newrelicoracledb/cdb, newrelicoracledb/pdb]processors: [memory_limiter, resourcedetection/db_safe, batch, transform/clear_metadata, filter/exec_plan_and_query_details_exclude]exporters: [otlp]metrics/exec_plan_and_query_details_to_logs:receivers: [newrelicoracledb/cdb, newrelicoracledb/pdb]processors: [filter/exec_plan_and_query_details_include]exporters: [metricsaslogs]logs/oracledb:receivers: [metricsaslogs]processors: [memory_limiter, resourcedetection/db_safe, batch]exporters: [otlp]extensions: [health_check]Set the following required parameters in the configuration file:
Parameter
Description
<YOUR_DB_HOST>Enter your Oracle database hostname.
<YOUR_DB_PORT>Enter your Oracle database port.
<USERNAME>Enter your database username.
<PASSWORD>Enter your database password.
<YOUR_CDB_SERVICE_NAME>Enter your Oracle service name.
<YOUR_NEWRELIC_OTLP_ENDPOINT>Enter the New Relic OTLP endpoint. For more information, refer to New Relic OTLP endpoints documentation.
<YOUR_NEWRELIC_API_KEY>Enter your New Relic API key.
pdb_servicesChoose the PDB services to monitor from the following options:
- Empty or nil: Collect only specified service data
["ALL"]: Collect all PDB services (excluding CDB)["pdb1", "pdb2"]: Collect only specified PDB services
enable_query_monitoringObtain query monitoring metrics such as, slow, active, wait, blocking sessions, and execution plan. The default value is set to
falsequery_monitoring_response_time_thresholdSet the threshold for query response time (in ms). Captures the queries which crosses to this threshold. The default value is set to 500ms.
query_monitoring_count_thresholdThe number of records for each query performance metrics. The default value is set to 30
Sugerencia
For more detailed information about New Relic OTLP endpoint configuration and OpenTelemetry best practices, refer to the OpenTelemetry OTLP documentation.
Restart NRDOT collector
After updating your configuration, restart the NRDOT collector:
$sudo systemctl restart nrdot-collector-host$sudo systemctl status nrdot-collector-hostSugerencia
Always restart the NRDOT collector after making configuration changes to ensure the new settings take effect.
(Optional) Multi-receiver configuration
The nrdot-collector-host binary supports a multi-receiver configuration within a single config.yaml to monitor multiple Oracle database instances using unique credentials. The sameple config.yaml below demonstrates how to set up multiple receivers for different on-host (multitenant) instances while sharing common processors and exporters.
receivers: newrelicoracledb/cdb1: endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>" username: "<USERNAME>" password: "<PASSWORD>" service: "<YOUR_CDB1_SERVICE_NAME>" collection_interval: 30s timeout: 30s # enable_tablespace_scraper: true # enable_core_scraper: true # enable_system_scraper: true # enable_connection_scraper: true # enable_container_scraper: true # enable_database_info_scraper: true
# First CDB's PDB configuration newrelicoracledb/pdb1: endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>" username: "<USERNAME>" password: "<PASSWORD>" service: "<YOUR_CDB2_SERVICE_NAME>" collection_interval: 30s timeout: 30s pdb_services: ["ALL"] # query_monitoring_response_time_threshold: 500 # query_monitoring_count_threshold: 30 # enable_query_monitoring: true # enable_pdb_scraper: true
# Second CDB configuration newrelicoracledb/cdb2: endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>" username: "<USERNAME>" password: "<PASSWORD>" service: "<YOUR_CDB2_SERVICE_NAME>" collection_interval: 30s timeout: 30s # enable_tablespace_scraper: true # enable_core_scraper: true # enable_system_scraper: true # enable_connection_scraper: true # enable_container_scraper: true # enable_database_info_scraper: true
# Second CDB's PDB configuration newrelicoracledb/pdb2: endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>" username: "<USERNAME>" password: "<PASSWORD>" service: "<YOUR_CDB2_SERVICE_NAME>" collection_interval: 30s timeout: 30s pdb_services: ["ALL"] # query_monitoring_response_time_threshold: 500 # query_monitoring_count_threshold: 30 # enable_query_monitoring: true # enable_pdb_scraper: true
processors: memory_limiter/oracle: check_interval: 1s limit_mib: ${env:NEW_RELIC_MEMORY_LIMIT_MIB:-100}
cumulativetodelta/oracle: include: match_type: strict metrics: - newrelicoracledb.connection.bytes_received - newrelicoracledb.connection.bytes_sent - newrelicoracledb.connection.execute_count - newrelicoracledb.connection.logons_cumulative - newrelicoracledb.connection.parse_count_hard - newrelicoracledb.connection.parse_count_total - newrelicoracledb.connection.sqlnet_roundtrips - newrelicoracledb.connection.user_commits - newrelicoracledb.connection.user_rollbacks
transform/oracle_clear_metadata: metric_statements: - context: metric statements: - set(metric.description, "") - set(metric.unit, "") log_statements: - context: log statements: - set(body, "")
filter/exec_plan_and_query_details_include: metrics: include: match_type: strict metric_names: - newrelicoracledb.execution_plan - newrelicoracledb.slow_queries.query_details
filter/exec_plan_and_query_details_exclude: metrics: exclude: match_type: strict metric_names: - newrelicoracledb.execution_plan - newrelicoracledb.slow_queries.query_details
resourcedetection/oracle_db_safe: detectors: ["system"] override: false system: hostname_sources: ["os"] resource_attributes: host.id: enabled: true
connectors: metricsaslogs/oracle: include_resource_attributes: true include_scope_info: true
service: pipelines: metrics/oracledb: receivers: [newrelicoracledb/cdb1, newrelicoracledb/pdb1, newrelicoracledb/cdb2, newrelicoracledb/pdb2] processors: [memory_limiter/oracle, cumulativetodelta/oracle, transform/oracle_clear_metadata, filter/exec_plan_and_query_details_exclude, resourcedetection/oracle_db_safe] exporters: [otlp]
metrics/oracle_query_to_logs: receivers: [newrelicoracledb/cdb1, newrelicoracledb/pdb1, newrelicoracledb/cdb2, newrelicoracledb/pdb2] processors: [memory_limiter/oracle, filter/exec_plan_and_query_details_include] exporters: [metricsaslogs/oracle]
logs/oracledb: receivers: [metricsaslogs/oracle] processors: [memory_limiter/oracle, transform/oracle_clear_metadata, resourcedetection/oracle_db_safe] exporters: [otlp]Sugerencia
This configuration allows you to monitor multiple Oracle RDS instances simultaneously. Each instance gets its own receiver configuration with unique credentials, while sharing common processors and exporters. Adjust the
collection_intervaland other parameters based on your monitoring requirements.Restart the NRDOT collector after updating the configuration to apply changes.
(Optional) Set up APM-database correlation
To correlate your application performance with database operations, you can set up database service identification. This feature allows you to see exactly which applications are generating specific database workloads. For more information, refer to set up database service identification to get APM-database correlation in New Relic.
Importante
To view database performance data in APM, both entities must be in the same New Relic account. If the entities are in different New Relic accounts, you must have access to both accounts to view the data.
(Optional) Configure secret management
The secret management feature allows you to securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files. For more information, refer to secret management.
Find and use your data
Once your data is being collected, you can access comprehensive Oracle database monitoring through New Relic's UI.
To find your Oracle database entity in New Relic:
- Go to https://one.newrelic.com > All Capabilities > Databases.
- Set the search criteria as
instrumentation.provider = opentelemetry. - Select your Oracle database from the list of entities.
To install the NRDOT Collector in RDS environments, follow these steps:
Installation method
Select the appropriate installation distribution method for your Linux environment:
Configure database user
Create a monitoring user with necessary privileges for your RDS Oracle Database.
Log in to the root database as an administrator:
CREATE USER <USERNAME> IDENTIFIED BY "<USER_PASSWORD>";Grant
CONNECTprivileges to newly created user:GRANT CONNECT TO <USERNAME>;
Grant monitoring privileges for RDS database
Execute the following SQL statements to grant monitoring privileges. Replace <USERNAME_IN_UPPERCASE> with your username in uppercase:
SET SERVEROUTPUT ON;BEGIN FOR r IN (SELECT column_value as view_name FROM table(sys.odcivarchar2list( 'V_$SESSION', 'V_$SYSSTAT', 'V_$SESSTAT', 'V_$STATNAME', 'V_$SYSTEM_EVENT', 'V_$SHARED_SERVER', 'V_$DISPATCHER', 'V_$RESOURCE_LIMIT', 'V_$LOCK', 'V_$DATABASE', 'V_$PARAMETER', 'V_$SQLAREA', 'V_$SQL', 'V_$SQL_PLAN', 'V_$PDBS', 'GV_$INSTANCE', 'GV_$SGA', 'GV_$SESSTAT', 'GV_$STATNAME', 'GV_$SYSSTAT', 'GV_$SQLAREA', 'GV_$LIBRARYCACHE', 'GV_$ROWCACHE', 'GV_$PGASTAT', 'GV_$CONTAINERS', 'GV_$PDBS', 'GV_$CON_SYSMETRIC', 'GV_$SYSMETRIC', 'GV_$FILESTAT', 'GV_$SYSTEM_EVENT', 'GV_$ACTIVE_SERVICES', 'GV_$SESSION', 'GV_$SESSION_WAIT', 'GV_$ROLLSTAT', 'DBA_OBJECTS', 'DBA_TABLESPACES', 'DBA_TABLESPACE_USAGE_METRICS', 'DBA_DATA_FILES', 'DBA_USERS', 'CDB_SERVICES', 'CDB_DATA_FILES', 'CDB_TABLESPACE_USAGE_METRICS', 'CDB_USERS', 'CDB_PDBS', 'ALL_USERS', 'ALL_VIEWS', 'GLOBAL_NAME' ))) LOOP BEGIN rdsadmin.rdsadmin_util.grant_sys_object( p_obj_name => r.view_name, p_grantee => '<USERNAME_IN_UPPERCASE>', p_privilege => 'SELECT' ); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('FAILED: ' || r.view_name || ' | Error: ' || SQLERRM); END; END LOOP;END;/Configure NRDOT Collector
Edit your
config.yamlfile available at/etc/nrdot-collector-host/, then add the following code snippet:Importante
If you're an existing NRDOT Collector user, ensure to merge the above configuration with your existing
config.yamlfile. This includes adding the new receivers, processors, and exporters for Oracle Database monitoring while retaining your current configurations.receivers:newrelicoracledb/pdb:endpoint: "<YOUR_DB_HOST>:<YOUR_DB_PORT>"username: "<USERNAME>"password: "<PASSWORD>"service: "<PDB_NAME>"collection_interval: 30stimeout: 30s# pdb_services: ['PDB1','PDB2'] #for multiple pdbs# query_monitoring_response_time_threshold: 500# query_monitoring_count_threshold: 30# enable_query_monitoring: true# enable_pdb_scraper: true# enable_tablespace_scraper: true# enable_core_scraper: true# enable_system_scraper: true# enable_connection_scraper: true# enable_container_scraper: true# enable_database_info_scraper: trueprocessors:transform/clear_metadata:metric_statements:- context: metricstatements:- set(metric.description, "")- set(metric.unit, "")log_statements:- context: logstatements:- set(log.body, "")filter/exec_plan_and_query_details_include:metrics:include:match_type: strictmetric_names:- newrelicoracledb.execution_plan- newrelicoracledb.slow_queries.query_detailsfilter/exec_plan_and_query_details_exclude:metrics:exclude:match_type: strictmetric_names:- newrelicoracledb.execution_plan- newrelicoracledb.slow_queries.query_detailscumulativetodelta:include:match_type: strictmetrics:- newrelicoracledb.connection.bytes_received- newrelicoracledb.connection.bytes_sent- newrelicoracledb.connection.execute_count- newrelicoracledb.connection.logons_cumulative- newrelicoracledb.connection.parse_count_hard- newrelicoracledb.connection.parse_count_total- newrelicoracledb.connection.sqlnet_roundtrips- newrelicoracledb.connection.user_commits- newrelicoracledb.connection.user_rollbacksconnectors:metricsaslogs:include_resource_attributes: trueinclude_scope_info: trueexporters:otlp:endpoint: "<YOUR_NEWRELIC_OTLP_ENDPOINT>"headers:api-key: "<YOUR_NEWRELIC_API_KEY>"compression: gzipservice:pipelines:metrics:receivers: [newrelicoracledb/pdb]processors: [transform/clear_metadata, filter/exec_plan_and_query_details_exclude, cumulativetodelta]exporters: [otlp]metrics/exec_plan_and_query_details_to_logs:receivers: [newrelicoracledb/pdb]processors: [filter/exec_plan_and_query_details_include]exporters: [metricsaslogs]logs/newrelicoracledb:receivers: [metricsaslogs]processors: [transform/clear_metadata]exporters: [otlp]Set the following required parameters in the configuration file:
Parameter
Description
<YOUR_DB_HOST>Enter your Oracle database hostname.
<YOUR_DB_PORT>Enter your Oracle database port.
<USERNAME>Enter your database username.
<PASSWORD>Enter your database password.
<PDB_NAME>Enter your PDB service name.
<YOUR_NEWRELIC_OTLP_ENDPOINT>Enter the New Relic OTLP endpoint. For more information, refer to New Relic OTLP endpoints documentation.
<YOUR_NEWRELIC_API_KEY>Enter your New Relic API key.
pdb_servicesChoose the PDB services to monitor from the following options:
- Empty or nil: Collect only specified service data
["pdb1", "pdb2"]: Collect only specified PDB services
enable_query_monitoringObtain query monitoring metrics such as, slow, active, wait, blocking sessions, and execution plan. The default value is set to
falsequery_monitoring_response_time_thresholdSet the threshold for query response time (in ms). Captures the queries which crosses to this threshold. The default value is set to 500ms.
query_monitoring_count_thresholdThe number of records for each query performance metrics. The default value is set to 30
Restart NRDOT collector
After updating your configuration, restart the NRDOT collector:
$sudo systemctl restart nrdot-collector-host$sudo systemctl status nrdot-collector-hostSugerencia
Always restart the NRDOT collector after making configuration changes to ensure the new settings take effect.
(Optional) Multi-receiver configuration
The nrdot-collector-host binary supports a multi-receiver configuration within a single config.yaml to monitor multiple Oracle database instances using unique credentials. The sameple config.yaml below demonstrates how to set up multiple receivers for different RDS instances while sharing common processors and exporters.
receivers: # First RDS Instance newrelicoracledb/pdb/rds1: endpoint: "<YOUR_DB_HOST_1>:<YOUR_DB_PORT_1>" username: "<USERNAME_1>" password: "<PASSWORD_1>" service: "<PDB_NAME_1>" collection_interval: 30s timeout: 30s # query_monitoring_response_time_threshold: 500 # query_monitoring_count_threshold: 30 # enable_query_monitoring: true
# Second RDS Instance newrelicoracledb/pdb/rds2: endpoint: "<YOUR_DB_HOST_2>:<YOUR_DB_PORT_2>" username: "<USERNAME_2>" password: "<PASSWORD_2>" service: "<PDB_NAME_2>" collection_interval: 30s timeout: 30s # query_monitoring_response_time_threshold: 500 # query_monitoring_count_threshold: 30 # enable_query_monitoring: true
processors: transform/clear_metadata: metric_statements: - context: metric statements: - set(metric.description, "") - set(metric.unit, "") log_statements: - context: log statements: - set(log.body, "")
filter/exec_plan_and_query_details_include: metrics: include: match_type: strict metric_names: - newrelicoracledb.execution_plan - newrelicoracledb.slow_queries.query_details
filter/exec_plan_and_query_details_exclude: metrics: exclude: match_type: strict metric_names: - newrelicoracledb.execution_plan - newrelicoracledb.slow_queries.query_details
connectors: metricsaslogs: include_resource_attributes: true include_scope_info: true
exporters: otlp: endpoint: "<YOUR_NEWRELIC_OTLP_ENDPOINT>" headers: api-key: "<YOUR_NEWRELIC_API_KEY>" compression: gzip
service: pipelines: # Separate metrics pipelines to apply unique resource names metrics/rds1: receivers: [newrelicoracledb/pdb/rds1] processors: [transform/clear_metadata, filter/exec_plan_and_query_details_exclude] exporters: [otlp] metrics/rds2: receivers: [newrelicoracledb/pdb/rds2] processors: [transform/clear_metadata, filter/exec_plan_and_query_details_exclude] exporters: [otlp]
# Combined logs pipeline for execution plans and query details metrics/exec_plan_and_query_details_to_logs: receivers: [newrelicoracledb/pdb/rds1, newrelicoracledb/pdb/rds2] processors: [filter/exec_plan_and_query_details_include] exporters: [metricsaslogs]
logs/newrelicoracledb: receivers: [metricsaslogs] processors: [transform/clear_metadata] exporters: [otlp]Sugerencia
This configuration allows you to monitor multiple Oracle RDS instances simultaneously. Each instance gets its own receiver configuration with unique credentials, while sharing common processors and exporters. Adjust the
collection_intervaland other parameters based on your monitoring requirements.Restart the NRDOT collector after updating the configuration to apply changes.
(Optional) Set up APM-database correlation
To correlate your application performance with database operations, you can set up database service identification. This feature allows you to see exactly which applications are generating specific database workloads. For more information, refer to set up database service identification to get APM-database correlation in New Relic.
Importante
To view database performance data in APM, both entities must be in the same New Relic account. If the entities are in different accounts, you must have access to both accounts to view the data.
(Optional) Configure secret management
The secret management feature allows you to securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files. For more information, refer to secret management.
Find and use your data
Once your data is being collected, you can access comprehensive Oracle database monitoring through New Relic's UI.
To find your Oracle database entity in New Relic:
- Go to https://one.newrelic.com > All Capabilities > Databases.
- Set the search criteria as
instrumentation.provider = opentelemetry. - Select your Oracle database from the list of entities.
NRDOT collector supported commands
This section provides a list of common commands for managing the NRDOT Collector service on your system.
Available metrics
Monitor your Oracle database performance with metrics organized by configuration flags. Default metrics are collected automatically for New Relic UI functionality. You can also use provided additional metrics to gain advanced and deeper insights when you enable specific scrapers.
Default metrics
These metrics are essential for New Relic's Oracle database monitoring features and are collected automatically regardless of your configuration.
Additional metrics
Enable these additional metrics as required for deeper insights into your Oracle database performance and health.
What's next
After setting up Oracle database monitoring with NRDOT:
- Create custom dashboards to visualize your database metrics
- Set up alerts for critical database performance thresholds
- Explore your data using New Relic's query capabilities