-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat(launchpad): read stats from metrics endpoint #1821
Conversation
eq(ServiceInstallCtx { | ||
args: vec![ | ||
OsString::from("--rpc"), | ||
OsString::from("127.0.0.1:8081"), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note test
@@ -19,8 +19,8 @@ | |||
const METRICS_CONTENT_TYPE: &str = "application/openmetrics-text;charset=utf-8;version=1.0.0"; | |||
|
|||
pub(crate) fn run_metrics_server(registry: Registry, port: u16) { | |||
// The server should not bind to localhost/127.0.0.1 as it will not accept connections from containers. | |||
let addr = ([0, 0, 0, 0], port).into(); | |||
// todo: containers don't work with localhost. |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
async fn fetch_stat_per_node(metrics_port: u16, _data_dir: PathBuf) -> Result<NodeStats> { | ||
let now = Instant::now(); | ||
|
||
let body = reqwest::get(&format!("http://localhost:{metrics_port}/metrics")) |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
It's not clear to me if this alone will result in us not having metrics on new testnets. If that's the case I don't want this in until we can have that (via checkbox or what have you at deploy time... default to yes in the workflow trigger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
safenode manager add
localhost
instead of0.0.0.0
for security.wallet_balance
via the metrics endpoint, but it will get to 0 if the reward has been forwarded. So we need to instead track the forwarded rewards separately.forwarded_balance
across restarts, we need to cache is locally. Else, people would see a value of 0 after a restart.