Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDebug logs for failed scrapes #2820
Comments
This comment has been minimized.
This comment has been minimized.
|
Scrape failures is roughly speaking request logging, it doesn't belong in application logs and could get extremely spammy (potentially hundreds of lines per second). Debug would be the appropriate log level. |
This comment has been minimized.
This comment has been minimized.
|
For context: On my cluster the sweep messages are pretty spamming (every 10-15 seconds) which lead me to suggest info log level. |
This comment has been minimized.
This comment has been minimized.
|
I agree that debug would be appropriate level here, as it's not a concern of the health of the Prometheus server itself and can indeed get very noisy in larger Prometheus servers. You can't just put additional error labels on |
brian-brazil
changed the title
Log failed scrapes
Debug logs for failed scrapes
Jul 14, 2017
brian-brazil
added
low hanging fruit
priority/P3
kind/enhancement
labels
Jul 14, 2017
brian-brazil
referenced this issue
Jul 14, 2017
Closed
Add more counters for scrapes: attempts, success, errors and timeouts #2317
brian-brazil
added
help wanted
and removed
help wanted
labels
Jul 17, 2017
This comment has been minimized.
This comment has been minimized.
|
For those looking to take this up, the relevant code path is here: https://github.com/prometheus/prometheus/blob/master/retrieval/scrape.go#L303 You could check each instance where an error is being produced and log accordingly. |
This comment has been minimized.
This comment has been minimized.
|
This change should probably be made in the dev-2.0 branch, as this code path has changed considerably. https://github.com/prometheus/prometheus/blob/dev-2.0/retrieval/scrape.go#L388 |
This comment has been minimized.
This comment has been minimized.
|
AFAICT we don't have access to the logger from the Am I missing anything? |
krasi-georgiev
referenced this issue
Sep 4, 2017
Merged
scraping errors will show in the log when debug mode is enabled #3135
brian-brazil
closed this
Sep 5, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
discordianfish commentedJun 8, 2017
Hi,
I need to debug intermediate scrape failures and realize there is no way to differentiate between various reasons for a scrape failure after the fact. I can make an educated guess whether a scrape timed out or failed otherwise by using
scrape_duration_secondsbut I can't differentiate between DNS issues, connection refused, resetted connections, EOF and so on.Therefor I propose we log scrape failures. I'd propose at info level severity. I consider a scrape failure important enough to not have to enable debug logging, especially given that info is already quite talky with the maintenance sweep messages.
Alternatively, which would work for me as much, we could try to come up with a timeseries or additional labels for
up, but I think people would prefer logging.