fix: deploys a lighter weight prometheus and grafana which is limited to their respective namespaces

This commit is contained in:
2025-07-04 16:13:41 -04:00
parent b73f2e76d0
commit f702ecd8c9
20 changed files with 506 additions and 38 deletions

View File

@@ -4,11 +4,11 @@ use serde_yaml::{Mapping, Value};
use crate::{
interpret::{InterpretError, Outcome},
modules::monitoring::kube_prometheus::{
prometheus::{Prometheus, PrometheusReceiver},
modules::monitoring::{kube_prometheus::{
prometheus::{KubePrometheus, KubePrometheusReceiver},
types::{AlertChannelConfig, AlertManagerChannelConfig},
},
topology::{Url, oberservability::monitoring::AlertReceiver},
}, prometheus::prometheus::{Prometheus, PrometheusReceiver}},
topology::{oberservability::monitoring::AlertReceiver, Url},
};
#[derive(Debug, Clone, Serialize)]
@@ -36,6 +36,25 @@ impl PrometheusReceiver for WebhookReceiver {
self.get_config().await
}
}
#[async_trait]
impl AlertReceiver<KubePrometheus> for WebhookReceiver {
async fn install(&self, sender: &KubePrometheus) -> Result<Outcome, InterpretError> {
sender.install_receiver(self).await
}
fn clone_box(&self) -> Box<dyn AlertReceiver<KubePrometheus>> {
Box::new(self.clone())
}
}
#[async_trait]
impl KubePrometheusReceiver for WebhookReceiver {
fn name(&self) -> String {
self.name.clone()
}
async fn configure_receiver(&self) -> AlertManagerChannelConfig {
self.get_config().await
}
}
#[async_trait]
impl AlertChannelConfig for WebhookReceiver {