Compare commits

..

4 Commits

Author SHA1 Message Date
deployer3000 8a80cc6844 Merge pull request 'rc' (#22) from rc into master 2025-04-04 16:56:29 +03:00
YurijO dc50f4e614 Merge pull request 'feature/statuszero' (#21) from feature/statuszero into rc
test-org/integration-module/pipeline/pr-master Build succeeded
Reviewed-on: http://192.168.2.61/deployer3000/integration-module/pulls/21
2025-04-04 16:49:29 +03:00
prplV dfeb0dbfa9 status model supprt
test-org/integration-module/pipeline/pr-rc This commit looks good Details
2025-04-04 09:18:43 -04:00
prplV ff68178e42 +zero status 2025-04-04 09:01:25 -04:00
4 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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<usize> {
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?;

View File

@ -405,7 +405,8 @@ impl MonitoringImporter {
},
addr : "enode.monitoring.api".to_owned(),
desc : description,
value : val.clone()
value : val.clone(),
status: 0,
})
}
}

View File

@ -271,6 +271,7 @@ pub mod v3 {
pub value : Value,
#[serde(rename = "description")]
pub desc : String,
pub status: usize,
}
impl MetricOutputExtended {
pub fn new_with_slices(id : &str, json_type : &str, addr: &str, desc : &str, value : Value) -> Self {
@ -280,6 +281,7 @@ pub mod v3 {
addr : addr.to_string(),
value : value,
desc : desc.to_string(),
status: 0,
}
}
}