diff --git a/operator/src/controller.rs b/operator/src/controller.rs index 429dffa..149e7c0 100644 --- a/operator/src/controller.rs +++ b/operator/src/controller.rs @@ -7,7 +7,7 @@ use kube::{ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::{sync::Arc, time::Duration}; -use tracing::error; +use tracing::{error, info}; use crate::{ gateway::{handle_reference_grant, handle_tls_route}, @@ -65,6 +65,8 @@ fn error_policy(crd: Arc, err: &Error, ctx: Arc) -> Ac } pub async fn run(state: Arc) { + info!("listening crds running"); + let client = Client::try_default() .await .expect("failed to create kube client"); diff --git a/operator/src/main.rs b/operator/src/main.rs index b0fefb4..c461332 100644 --- a/operator/src/main.rs +++ b/operator/src/main.rs @@ -4,7 +4,7 @@ use actix_web::{ use dotenv::dotenv; use prometheus::{Encoder, TextEncoder}; use std::{io, sync::Arc}; -use tracing::Level; +use tracing::{info, Level}; use ext_cardano_node::{controller, metrics as metrics_collector, State}; @@ -42,7 +42,8 @@ async fn main() -> io::Result<()> { .service(health) .service(metrics) }) - .bind(addr)?; + .bind(&addr)?; + info!({ addr }, "metrics server running"); tokio::join!(server.run(), controller, metrics_collector).0?; diff --git a/operator/src/metrics.rs b/operator/src/metrics.rs index 2647cff..7d837c3 100644 --- a/operator/src/metrics.rs +++ b/operator/src/metrics.rs @@ -2,6 +2,7 @@ use std::{sync::Arc, time::Duration}; use kube::ResourceExt; use prometheus::{opts, IntCounterVec, Registry}; +use tracing::info; use crate::{CardanoNodePort, Error, State}; @@ -40,6 +41,8 @@ impl Metrics { } pub async fn run_metrics_collector(_state: Arc) { + info!("collecting metrics running"); + tokio::spawn(async { loop { tokio::time::sleep(Duration::from_secs(6)).await;