-
Notifications
You must be signed in to change notification settings - Fork 769
Enable waiting for postgresql instance #856
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
I'm experiencing exactly the same problem now. |
same issue here. Had to manually kill 1 |
Same issue here relying on an extraContainers running Looking at the My assumption is that the Manually kill 1 solve the issue |
This should be resolved by #882. We have changed the logic to connect to the database during metrics collection. This means that each scrape is a new attempt to connect to the database. Of note, #902 fixes a connection leak that #882 introduced. If this doesn't solve your use case, feel free to re-open with a description of the use case so we can discuss. Hope this helps! |
Proposal
Use case
Zalando's postgres-operator supports configuring sidecar containers, e.g.
postgres_exporter
, to enable observability. After the instantiation of aPostgresql
resource, the operator injects the sidecar into the Pod spec, both containers start simultaneously.When looking into the metrics endpoint provided by the exporter (
http://localhost:9187/metrics
), we've seen, that (in some cases) metrics are missing: In our setup thepg_stat_database_xact_commit
was affected (along with many otherpg_stat_database_*
metrics).After playing around and trying to narrow down the root case we've seen, that a simple restart of the exporter (by issuing)
in the sidecar container's shell fixed the problem. All metrics are now visible.
This leads to the assumption, that the exporter has started sometime in between the postgres instance was in the start up process and could not prepare/return all metrics.
We'd appreciate a feature by which it is possible to enforce the start of the
postgres_exporter
only, until the postgres instance is ready. Most likely this could be provided by setting an environment variableDATA_SOURCE_WAIT_UNTIL_READY
and, additionally, configuring a timeout flag, if the database won't come up in time:DATA_SOURCE_WAIT_UNTIL_READY_TIMEOUT
.Thanks for comments/help/criticism :)
Cheers!
The text was updated successfully, but these errors were encountered: