Compare commits
No commits in common. "8a80cc68442212bff43005f266124a6e73cfca83" and "5344242ce88478e1613b62bca0e31ebe53407618" have entirely different histories.
8a80cc6844
...
5344242ce8
|
|
@ -9,10 +9,6 @@ DB_DBNAME = "db_name"1
|
||||||
# Prometheus-Exporter info
|
# Prometheus-Exporter info
|
||||||
EXPORTER_URL = "http(s)://ip.ip.ip.ip:port"
|
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 configuration
|
||||||
ENODE_MONITORING_IP = "ip.ip.ip.ip"
|
ENODE_MONITORING_IP = "ip.ip.ip.ip"
|
||||||
ENODE_MONITORING_LOGIN = "admin_user_enode_monitoring" # admin user is required
|
ENODE_MONITORING_LOGIN = "admin_user_enode_monitoring" # admin user is required
|
||||||
|
|
|
||||||
|
|
@ -114,13 +114,12 @@ impl Exporter {
|
||||||
/// Exports metrics in `PrometheusMetricsExtended` format to Exporter defined
|
/// Exports metrics in `PrometheusMetricsExtended` format to Exporter defined
|
||||||
/// as env var $EXORPTER_URL
|
/// as env var $EXORPTER_URL
|
||||||
pub async fn export_extended_metrics(metrics: PrometheusMetricsExtended) -> Result<usize> {
|
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);
|
debug!("Exporting: {:?}", &metrics);
|
||||||
|
|
||||||
let req = Client::new()
|
let req = Client::new()
|
||||||
.post(&url)
|
.post(url)
|
||||||
.json(&metrics)
|
.json(&metrics)
|
||||||
.send().await;
|
.send().await;
|
||||||
req?;
|
req?;
|
||||||
|
|
|
||||||
|
|
@ -405,8 +405,7 @@ impl MonitoringImporter {
|
||||||
},
|
},
|
||||||
addr : "enode.monitoring.api".to_owned(),
|
addr : "enode.monitoring.api".to_owned(),
|
||||||
desc : description,
|
desc : description,
|
||||||
value : val.clone(),
|
value : val.clone()
|
||||||
status: 0,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,6 @@ pub mod v3 {
|
||||||
pub value : Value,
|
pub value : Value,
|
||||||
#[serde(rename = "description")]
|
#[serde(rename = "description")]
|
||||||
pub desc : String,
|
pub desc : String,
|
||||||
pub status: usize,
|
|
||||||
}
|
}
|
||||||
impl MetricOutputExtended {
|
impl MetricOutputExtended {
|
||||||
pub fn new_with_slices(id : &str, json_type : &str, addr: &str, desc : &str, value : Value) -> Self {
|
pub fn new_with_slices(id : &str, json_type : &str, addr: &str, desc : &str, value : Value) -> Self {
|
||||||
|
|
@ -281,7 +280,6 @@ pub mod v3 {
|
||||||
addr : addr.to_string(),
|
addr : addr.to_string(),
|
||||||
value : value,
|
value : value,
|
||||||
desc : desc.to_string(),
|
desc : desc.to_string(),
|
||||||
status: 0,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue