diff --git a/.env.example b/.env.example index bbf58ee..f17f574 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,10 @@ DB_DBNAME = "db_name"1 # Prometheus-Exporter info EXPORTER_URL = "http(s)://ip.ip.ip.ip:port" +# Status Model API support +# > if exists, ignore `EXPORTER_URL` var +STATUS_SYSTEM_URL = "http://192.168.2.39:9999/api/input" + # eNODE.Monitoring configuration ENODE_MONITORING_IP = "ip.ip.ip.ip" ENODE_MONITORING_LOGIN = "admin_user_enode_monitoring" # admin user is required diff --git a/crates/api-grub/src/export.rs b/crates/api-grub/src/export.rs index 6404314..1f53957 100644 --- a/crates/api-grub/src/export.rs +++ b/crates/api-grub/src/export.rs @@ -114,12 +114,13 @@ impl Exporter { /// Exports metrics in `PrometheusMetricsExtended` format to Exporter defined /// as env var $EXORPTER_URL pub async fn export_extended_metrics(metrics: PrometheusMetricsExtended) -> Result { - let url = env::var("EXPORTER_URL")?; + // let url = env::var("EXPORTER_URL")?; + let url = env::var("STATUS_SYSTEM_URL").unwrap_or(env::var("EXPORTER_URL")?); debug!("Exporting: {:?}", &metrics); let req = Client::new() - .post(url) + .post(&url) .json(&metrics) .send().await; req?;