Selective scrape via query parameters
@ringerc is already working on this.
Since Jun 29, 2024.
- Dominant language
- Go
- Stars
- 363
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
I'm looking at adopting pg_exporter as a potential replacement for the CloudNative-PG built-in scraper I currently use.
CNPG doesn't support this either, but I was considering implementing it for CNPG and wonder if I should do so for pg_exporter instead.
Do you have any advice on how I might go about adding support for scraping selected subsets of metrics, specified by tag-set, with query parameters?
I want to scrape different subsets at different frequencies without having to deploy multiple instances of the scraper. This can't be done with command-line or env-var level tags.
E.g. I want to scrape /metrics?tags=expensive_metrics,wide_cardinality_metrics every 5min, and /metrics?cheap_narrow_metrics every 30s.
The scraper's caching feature makes this a less pressing need than it is in other scrapers, but since it already has tagging I'm wondering if it might be fairly easy to add. I can't immediately see how to access the query params from/within promhttp in order to apply them selectively though. Do you know if this might be possible, and have any ideas about how? If so, I can see if I can cook up a patch if my initial PoC with this scraper works out.
(See related https://github.com/Vonng/pg_exporter/issues/41, #43 )
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.