Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@wes-pro

Description

@wes-pro

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions