fluent / fluent/fluent-bit

Support advanced setting for the Prometheus Scrape Metrics input

Open
#7,839 9 comments 0 reactions 0 assignees View on GitHub
enhancement feature-request
Dominant language
C
Stars
8.1k
Forks
2k
Avg merge
4d 20h
Merged PRs (30d)
71

Description

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

Drop or keep specific metrics when scraping Prometheus metrics to avoid collecting unused data.

**Describe the solution you'd like**

Drop or keep specific metrics when scraping Prometheus metrics to avoid collecting unused data.

**Describe alternatives you've considered**

Add similar configurations like [OpenTelemetry Prometheus Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver):
```yaml
receivers:
prometheus:
config:
scrape_configs:
- job_name: k8s
......
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
regex: "true"
action: keep
metric_relabel_configs:
- source_labels: [__name__]
regex: "(request_duration_seconds.*|response_duration_seconds.*)"
action: keep
```
Maybe by adding an additional field like `metric_relabel_configs`?

**Additional context**

https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver
https://opentelemetry.io/docs/collector/configuration/#receivers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.