Send selected metrics with write option

81 views
Skip to first unread message

Mohan Nagandlla

unread,
May 20, 2021, 6:43:23 AM5/20/21
to Prometheus Users
Hi team 
I am sending all the metrics to the influxdb by using remote write option.  So I just want to sent a specified metrics only how can do that.

Laurent C.

unread,
May 21, 2021, 12:22:36 PM5/21/21
to Prometheus Users
Hi,

In section "remote_write:", where you most likely configure your influxdb setup, you can add some "write_relabel_configs:".
For example, this would send only all metrics with "prefix:"
write_relabel_configs:
    - source_labels: ['__name__']
      regex: (prefix:.*)
      action: keep

So, you keep or drop based on labels. You may combine with recording rules:
  1. define recording rules with some known prefix, and use those rules to perform aggregations
  2. define write_relabel_configs as above to send only metrics with "prefix:" so only the aggregated metrics

Mohan Nagandlla

unread,
May 24, 2021, 10:03:40 PM5/24/21
to l...@4ur3ntc.xyz, Prometheus Users
Thank you ☺️

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/860cac0e-6829-4487-84c6-60e16c5edd02n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages