- job_name: 'statsd'
scrape_interval: 10s
scrape_timeout: 10s
honor_labels: true
static_configs:
- targets: ['x.y.z.w:9102']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '^consul_.*' ---- drop all metrics that begin with consul_
action: drop
- source_labels: [ __name__ ]
regex: '.*_dns_domain_query_.*' ---- except keep metric consul_dns_domain_query_.*
action: keep
Is it possible to drop all metrics from a scrape and keep only a handful
- job_name: 'statsd'
scrape_interval: 10s
scrape_timeout: 10s
honor_labels: true
static_configs:
- targets: ['x.y.z.w:9102']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '^consul_.*' ---- drop all metrics that begin with consul_
action: drop
- source_labels: [ __name__ ]
regex: '.*_dns_domain_query_.*' ---- except keep metric consul_dns_domain_query_.*
action: keep
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 29 September 2016 at 01:52, <meher...@gmail.com> wrote:Is it possible to drop all metrics from a scrape and keep only a handfulYes, though be aware that relabel configs execute in order and drop/keep halt processing if they do/don't match so you probably want those two the other way around.Why do you have consul metrics coming via statsd rather than via the consul_exporter?Brian
- job_name: 'statsd'
scrape_interval: 10s
scrape_timeout: 10s
honor_labels: true
static_configs:
- targets: ['x.y.z.w:9102']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '^consul_.*' ---- drop all metrics that begin with consul_
action: drop
- source_labels: [ __name__ ]
regex: '.*_dns_domain_query_.*' ---- except keep metric consul_dns_domain_query_.*
action: keep
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Brian Brazil
Hey guys,
I am trying to drop all metrics and only keep ALERTS. Do you guys see anything wrong in config below?
write_relabel_configs:
- source_labels: [__name__]
separator: ;
regex: .*ALERTS.*
replacement: $1
action: keep
- source_labels: [__name__]
separator: ;
regex: (.*)
replacement: $1
action: drop
Thanks
Thanks
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/b0d0f416-afc6-4c08-bdbb-2063527a6c78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.