feat: add service monitors support to prom #66
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1161,7 +1161,6 @@ dependencies = [
|
|||||||
"harmony",
|
"harmony",
|
||||||
"harmony_cli",
|
"harmony_cli",
|
||||||
"harmony_macros",
|
"harmony_macros",
|
||||||
"serde_yaml",
|
|
||||||
"tokio",
|
"tokio",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -9,6 +9,5 @@ license.workspace = true
|
|||||||
harmony = { version = "0.1.0", path = "../../harmony" }
|
harmony = { version = "0.1.0", path = "../../harmony" }
|
||||||
harmony_cli = { version = "0.1.0", path = "../../harmony_cli" }
|
harmony_cli = { version = "0.1.0", path = "../../harmony_cli" }
|
||||||
harmony_macros = { version = "0.1.0", path = "../../harmony_macros" }
|
harmony_macros = { version = "0.1.0", path = "../../harmony_macros" }
|
||||||
serde_yaml.workspace = true
|
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
url.workspace = true
|
url.workspace = true
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use harmony::{
|
use harmony::{
|
||||||
inventory::Inventory,
|
inventory::Inventory,
|
||||||
maestro::Maestro,
|
maestro::Maestro,
|
||||||
@ -56,15 +58,14 @@ async fn main() {
|
|||||||
relabelings: vec![],
|
relabelings: vec![],
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut selector = Mapping::new();
|
let mut selector = HashMap::new();
|
||||||
selector.insert(
|
selector.insert(
|
||||||
Value::from("matchExpressions"),
|
"matchExpressions".to_string(),
|
||||||
serde_yaml::to_value(vec![Selector {
|
vec![Selector {
|
||||||
key: "monitored".to_string(),
|
key: "monitored".to_string(),
|
||||||
operator: "In".to_string(),
|
operator: "In".to_string(),
|
||||||
values: vec!["test-service-1".to_string()],
|
values: vec!["test-service-1".to_string()],
|
||||||
}])
|
}],
|
||||||
.expect("couldn't create mapping value"),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let service_monitor = ServiceMonitor {
|
let service_monitor = ServiceMonitor {
|
||||||
|
|||||||
@ -178,7 +178,7 @@ pub struct ServiceMonitor {
|
|||||||
// values:
|
// values:
|
||||||
// - example-service-1
|
// - example-service-1
|
||||||
// - example-service-2
|
// - example-service-2
|
||||||
pub selector: Mapping,
|
pub selector: HashMap<String, Vec<Selector>>,
|
||||||
|
|
||||||
// # label selector for services
|
// # label selector for services
|
||||||
pub match_labels: Option<Mapping>,
|
pub match_labels: Option<Mapping>,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user