Monitoring Oracle Database using Prometheus image

Monitoring Oracle Database using Prometheus

Prometheus is a very popular framework for gathering metrics from a plethora of runtime components, recording, analyzing, visualizing them and making them available for companion technologies such as Grafana. Prometheus harvests information from ‘exporters’ – processes that expose an HTTP endpoint where Prometheus can scrape metrics in a format that it understands.

Recently, I received an email with the following question:

I need help on monitoring Oracle Database using Prometheus. I Googled but not find proper blog or doc for it. Most of the GitHub code deploy on docker. But in my case is local physical server and Oracle RAC database install on it. I have to monitor that RAC database using Prometheus.

If you have any configuration code/steps for same, can you please share with me. I tried to modify prometheus.conf file but not getting succeed.

Although I am not an expert on Prometheus in combination with Oracle Database, I made an attempt to help. The next visual – showing an Oracle Database metrics exporter – is perhaps a good illustration of what I tried to explain:

image

In order to monitor anything with Prometheus, you need an exporter – a process that exposes metrics for Prometheus to harvest. Prometheus does not come out of the box with an exporter for Oracle Database, nor does Oracle (Corporation) provide one.

There are various open source Prometheus Exporters for Oracle – for example: https://github.com/freenetdigital/prometheus_oracle_exporter . This particular example is a go application that is installed on some server from where it can connect to the Oracle Database (RAC Cluster) you want to have metrics exposed for. The configuration file – see https://github.com/freenetdigital/prometheus_oracle_exporter/blob/master/oracle.conf.example – is used to specify which instances to publish metrics for and which specific metrics to publish.

You can run this exporter in its own Docker Container and also as a standalone operating system process; you do need the Go runtime for this.

I suppose there are other Prometheus exporters for Oracle as well – for example https://github.com/iamseth/oracledb_exporter. This one is also in Go. It requires the Oracle Database Client library to be installed for the operating system you are on.

Note: it should not be too hard to create your own exporter – which can be done in your favourite programming language. Your exporter would read the Oracle Database Dynamic V$ Views and possibly other data dictionary views, derive relevant metrics and return these in the Prometheus format; for this you can make us of the specific Prometheus client library.

Resources

In September 2018, I organized a Meetup on Prometheus (and Grafana); here are the slides from that session: https://www.slideshare.net/lucasjellema/meetup-monitoring-with-prometheus-and-grafana-september-2018 

The resources for the accompanying workshop are in GitHub: https://github.com/lucasjellema/monitoring-workshop-prometheus-grafana

One Response

  1. GSPANN February 18, 2020