Skip to content

Commit bd00cc6

Browse files
authored
2.0.1 (#257)
* update rpms * update azidentity * update oci sdk * update TPL * update docs and k8s sample --------- Signed-off-by: Mark Nelson <[email protected]>
1 parent cda581b commit bd00cc6

File tree

10 files changed

+128
-15
lines changed

10 files changed

+128
-15
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ ENV GOARCH=${GOARCH:-amd64}
4242
# second note: moved back to 21c drivers due to adb-s non-root connection issue. for 23ai, change rpm to
4343
# oracle-instantclient-release-23ai-el8 and paths below s/21/23/
4444
RUN if [ "$GOARCH" = "amd64" ]; then \
45-
microdnf install -y oracle-instantclient-release-el8 && microdnf install -y oracle-instantclient-basic && \
45+
microdnf update && \
46+
microdnf install -y oracle-instantclient-release-el8 && \
47+
microdnf install -y oracle-instantclient-basic && \
4648
microdnf install glibc-2.28-251.0.2.el8_10.4 \
4749
; else \
50+
microdnf update && \
4851
microdnf install wget libaio && \
4952
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linux-arm64.rpm && \
5053
rpm -ivh instantclient-basic-linux-arm64.rpm && \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ OS_TYPE ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
33
ARCH_TYPE ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH)))
44
GOOS ?= $(shell go env GOOS)
55
GOARCH ?= $(shell go env GOARCH)
6-
VERSION ?= 2.0.0
6+
VERSION ?= 2.0.1
77
LDFLAGS := -X main.Version=$(VERSION)
88
GOFLAGS := -ldflags "$(LDFLAGS) -s -w"
99
BUILD_ARGS = --build-arg VERSION=$(VERSION)

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
This project aims to provide observability for the Oracle Database so that users can understand performance and diagnose issues easily across applications and database. Over time, this project will provide not just metrics, but also logging and tracing support, and integration into popular frameworks like Spring Boot. The project aims to deliver functionality to support both cloud and on-premises databases, including those running in Kubernetes and containers.
44

5+
## Main Features
6+
7+
The main features of the exporter are:
8+
9+
- Exports Oracle Database metrics in de facto standard Prometheus format
10+
- Works with many types of Oracle Database deployment including single instance and Oracle Autonomous Database
11+
- Supports wallet-based authentication
12+
- Supports both OCI and Azure Vault integration (for database username, password)
13+
- Multiple database support allows a single instance of the exporter to connect to, and export metrics from, multiple databases
14+
- Can export the Alert Log in JSON format for easy ingest by log aggregators
15+
- Can run as a local binary, in a container, or in Kubernetes
16+
- Pre-buit AMD64 and ARM64 images provided
17+
- A set of standard metrics included "out of the box"
18+
- Easily define custom metrics
19+
- Define the scrape interval, down to a per-metric level
20+
- Define the query timeout
21+
- Control connection pool settings, can use with go-sql or Oracle Database connection pools, also works with Database Resident Connection Pools
22+
- Sample dashboard provided for Grafana
23+
524
![Oracle Database Dashboard](doc/exporter-running-against-basedb.png)
625

726
From the first production release, v1.0, onwards, this project provides a [Prometheus](https://prometheus.io/) exporter for Oracle Database that is based in part on a Prometheus exporter created by [Seth Miller](https://github.com/iamseth/oracledb_exporter) with changes to comply with various Oracle standards and policies.
@@ -34,6 +53,7 @@ Contributions are welcome - please see [contributing](CONTRIBUTING.md).
3453

3554
| Release | Date | Changelog |
3655
|---------|----------------------|-----------------------------------------------------------------|
56+
| 2.0.1 | June 12, 2025 | [2.0.1 Changelog](./changelog.md#version-201-june-12-2025) |
3757
| 2.0.0 | May 27, 2025 | [2.0.0 Changelog](./changelog.md#version-200-may-27-2025) |
3858
| 1.6.1 | May 2, 2025 | [1.6.1 Changelog](./changelog.md#version-161-may-2-2025) |
3959
| 1.6.0 | April 18, 2025 | [1.6.0 Changelog](./changelog.md#version-160-april-18-2025) |
@@ -382,7 +402,7 @@ docker run -it --rm \
382402
-e DB_PASSWORD=Welcome12345 \
383403
-e DB_CONNECT_STRING=free23ai:1521/freepdb \
384404
-p 9161:9161 \
385-
container-registry.oracle.com/database/observability-exporter:1.6.1
405+
container-registry.oracle.com/database/observability-exporter:2.0.1
386406
```
387407

388408
##### Using a wallet
@@ -428,7 +448,7 @@ docker run -it --rm \
428448
-e DB_CONNECT_STRING=devdb_tp \
429449
-v ./wallet:/wallet \
430450
-p 9161:9161 \
431-
container-registry.oracle.com/database/observability-exporter:1.6.1
451+
container-registry.oracle.com/database/observability-exporter:2.0.1
432452
```
433453
> **Note:** If you are using `podman` you must specify the `:z` suffix on the volume mount so that the container will be able to access the files in the volume. For example: `-v ./wallet:/wallet:z`
434454

@@ -464,6 +484,18 @@ kubectl create secret generic db-secret \
464484
-n exporter
465485
```
466486

487+
#### Create a config map for the exporter configuration file (recommended)
488+
489+
Create a config map with the exporter configuration file (if you are using one) using this command:
490+
491+
```bash
492+
kubectl create cm metrics-exporter-config \
493+
--from-file=metrics-exporter-config.yaml
494+
```
495+
496+
> NOTE: It is strongly recommended to migrate to the new config file if you are running version 2.0.0 or later.
497+
498+
467499
#### Create a config map for the wallet (optional)
468500

469501
Create a config map with the wallet (if you are using one) using this command. Run this command in the `wallet` directory you created earlier.
@@ -481,7 +513,7 @@ kubectl create cm db-metrics-tns-admin \
481513
-n exporter
482514
```
483515

484-
#### Create a config map for you metrics definition file (optional)
516+
#### Create a config map for your metrics definition file (optional)
485517

486518
If you have defined any [custom metrics](#custom-metrics), you must create a config map for the metrics definition file. For example, if you created a configuration file called `txeventq-metrics.toml`, then create the config map with this command:
487519

@@ -967,7 +999,7 @@ An exmaple of [custom metrics for Transacational Event Queues](./custom-metrics-
967999
If you run the exporter as a container image and want to include your custom metrics in the image itself, you can use the following example `Dockerfile` to create a new image:
9681000
9691001
```Dockerfile
970-
FROM container-registry.oracle.com/database/observability-exporter:1.6.1
1002+
FROM container-registry.oracle.com/database/observability-exporter:2.0.1
9711003
COPY custom-metrics.toml /
9721004
ENTRYPOINT ["/oracledb_exporter", "--custom.metrics", "/custom-metrics.toml"]
9731005
```

THIRD_PARTY_LICENSES.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,10 @@ SPDX:Apache-2.0
769769

770770

771771
== Copyright
772-
Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
772+
Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
773773

774774
== Notices
775-
Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates.
775+
Copyright (c) 2016, 2025, Oracle and/or its affiliates.
776776

777777
--------------------------------- (separator) ----------------------------------
778778

@@ -797,7 +797,7 @@ SPDX:Apache-2.0
797797
Copyright (c) 2015 Björn Rabenstein
798798
Copyright 2013 The Go Authors. All rights reserved.
799799
Copyright 2013-2015 Blake Mizerany, Björn Rabenstein
800-
Copyright 2024 The Prometheus Authors
800+
Copyright 2025 The Prometheus Authors
801801

802802
== Notices
803803
Prometheus instrumentation library for Go applications
@@ -967,7 +967,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
967967

968968
== Copyright
969969
Copyright 2009 The Go Authors.
970-
Copyright 2024 The Go Authors. All rights reserved.
970+
Copyright 2025 The Go Authors. All rights reserved.
971971

972972
== Patents
973973
Additional IP Rights Grant (Patents)
@@ -1447,4 +1447,4 @@ SOFTWARE.
14471447

14481448
=== ATTRIBUTION-HELPER-GENERATED:
14491449
=== Attribution helper version: {Major:0 Minor:11 GitVersion:0.10.0-116-g2a434e4d-dirty GitCommit:2a434e4d7eea22d4dfd2d1cf04909239d05562b1 GitTreeState:dirty BuildDate:2025-04-29T00:30:45Z GoVersion:go1.22.4 Compiler:gc Platform:linux/amd64}
1450-
=== License file based on go.mod with md5 sum: 8b2013f9c4f6808e20b272f9ecfa05b2
1450+
=== License file based on go.mod with md5 sum: 15979ec9beb851f5e9b7b1e60a196993

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
Our current priorities are support for RAC and Exadata. We expect to address these in an upcoming release.
66

7+
### Version 2.0.1, June 12, 2025
8+
9+
This release includes the following changes:
10+
11+
- Use gv$ views instead of v$ views to allow collection of metrics from all instances in a cluster. (In preparation for RAC support).
12+
- Update some third-party dependencies.
13+
714
### Version 2.0.0, May 27, 2025
815

916
This release includes the following changes:

docker-compose/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ services:
5959
start_period: 30s
6060

6161
exporter:
62-
image: container-registry.oracle.com/database/observability-exporter:2.0.0
62+
image: container-registry.oracle.com/database/observability-exporter:2.0.1
6363
container_name: exporter
6464
command:
6565
- '--config.file=/exporter/config.yaml'

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ module github.com/oracle/oracle-db-appdev-monitoring
33
go 1.23.8
44

55
require (
6-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.0
6+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1
77
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0
88
github.com/BurntSushi/toml v1.5.0
99
github.com/alecthomas/kingpin/v2 v2.4.0
1010
github.com/godror/godror v0.48.3
11-
github.com/oracle/oci-go-sdk/v65 v65.91.1
11+
github.com/oracle/oci-go-sdk/v65 v65.93.1
1212
github.com/prometheus/client_golang v1.22.0
1313
github.com/prometheus/common v0.64.0
1414
github.com/prometheus/exporter-toolkit v0.14.0

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 h1:OVoM452qUFBrX+URdH3Vp
88
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0/go.mod h1:kUjrAo8bgEwLeZ/CmHqNl3Z/kPm7y6FKfxxK0izYUg4=
99
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.0 h1:j8BorDEigD8UFOSZQiSqAMOOleyQOOQPnUAwV+Ls1gA=
1010
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.0/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4=
11+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4=
12+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4=
1113
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY=
1214
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8=
1315
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
@@ -106,6 +108,8 @@ github.com/oracle/oci-go-sdk/v65 v65.89.3 h1:KSUykb5Ou54jF4SeJNjBwcDg+umbAwcvT+x
106108
github.com/oracle/oci-go-sdk/v65 v65.89.3/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA=
107109
github.com/oracle/oci-go-sdk/v65 v65.91.1 h1:jRE4jUiJd+sDhJTyTCXIJdzLjTx+99gA3PgzpVTaF/I=
108110
github.com/oracle/oci-go-sdk/v65 v65.91.1/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA=
111+
github.com/oracle/oci-go-sdk/v65 v65.93.1 h1:lIvy/6aQOUenQI+cxXH1wDBJeXFPO9Du3CaomXeYFaY=
112+
github.com/oracle/oci-go-sdk/v65 v65.93.1/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA=
109113
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
110114
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
111115
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Example Oracle Database Metrics Exporter Configuration file.
2+
# Environment variables of the form ${VAR_NAME} will be expanded.
3+
4+
databases:
5+
## Path on which metrics will be served
6+
# metricsPath: /metrics
7+
## Database connection information for the "default" database.
8+
default:
9+
## Database username
10+
username: ${DB_USERNAME}
11+
## Database password
12+
password: ${DB_PASSWORD}
13+
## Database connection url
14+
url: ${DB_CONNECT_STRING}
15+
16+
## Metrics query timeout for this database, in seconds
17+
queryTimeout: 5
18+
19+
## Rely on Oracle Database External Authentication by network or OS
20+
# externalAuth: false
21+
## Database role
22+
# role: SYSDBA
23+
## Path to Oracle Database wallet, if using wallet
24+
tnsAdmin: ${TNS_ADMIN}
25+
26+
### Connection settings:
27+
### Either the go-sql or Oracle Database connection pool may be used.
28+
### To use the Oracle Database connection pool over the go-sql connection pool,
29+
### set maxIdleConns to zero and configure the pool* settings.
30+
31+
### Connection pooling settings for the go-sql connection pool
32+
## Max open connections for this database using go-sql connection pool
33+
maxOpenConns: 10
34+
## Max idle connections for this database using go-sql connection pool
35+
maxIdleConns: 10
36+
37+
### Connection pooling settings for the Oracle Database connection pool
38+
## Oracle Database connection pool increment.
39+
# poolIncrement: 1
40+
## Oracle Database Connection pool maximum size
41+
# poolMaxConnections: 15
42+
## Oracle Database Connection pool minimum size
43+
# poolMinConnections: 15
44+
45+
metrics:
46+
## How often to scrape metrics. If not provided, metrics will be scraped on request.
47+
# scrapeInterval: 15s
48+
## Path to default metrics file.
49+
default: default-metrics.toml
50+
## Paths to any custom metrics files
51+
# custom:
52+
# - /oracle/observability/txeventq-metrics.toml
53+
54+
log:
55+
# Path of log file
56+
destination: /opt/alert.log
57+
# Interval of log updates
58+
interval: 15s
59+
## Set disable to 1 to disable logging
60+
# disable: 0

kubernetes/metrics-exporter-deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ spec:
1717
spec:
1818
containers:
1919
- name: metrics-exporter
20-
image: container-registry.oracle.com/database/observability-exporter:1.6.1
20+
image: container-registry.oracle.com/database/observability-exporter:2.0.1
2121
imagePullPolicy: Always
22+
command: ["/oracledb_exporter"]
23+
args: ["--config.file=/config/metrics-exporter-config.yaml"]
2224
env:
2325
# uncomment and customize the next item if you want to provide custom metrics definitions
2426
#- name: CUSTOM_METRICS
@@ -41,6 +43,8 @@ spec:
4143
- name: DB_CONNECT_STRING
4244
value: "DEVDB_TP?TNS_ADMIN=$(TNS_ADMIN)"
4345
volumeMounts:
46+
- name: exporter-config
47+
mountPath: /config
4448
- name: tns-admin
4549
mountPath: /oracle/tns_admin
4650
# uncomment and customize the next item if you want to provide custom metrics definitions
@@ -61,6 +65,9 @@ spec:
6165
- name: tns-admin
6266
configMap:
6367
name: db-metrics-tns-admin
68+
- name: exporter-config
69+
configMap:
70+
name: metrics-exporter-config
6471
# uncomment and customize the next item if you want to provide custom metrics definitions
6572
#- name: config-volume
6673
# configMap:

0 commit comments

Comments
 (0)