-
Notifications
You must be signed in to change notification settings - Fork 769
Error opening config file "postgres_exporter.yml" #779
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
Same issue here, try to use v0.11.1 |
These should be warnings. The collector can now be used as a direct exporter configured to scrape metrics from a single node as well as using the multi-target support through the |
docker exec <container> /bin/postgres_exporter --help
|
This warning is still happening in version 0.15. The binary seems to successfully load the configuration file using the following:
Yet it's still showing the warning/error. It's like it's trying a default path or similar: |
The warning is not for the web.config.file arg. It's for the |
The warning also shows up in 0.16.0 and it's rather misleading. I'm not using any configuration file, I'm just using the environmental variables to connect to postgresql and that's it. I expect it to show up only if I explicitly set the |
Admittedly, it reads config file, not web config file. But I agree that it may be misleading, especially for the newcomer. |
Recommends to always set config-file |
That's not really the issue now, is it? I don't think anyone here wouldn't have known how to use a configuration file. The point is, if the application really needs one, it should simply not start, and if it doesn't, it should just not work. Half-baked solutions are not really what people look for. |
I think there are some good points here. I also think it's not as black and white as it appears on the surface. This exporter can be used as a single target exporter like most exporters where you know the system you are going to query up front. In this mode, currently there is no config file necessary although that could change in the future. In that scenario, we can just quietly ignore anything for the config file. The other way that this exporter can be used is via the multi-target support. This is where you query the For multi-target support, the config file is relevant, but not strictly necessary. We could potentially remove the default which would allow the code to know if it was set by the user or not. I'm not sure that the config file is strictly necessary for multi-target support so that option could work, although I think the config file is strongly advised. The log line has been downgraded to a warning, which I think feels appropriate in this case. |
this fix the problem level=WARN source=main.go:85 msg="Error loading config" err="Error parsing config file "/etc/postgres_exporter/postgres_exporter.yml": EOF" |
According to the readme, this is the config that can be set via
--config.file
. However, there is no mention ofconfig.file
in Flags or Environment Variables.If this is a problem, I would expect the application to exit. If it's not, as it seems, I would expect this to either be logged as
warn
or not logged at all.The text was updated successfully, but these errors were encountered: