mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 15:02:56 +00:00
Currently, the exporter exposes the same LFC metrics that are exposed by the "autoscaling" sql_exporter in the docker image. With this, we can remove the dedicated sql_exporter instance. (Actually doing the removal is left as a TODO until this is rolled out to production and we have changed autoscaling-agent to fetch the metrics from this new endpoint.) The exporter runs as a Postgres background worker process. This is extracted from the Rust communicator rewrite project, which will use the same worker process for much more, to handle the communications with the pageservers. For now, though, it merely handles the metrics requests. In the future, we will add more metrics, and perhaps even APIs to control the running Postgres instance. The exporter listens on a Unix Domain socket within the Postgres data directory. A Unix Domain socket is a bit unconventional, but it has some advantages: - Permissions are taken care of. Only processes that can access the data directory, and therefore already have full access to the running Postgres instance, can connect to it. - No need to allocate and manage a new port number for the listener It has some downsides too: it's not immediately accessible from the outside world, and the functions to work with Unix Domain sockets are more low-level than TCP sockets (see the symlink hack in `postgres_metrics_client.rs`, for example). To expose the metrics from the local Unix Domain Socket to the autoscaling agent, introduce a new '/autoscaling_metrics' endpoint in the compute_ctl's HTTP server. Currently it merely forwards the request to the Postgres instance, but we could add rate limiting and access control there in the future. --------- Co-authored-by: Conrad Ludgate <conrad@neon.tech>
34 lines
690 B
Rust
34 lines
690 B
Rust
//! Various tools and helpers to handle cluster / compute node (Postgres)
|
|
//! configuration.
|
|
#![deny(unsafe_code)]
|
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
|
|
|
pub mod checker;
|
|
pub mod communicator_socket_client;
|
|
pub mod config;
|
|
pub mod configurator;
|
|
pub mod http;
|
|
#[macro_use]
|
|
pub mod logger;
|
|
pub mod catalog;
|
|
pub mod compute;
|
|
pub mod compute_prewarm;
|
|
pub mod compute_promote;
|
|
pub mod disk_quota;
|
|
pub mod extension_server;
|
|
pub mod installed_extensions;
|
|
pub mod local_proxy;
|
|
pub mod lsn_lease;
|
|
pub mod metrics;
|
|
mod migration;
|
|
pub mod monitor;
|
|
pub mod params;
|
|
pub mod pg_helpers;
|
|
pub mod pgbouncer;
|
|
pub mod rsyslog;
|
|
pub mod spec;
|
|
mod spec_apply;
|
|
pub mod swap;
|
|
pub mod sync_sk;
|
|
pub mod tls;
|