"Instance" returned by query data hiding

22 views
Skip to first unread message

li yun

unread,
May 11, 2020, 5:47:18 AM5/11/20
to Prometheus Users
My instances are all public IP addresses. I hope that the instance returned when querying data is a hidden or disguised instance. Is there any way to do it?
For example, the following return:
{"status": "success", "data": {"resultType": "matrix", "result": [{"metric": {"server": "beijing", "direction": "price", " exchange ":" beijing "," instance ":" 127.0.0.1:20942","job":"20942 "}

I hope to become:
{"status": "success", "data": {"resultType": "matrix", "result": [{"metric": {"server": "beijing", "direction": "price", " exchange ":" beijing "," instance ":" hidden "," job ":" 20942 "}

Stuart Clark

unread,
May 11, 2020, 6:59:24 AM5/11/20
to li yun, Prometheus Users
You can adjust your metrics during scraping using relabling rules,
however you do still need some unique instance type label to allow it to
work (so you couldn't just drop the instance label).

Depending on the service discovery method you are using, you could use a
hostname or tag instead of the IP address?

--
Stuart Clark

li yun

unread,
May 12, 2020, 12:15:25 AM5/12/20
to Prometheus Users
My data has been kept for 1 year, and the data is very valuable. I used IP addresses when I crawled before this, so now every query returns an IP address, and I want to hide these returned IP addresses. I now change to the host name, but the historical data will still appear IP address

在 2020年5月11日星期一 UTC+8下午6:59:24,Stuart Clark写道:
Reply all
Reply to author
Forward
0 new messages