Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted scrape target is always recreated #4755

Closed
piotrkochan opened this Issue Oct 18, 2018 · 11 comments

Comments

Projects
None yet
4 participants
@piotrkochan
Copy link

piotrkochan commented Oct 18, 2018

Use case. Why is this important?

There is no really a way to stop prometheus from scraping previously defined target.

Bug Report

What did you do?

  1. I removed scrape config from prometheus.yml
  2. I ran:
curl -I -X POST -g 'localhost:9090/prometheus/api/v1/admin/tsdb/delete_series?match[]=up{instance="localhost:9100"}'
curl -I -X POST -g 'localhost:9090/prometheus/api/v1/admin/tsdb/clean_tombstones'

What did you expect to see?
I expect that if there is no config for this target and data then prometheus forget about that target, and do not try to scrape it in the future.

What did you see instead? Under which circumstances?

Prometheus still try to scrape this target. Even in the UI it is still visible:
sdf

Environment

  • System information:

    Linux 4.4.0-130-generic x86_64

  • Prometheus version:

prometheus, version 2.3.0 (branch: HEAD, revision: 290d71791a507a5057b9a099c9d48703d86dc941)
build user:       root@d539e167976a
build date:       20180607-08:46:54
go version:       go1.10.2
  • Prometheus configuration file:

Just regular configuration without previously defined scrape_config entry.

@piotrkochan piotrkochan changed the title There is no way to delete scraper. Deleted scrape target is always recreated. Oct 18, 2018

@piotrkochan piotrkochan changed the title Deleted scrape target is always recreated. Deleted scrape target is always recreated Oct 18, 2018

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Oct 18, 2018

You need to reload the configuration using kill -SIGHUP <pid> for instance.

I'm closing it for now. If you have further questions, please use our user mailing list, which you can also search.

@piotrkochan

This comment has been minimized.

Copy link
Author

piotrkochan commented Oct 18, 2018

@simonpasquier please reopen, because kill -SIGHUP does not work, as full prometheus restart.

@piotrkochan

This comment has been minimized.

Copy link
Author

piotrkochan commented Oct 18, 2018

On the mailing list there is same issue and it is no resolved so I assume it is a bug.

https://groups.google.com/forum/#!searchin/prometheus-users/sighup%7Csort:date/prometheus-users/K4Q1ToxhwYw/EBNRvLKPBgAJ

@piotrkochan

This comment has been minimized.

Copy link
Author

piotrkochan commented Oct 18, 2018

curl -I -X POST -g 'localhost:9090/prometheus/-/reload'
HTTP/1.1 200 OK

does not have any effect as well.

@piotrkochan

This comment has been minimized.

Copy link
Author

piotrkochan commented Oct 18, 2018

I also tried to delete no only "up" but everything labeled:

curl -I -X POST -g 'localhost:9090/prometheus/api/v1/admin/tsdb/delete_series?match[]={instance="localhost:9100"}'

then reload, restart, service is still present...

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Oct 18, 2018

kill -SIGHUP ... works for me and I would be surprised if it was broken for everybody. Double check that you don't have a mismatch between the file used by Prometheus and the file you're modifying.

@marksugar

This comment has been minimized.

Copy link

marksugar commented Dec 26, 2018

Hello @piotrkochan , I don't know if you have solved this problem, because now I have encountered this problem and have not solved it.
If you have already solved it, can you tell me. In my environment prometheus runs in docker, curl -I -X POST -g 'localhost:9090/prometheus/-/reload' does not work

@piotrkochan

This comment has been minimized.

Copy link
Author

piotrkochan commented Dec 26, 2018

@marksugar

This comment has been minimized.

Copy link

marksugar commented Dec 26, 2018

@piotrkochan So how do you now handle alarm messages sent by hosts that no longer exist?
Best Regards

@piotrkochan

This comment has been minimized.

Copy link
Author

piotrkochan commented Dec 26, 2018

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Dec 26, 2018

@piotrkochan

restart, service is still present...

If a full Prometheus restart does not remove the target, then it's certain that Prometheus is loading the wrong configuration file. Prometheus does not store a list of targets on disk by itself, so it would have no other source from which to re-create this target after restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.