OracleDB integration for Grafana Cloud
OracleDB is an enterprise SQL Database system produced and marketed by Oracle Corporation. The OracleDB integration uses the Grafana Agent to collect metrics and alert logs for monitoring an OracleDB instance. Including metrics such as virtual memory usage, open file descriptors, sessions, processes, database wait times, and tablespace usage. It also includes monitoring the alert log of an OracleDB instance which contains valuable information for usage and operations of the instance.
This integration supports metrics provided by v0.0.1 of a third party OracleDB exporter, which is integrated into the Grafana Agent.
This integration includes 3 useful alerts and 1 pre-built dashboard to help monitor and visualize OracleDB metrics and logs.
Before you begin
In the agent configuration file, you must provide a connection string which has credentials with permissions to run queries.
To create a user with the SQL permissions required for the monitoring user “grafanau”.
-- Create the monitoring user "grafanau"
CREATE USER grafanau IDENTIFIED BY <YOUR-PASSWORD>;
-- Grant the "grafanau" user the required permissions
GRANT CONNECT TO grafanau;
GRANT SELECT ON SYS.GV_$RESOURCE_LIMIT to grafanau;
GRANT SELECT ON SYS.V_$SESSION to grafanau;
GRANT SELECT ON SYS.V_$WAITCLASSMETRIC to grafanau;
GRANT SELECT ON SYS.GV_$PROCESS to grafanau;
GRANT SELECT ON SYS.GV_$SYSSTAT to grafanau;
GRANT SELECT ON SYS.V_$DATAFILE to grafanau;
GRANT SELECT ON SYS.V_$ASM_DISKGROUP_STAT to grafanau;
GRANT SELECT ON SYS.V_$SYSTEM_WAIT_CLASS to grafanau;
GRANT SELECT ON SYS.DBA_TABLESPACE_USAGE_METRICS to grafanau;
GRANT SELECT ON SYS.DBA_TABLESPACES to grafanau;
GRANT SELECT ON SYS.GLOBAL_NAME to grafanau;
Install OracleDB integration for Grafana Cloud
- In your Grafana Cloud stack, click Connections in the left-hand menu.
- Find OracleDB and click its tile to open the integration.
- Review the prerequisites in the Configuration Details tab and set up Grafana Agent to send OracleDB metrics and logs to your Grafana Cloud instance.
- Click Install to add this integration’s pre-built dashboard and alerts to your Grafana Cloud instance, and you can start monitoring your OracleDB setup.
Post-install configuration for the OracleDB integration
This integration supports metrics and logs from an OracleDB instance.
Enable the integration by adding the provided snippets to your agent configuration file.
If you want to show logs and metrics signals correlated in your dashboards, as a single pane of glass, ensure the following:
job
and instance
label values must match for metrics and logs scrape config in your agent configuration file.
job
label must be set to integrations/oracledb
(already configured in the snippets).
instance
label must be set to a value that uniquely identifies your OrableDB node. Please replace the default <your-instance-name>
value according to your environment - it should be set manually. Note that if you use localhost for multiple nodes, the dashboards will not be able to filter correctly by instance.
Configuration snippets for Grafana Agent
Below integrations
, insert the following lines and change the URLs according to your environment:
oracledb:
enabled: true
scrape_interval: 5m
scrape_timeout: 1m
scrape_integration: true
connection_string: 'oracle://user:password@localhost:1521/orcl.localnet' # replace with your connection string
max_idle_connections: 0
max_open_connections: 10
query_timeout: 5
relabel_configs:
- replacement: '<your-instance-name>'
target_label: instance
Below logs.configs.scrape_configs
, insert the following lines according to your environment.
- job_name: integrations/oracledb
static_configs:
- targets: [localhost]
labels:
instance: '<your-instance-name>'
job: integrations/oracledb
__path__: /u01/base/diag/rdbms/*/*/trace/alert_*.log # replace with your log path
pipeline_stages:
- multiline:
# match on timestamp. Format should be like '2023-01-20T09:38:23.454813-05:00'
# but feel free to modify to match your logs
firstline: '\d+-\d+-\d+T\d+:\d+:\d+.\d+-\d+:\d+'
Full example configuration for Grafana Agent
Refer to the following Grafana Agent configuration for a complete example that contains all the snippets used for the OracleDB integration. This example also includes metrics that are sent to monitor your Grafana Agent instance.
integrations:
prometheus_remote_write:
- basic_auth:
password: <your_prom_pass>
username: <your_prom_user>
url: <your_prom_url>
agent:
enabled: true
relabel_configs:
- action: replace
source_labels:
- agent_hostname
target_label: instance
- action: replace
target_label: job
replacement: "integrations/agent-check"
metric_relabel_configs:
- action: keep
regex: (prometheus_target_.*|prometheus_sd_discovered_targets|agent_build.*|agent_wal_samples_appended_total|process_start_time_seconds)
source_labels:
- __name__
# Add here any snippet that belongs to the `integrations` section.
# For a correct indentation, paste snippets copied from Grafana Cloud at the beginning of the line.
oracledb:
enabled: true
scrape_interval: 5m
scrape_timeout: 1m
scrape_integration: true
connection_string: 'oracle://user:password@localhost:1521/orcl.localnet' # replace with your connection string
max_idle_connections: 0
max_open_connections: 10
query_timeout: 5
relabel_configs:
- replacement: '<your-instance-name>'
target_label: instance
logs:
configs:
- clients:
- basic_auth:
password: <your_loki_pass>
username: <your_loki_user>
url: <your_loki_url>
name: integrations
positions:
filename: /tmp/positions.yaml
scrape_configs:
# Add here any snippet that belongs to the `logs.configs.scrape_configs` section.
# For a correct indentation, paste snippets copied from Grafana Cloud at the beginning of the line.
- job_name: integrations/oracledb
static_configs:
- targets: [localhost]
labels:
instance: '<your-instance-name>'
job: integrations/oracledb
__path__: /u01/base/diag/rdbms/*/*/trace/alert_*.log # replace with your log path
pipeline_stages:
- multiline:
# match on timestamp. Format should be like '2023-01-20T09:38:23.454813-05:00'
# but feel free to modify to match your logs
firstline: '\d+-\d+-\d+T\d+:\d+:\d+.\d+-\d+:\d+'
metrics:
configs:
- name: integrations
remote_write:
- basic_auth:
password: <your_prom_pass>
username: <your_prom_user>
url: <your_prom_url>
scrape_configs:
# Add here any snippet that belongs to the `metrics.configs.scrape_configs` section.
# For a correct indentation, paste snippets copied from Grafana Cloud at the beginning of the line.
global:
scrape_interval: 60s
wal_directory: /tmp/grafana-agent-wal
Dashboards
The OracleDB integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.
- OracleDB overview
OracleDB overview dashboard
Alerts
The OracleDB integration includes the following useful alerts:
Alert | Description |
---|---|
OracledbReachingSessionLimit | Critical: The number of sessions being utilized exceeded 85%. |
OracledbReachingProcessLimit | Critical: The number of processess being utilized exceeded the threshold of 85%. |
OracledbTablespaceReachingCapacity | Critical: A tablespace is exceeding more than 85% of its maximum allotted space. |
Metrics
The most important metrics provided by the OracleDB integration, which are used on the pre-built dashboard and Prometheus alerts, are as follows:
- oracledb_resource_current_utilization
- oracledb_resource_limit_value
- oracledb_tablespace_bytes
- oracledb_tablespace_free
- oracledb_tablespace_max_bytes
- oracledb_up
- oracledb_wait_time_application
- oracledb_wait_time_commit
- oracledb_wait_time_concurrency
- oracledb_wait_time_configuration
- oracledb_wait_time_network
- oracledb_wait_time_scheduler
- oracledb_wait_time_system_io
- oracledb_wait_time_user_io
Changelog
# 0.0.3 - September 2023
* New Filter Metrics option for configuring the Grafana Agent, which saves on metrics cost by dropping any metric not used by this integration. Beware that anything custom built using metrics that are not on the snippet will stop working.
* New hostname relabel option, which applies the instance name you write on the text box to the Grafana Agent configuration snippets, making it easier and less error prone to configure this mandatory label.
# 0.0.2 - August 2023
* Add regex filter for logs datasource
# 0.0.1 - February 2023
* Initial release
Cost
By connecting your OracleDB instance to Grafana Cloud, you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see Active series and dpm usage and Cloud tier pricing.
Related resources from Grafana Labs


