-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Log level for unsuccessful probes #1401
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
Comments
cc @tjhop |
We would be interested in this as well, getting HTTP status codes for failures on warn/error probe.level. |
There's a related conversation to the log prober logging in #1377, I've asked for some clarification there and would like to make a determination on how to proceed there before attempting to tune leveling further |
Open
tjhop
added a commit
to tjhop/blackbox_exporter
that referenced
this issue
May 8, 2025
Based on discussion in prometheus#1377, slack, etc, it seems unclear what the intended functionality/behavior of the probe scrape logger was supposed to be. This is an attempt to align behavior with current user expectations. The improved defaults and updated configs here should address the log spam as well. User facing changes: - the `--log.prober` flag now sets the _level at which prober scrape logs will be emitted at_. - the `--log.prober` flag now defaults to `debug` level. Because the default log level is info, this means that in order to see probe scrape logs, a user must either: - increase the level of the logger via `--log.level` to be >= that of `--log.prober` (ie, set both to `debug`) - decrease the level of the probe logger via `--log.prober` to be <= that of `--log.level` (ie, set both to `info`) Note: This approach (emitting all logs from the probe logger at the level specified) involves hijacking calls to the logger and overriding the level. This comes with the very obvious side effect that the developers working on code using the probe scrape logger no longer have control over the control over the level of the log that gets emitted. Regardless of whether they use `l.Info()` or `l.Debug()`, it'll still get logged at the configured log prober level. This approach likely would not be compatible with some of the other discussions around how probe scrape logs work, like prometheus#1401. Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
electron0zero
pushed a commit
that referenced
this issue
May 21, 2025
* fix: stop scrape logger spam, refactor scrape logger design Based on discussion in #1377, slack, etc, it seems unclear what the intended functionality/behavior of the probe scrape logger was supposed to be. This is an attempt to align behavior with current user expectations. The improved defaults and updated configs here should address the log spam as well. User facing changes: - the `--log.prober` flag now sets the _level at which prober scrape logs will be emitted at_. - the `--log.prober` flag now defaults to `debug` level. Because the default log level is info, this means that in order to see probe scrape logs, a user must either: - increase the level of the logger via `--log.level` to be >= that of `--log.prober` (ie, set both to `debug`) - decrease the level of the probe logger via `--log.prober` to be <= that of `--log.level` (ie, set both to `info`) Note: This approach (emitting all logs from the probe logger at the level specified) involves hijacking calls to the logger and overriding the level. This comes with the very obvious side effect that the developers working on code using the probe scrape logger no longer have control over the control over the level of the log that gets emitted. Regardless of whether they use `l.Info()` or `l.Debug()`, it'll still get logged at the configured log prober level. This approach likely would not be compatible with some of the other discussions around how probe scrape logs work, like #1401. Signed-off-by: TJ Hoplock <t.hoplock@gmail.com> * docs(README): add section on --log.prober behavior with sample output Address PR feedback Signed-off-by: TJ Hoplock <t.hoplock@gmail.com> --------- Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We have update to v.0.26 and now observing the situation with probe logs. And these observations show some logic we are not sure about.
If we are probing some target that the exporter can not resolve - we get an ERROR level log, e.g.
Ok. And now we probing some existing target, but get not expected status code and probe is failing. But exporter logging the reason for the failed probe with INFO level, e.g.
So we can not start the exporter with --probe.level=warn to get only failed probes, and we have to start it with --probe.level=info which produces millions of logs for successful probes.
So the question is if the reason of probe failing could be logged with ERROR/WARN level?
The text was updated successfully, but these errors were encountered: