Skip to content

[FEATURE] config "metric.databases= [ ]" => don't use metric on any database #357

@MansuyDavid

Description

@MansuyDavid

Summary

Having the possibility that some metric defined in default-metrics or custom-metrics will not run in any database.
By using "metric.databases=[ ]"

Motivation

I have a automatic deployment of this exporter (with Ansible) with predefined config files.
Because of multiple databases version that can be scrapped i need to execute some queries on some db and others queries on others db.
For example
Request 1 : to execute on oracle 19
Request 2 : to execute on oracle 12

some of my customers have only one version.
so if i can have the same metric config file, with just the "databases" attribute empty for the non needed version, it will be easier to manage it.

Proposed Solution

use the existing metric.databases attribute.
no change : if not defined, metric will be used for all db
no change : if defined "not empty", metric will be used on listed db
change asked : if defined "empty", metric will be used on no db.

Alternatives Considered

This problem is bypassed today by having the whole [[metric]] bloc not written when no db execution is needed.
But this make the ansible template in jinja2 a lot heavier/ugly/difficult to maintain.

Additional Context

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