feat: add service monitors support to prom #66
@ -1,3 +1,4 @@
|
|||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use harmony::{
|
use harmony::{
|
||||||
inventory::Inventory,
|
inventory::Inventory,
|
||||||
@ -63,7 +64,7 @@ async fn main() {
|
|||||||
target_labels: vec![],
|
target_labels: vec![],
|
||||||
pod_target_labels: vec![],
|
pod_target_labels: vec![],
|
||||||
selector: Selector {
|
selector: Selector {
|
||||||
match_labels: None,
|
match_labels: HashMap::new(),
|
||||||
match_expressions: vec![MatchExpression {
|
match_expressions: vec![MatchExpression {
|
||||||
key: "test".to_string(),
|
key: "test".to_string(),
|
||||||
operator: "In".to_string(),
|
operator: "In".to_string(),
|
||||||
|
|||||||
@ -154,7 +154,7 @@ pub struct MatchExpression {
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Selector {
|
pub struct Selector {
|
||||||
// # label selector for services
|
// # label selector for services
|
||||||
pub match_labels: Option<HashMap<String, String>>,
|
pub match_labels: HashMap<String, String>,
|
||||||
pub match_expressions: Vec<MatchExpression>,
|
pub match_expressions: Vec<MatchExpression>,
|
||||||
|
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user
I think we already do have a Label type somewhere. I think it would be more appropriate here than String. That's true for all the label related fields in this file.
This Label type might not be fully compatible in its current form/place but it is definitely a semantic that we will see very often in various use cases and implementations. I think it is worth for us to maintain a Label type which we can eventually provide very interesting functionnality for such as search, tracking, matching, versionning, etc.