Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow restricting exporter scope to specific instances #94

Open
mindw opened this issue Dec 20, 2023 · 4 comments
Open

Allow restricting exporter scope to specific instances #94

mindw opened this issue Dec 20, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@mindw
Copy link

mindw commented Dec 20, 2023

Is your feature request related to a problem? Please describe.

I'm looking for exporting the output of describe-db-instances to prometheus. This promising project seems to fit the bill - except it returns metrics for all RDS instances within region. At least I could not an example on how to do it.

Describe the solution you'd like

Add an option to restrict exporter to an RDS instance(s) by - id, regex, tag (key/*, key/val, key/regex)

Describe alternatives you've considered

Use the archived https://github.com/movio/aws-prometheus-exporter exporter to expose describe-db-instances output.

Thanks!

@mindw mindw added the enhancement New feature or request label Dec 20, 2023
@vmercierfr
Copy link
Collaborator

Thanks for reporting this issue. In our initial use case, we needed to collect metrics from all RDS instances, but it makes sense to support instance filtering. We need to think about the way to implement it.

Can you provide more details on your ideal instance filters (e.g., on which RDS instance parameters you would like to filter)? If you can provide a concrete use case, it will help us a lot to design the feature.


Meanwhile, I see two possible workarounds:

  • Use the rds_instance_tags metric (introduced in v0.5.0 for a similar issue Add RDS tags #37) to filter Prometheus results, but metrics are still collected and stored in your Prometheus

  • Use metric_relabel_configs Prometheus parameter to drop useless metrics, but metrics are still fetched from AWS APIs

    scrape_configs:
      - job_name: 'rds-exporter'
        static_configs:
          - targets: ['rds-exporter:9043']
        metric_relabel_configs:
          - source_labels: [job, dbidentifier]
            separator: "@"
            regex: "rds-exporter@db[0-9]+" # Exclude all metrics collected by "rds-exporter" job that match "db[0-9]+" regexp
            action: drop

@vmercierfr vmercierfr self-assigned this Dec 21, 2023
@mindw
Copy link
Author

mindw commented Dec 21, 2023

@vmercierfr thanks you for looking into this and the prompt reply!

For my use case filtering on a specific identifier is sufficient. Something like a db-instance key in the config accepting a single value.

The rest of the options I've picked up from CloudWatch exporter filters.

@vmercierfr
Copy link
Collaborator

I guess jstewart612 is also interested by this feature.

@pudovd
Copy link

pudovd commented Jul 20, 2024

In my case, I have instances for several environments (Environment tag) in one AWS region.
So, it would be great if filtering allowed the use AWS tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants