oracle-db-appdev-monitoring icon indicating copy to clipboard operation
oracle-db-appdev-monitoring copied to clipboard

[FEATURE] Modify or skip hard-coded "database" label

Open wes-pro opened this issue 3 weeks ago • 0 comments

Summary

Exporter uses arbitrary "database" label which causes conflict if query returns column with the same name/alias. I understand this can be easily avoided by changing name of column but:

  1. We try to move from original iamseth oracledb_exporter with a lot of custom queries in which we rather identify database with other labels like "cluster_name", "db_name", "db_unique_name", "instance_name" (only such combination of label is unique in large environment). We use label "database" for other purposes and it worked in old iamseth version without problem. Now we need to change SQL queries and PromQL/dashboards queries to use other label name for our purpose.

  2. Detecting and renaming duplicated labels would be also nice, because now such situation panics exporter: panic: duplicate label names in constant and variable labels for metric... Simple query: "select 1 as value, 'x' as database from dual" will trigger such panic.

In older version we did not use multi-database setup but we added some labels statically in Prometheus configuration. Prometheus itself detects label name conflicts and automatically renames duplicated labels from exporter by adding "exported_" prefix to them. Something like this would be nice to have instead of panic. This does not only apply to "database" label but any conflict between column/alias used in SQL and label names inserted statically in exporter configuration file.

Motivation

To ease migration from old version of oracledb_exporter and keep it compatible.

Proposed Solution

At least add configuration option to not emit "database" label at all or have this name configurable.

Alternatives Considered

Additional Context

Thanks a lot for active development of this exporter. Michal

wes-pro avatar Nov 14 '25 20:11 wes-pro