Looks OK to me, if your instance labels are of the form name:port. It should take effect pretty much instantaneously.
You could add -v to the the curl command line, to see the response code (204 / 400 etc) Of course, the metrics will reappear if you are still scraping them, which might be because: - you've changed prometheus.yml without sending a HUP signal to reload the config - you've changed prometheus.yml, you've sent a HUP signal, but the new config has a syntax error (in which case prometheus will keep running with the old config) Check with: journalctl -eu prometheus On Sunday, 11 December 2022 at 17:10:43 UTC [email protected] wrote: > curl -X POST -g ' > http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={instance= > "instance:port"}' > > Is the above query correct? If so, I am able to see those instances' > values that were removed from the prometheus.yml file. Will it take time to > reflect on those changes? > > On Monday, 5 December 2022 at 12:56:14 UTC+5:30 Brian Candler wrote: > >> You're not cleaning tombstones, you're deleting timeseries. This means >> that the endpoint needs to be >> /api/v1/admin/tsdb/delete_series?match[]={instance="foo"} >> just like the page I linked you to says. >> >> On Monday, 5 December 2022 at 04:40:42 UTC [email protected] wrote: >> >>> I enabled this flag (--web.enable-admin-api) and executed this command >>> curl -XPOST http://localhost:9090/api/v1/admin/tsdb/clean_tombstones >>> >>> Still, I am able to see the deleted instances while executing the >>> prometheus query. >>> >>> On Sunday, 4 December 2022 at 23:26:45 UTC+5:30 Brian Candler wrote: >>> >>>> Use Google. Enter "prometheus delete timeseries", and you will find: >>>> >>>> https://www.robustperception.io/deleting-time-series-from-prometheus/ >>>> >>>> This gives the exact command. >>>> >>>> On Sunday, 4 December 2022 at 17:20:28 UTC [email protected] >>>> wrote: >>>> >>>>> could you please help me with the exact command? >>>>> >>>>> On Sunday, 4 December 2022 at 22:18:28 UTC+5:30 >>>>> [email protected] wrote: >>>>> >>>>>> The default retention is set to 15d iirc, so once that ages out it >>>>>> wil disappear. You can also use promtool to manually delete out data if >>>>>> you >>>>>> really wish. >>>>>> >>>>>> >>>>>> >>>>>> *From: *[email protected] <[email protected]> >>>>>> on behalf of BHARATH KUMAR <[email protected]> >>>>>> *Date: *Sunday, December 4, 2022 at 11:00 AM >>>>>> *To: *Prometheus Users <[email protected]> >>>>>> *Subject: *[prometheus-users] How to delete the historical data >>>>>> >>>>>> Hello All, >>>>>> >>>>>> >>>>>> >>>>>> I installed node exporter in multiple instances. Now I deleted one of >>>>>> those instance(this is unreachable instance) from prometheus.yml file. >>>>>> When >>>>>> I am trying to query up == 0, still I am able to see this instance in >>>>>> the >>>>>> database. >>>>>> >>>>>> >>>>>> >>>>>> How to delete that particular instance in database? Any help? >>>>>> >>>>>> >>>>>> >>>>>> Thanks in advance. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Thanks & regards, >>>>>> >>>>>> Bharath Kumar >>>>>> >>>>>> -- >>>>>> >>>>>> 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 [email protected]. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/prometheus-users/58e88b61-58be-441c-9fa8-a89a534d180dn%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/prometheus-users/58e88b61-58be-441c-9fa8-a89a534d180dn%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3fdf7b91-c016-43f4-a0af-bb596263e125n%40googlegroups.com.

