Prometheus Oracle database exporter.
Clone or download
Latest commit 95405ef Oct 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor first commit Aug 23, 2016
.gitignore first commit Aug 23, 2016
.travis.yml update travis CI token Oct 19, 2018
Dockerfile update travis build and dockerfile Oct 19, 2018
LICENSE first commit Aug 23, 2016
Makefile roll to version 0.0.7 Dec 16, 2017
README.md Merge branch 'master' of https://github.com/iamseth/oracledb_exporter Oct 19, 2018
main.go add process count metric for #25 Oct 19, 2018
oci8.pc fix make targets for travis Sep 28, 2017

README.md

Oracle DB Exporter

Build Status GoDoc Report card

Table of Contents

Description
Installation
Running
Grafana
Troubleshooting

Description

A Prometheus exporter for Oracle modeled after the MySQL exporter. I'm not a DBA or seasoned Go developer so PRs definitely welcomed.

The following metrics are exposed currently.

  • oracledb_exporter_last_scrape_duration_seconds
  • oracledb_exporter_last_scrape_error
  • oracledb_exporter_scrapes_total
  • oracledb_up
  • oracledb_activity_execute_count
  • oracledb_activity_parse_count_total
  • oracledb_activity_user_commits
  • oracledb_activity_user_rollbacks
  • oracledb_sessions_activity
  • oracledb_sessions_active (deprecated. Use sum(oracledb_sessions_activity{status='ACTIVE'}) instead.)
  • oracledb_sessions_inactive (deprecated. Use sum(oracledb_sessions_activity{status='INACTIVE'}) instead.)
  • oracledb_wait_time_application
  • oracledb_wait_time_commit
  • oracledb_wait_time_concurrency
  • oracledb_wait_time_configuration
  • oracledb_wait_time_network
  • oracledb_wait_time_other
  • oracledb_wait_time_scheduler
  • oracledb_wait_time_system_io
  • oracledb_wait_time_user_io
  • oracledb_tablespace_bytes
  • oracledb_tablespace_max_bytes
  • oracledb_tablespace_bytes_free
  • oracledb_process_count

Installation

Docker

You can run via Docker using an existing image. If you don't already have an Oracle server, you can run one locally in a container and then link the exporter to it.

docker run -d --name oracle -p 1521:1521 wnameless/oracle-xe-11g:16.04
docker run -d --name oracledb_exporter --link=oracle -p 9161:9161 -e DATA_SOURCE_NAME=system/oracle@oracle/xe iamseth/oracledb_exporter

Binary Release

Pre-compiled versions for Linux 64 bit and Mac OSX 64 bit can be found under releases.

In order to run, you'll need the Oracle Instant Client Basic for your operating system. Only the basic version is required for execution.

Running

Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. For Example

export DATA_SOURCE_NAME=system/oracle@myhost
/path/to/binary -l log.level error -l web.listen-address 9161

Usage

Usage of oracledb_exporter:
  -log.format value
       	If set use a syslog logger or JSON logging. Example: logger:syslog?appname=bob&local=7 or logger:stdout?json=true. Defaults to stderr.
  -log.level value
       	Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal].
  -web.listen-address string
       	Address to listen on for web interface and telemetry. (default ":9161")
  -web.telemetry-path string
       	Path under which to expose metrics. (default "/metrics")

Integration with Grafana

An example Grafana dashboard is available here.

Troubleshooting

Error scraping for wait_time

If you experience an error Error scraping for wait_time: sql: Scan error on column index 1: converting driver.Value type string (",01") to a float64: invalid syntax source="main.go:144" you may need to set the NLS_LANG variable.

export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
export DATA_SOURCE_NAME=system/oracle@myhost
/path/to/binary -l log.level error -l web.listen-address 9161

If using Docker, set the same variable using the -e flag.