feat/monitoring-application-feature #83
| @ -4,7 +4,8 @@ use harmony::{ | |||||||
|     inventory::Inventory, |     inventory::Inventory, | ||||||
|     maestro::Maestro, |     maestro::Maestro, | ||||||
|     modules::application::{ |     modules::application::{ | ||||||
|         features::{ContinuousDelivery, Monitoring}, ApplicationScore, RustWebFramework, RustWebapp |         ApplicationScore, RustWebFramework, RustWebapp, | ||||||
|  |         features::{ContinuousDelivery, Monitoring}, | ||||||
|     }, |     }, | ||||||
|     topology::{K8sAnywhereTopology, Url}, |     topology::{K8sAnywhereTopology, Url}, | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| use async_trait::async_trait; | use async_trait::async_trait; | ||||||
| use log::info; | use log::info; | ||||||
| 
 | 
 | ||||||
| @ -6,19 +5,21 @@ use crate::{ | |||||||
|     inventory::Inventory, |     inventory::Inventory, | ||||||
|     modules::{ |     modules::{ | ||||||
|         application::{Application, ApplicationFeature}, |         application::{Application, ApplicationFeature}, | ||||||
|         monitoring::{application_monitoring::k8s_application_monitoring_score::ApplicationPrometheusMonitoringScore, kube_prometheus::{ |         monitoring::{ | ||||||
|             helm_prometheus_alert_score::HelmPrometheusAlertingScore, |             application_monitoring::k8s_application_monitoring_score::ApplicationPrometheusMonitoringScore, | ||||||
|             types::{NamespaceSelector, ServiceMonitor}, |             kube_prometheus::{ | ||||||
|         }}, |                 helm_prometheus_alert_score::HelmPrometheusAlertingScore, | ||||||
|  |                 types::{NamespaceSelector, ServiceMonitor}, | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|     }, |     }, | ||||||
|     score::Score, |     score::Score, | ||||||
|     topology::{tenant::TenantManager, HelmCommand, Topology}, |     topology::{HelmCommand, Topology, tenant::TenantManager}, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #[derive(Debug, Default, Clone)] | #[derive(Debug, Default, Clone)] | ||||||
| pub struct Monitoring {} | pub struct Monitoring {} | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| #[async_trait] | #[async_trait] | ||||||
| impl<T: Topology + HelmCommand + 'static + TenantManager> ApplicationFeature<T> for Monitoring { | impl<T: Topology + HelmCommand + 'static + TenantManager> ApplicationFeature<T> for Monitoring { | ||||||
|     async fn ensure_installed(&self, topology: &T) -> Result<(), String> { |     async fn ensure_installed(&self, topology: &T) -> Result<(), String> { | ||||||
|  | |||||||
| @ -4,11 +4,14 @@ use serde_yaml::{Mapping, Value}; | |||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|     interpret::{InterpretError, Outcome}, |     interpret::{InterpretError, Outcome}, | ||||||
|     modules::monitoring::{kube_prometheus::{ |     modules::monitoring::{ | ||||||
|         prometheus::{KubePrometheus, KubePrometheusReceiver}, |         kube_prometheus::{ | ||||||
|         types::{AlertChannelConfig, AlertManagerChannelConfig}, |             prometheus::{KubePrometheus, KubePrometheusReceiver}, | ||||||
|     }, prometheus::prometheus::{Prometheus, PrometheusReceiver}}, |             types::{AlertChannelConfig, AlertManagerChannelConfig}, | ||||||
|     topology::{oberservability::monitoring::AlertReceiver, Url}, |         }, | ||||||
|  |         prometheus::prometheus::{Prometheus, PrometheusReceiver}, | ||||||
|  |     }, | ||||||
|  |     topology::{Url, oberservability::monitoring::AlertReceiver}, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #[derive(Debug, Clone, Serialize)] | #[derive(Debug, Clone, Serialize)] | ||||||
|  | |||||||
| @ -4,11 +4,14 @@ use serde_yaml::{Mapping, Value}; | |||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|     interpret::{InterpretError, Outcome}, |     interpret::{InterpretError, Outcome}, | ||||||
|     modules::monitoring::{kube_prometheus::{ |     modules::monitoring::{ | ||||||
|         prometheus::{KubePrometheus, KubePrometheusReceiver}, |         kube_prometheus::{ | ||||||
|         types::{AlertChannelConfig, AlertManagerChannelConfig}, |             prometheus::{KubePrometheus, KubePrometheusReceiver}, | ||||||
|     }, prometheus::prometheus::{Prometheus, PrometheusReceiver}}, |             types::{AlertChannelConfig, AlertManagerChannelConfig}, | ||||||
|     topology::{oberservability::monitoring::AlertReceiver, Url}, |         }, | ||||||
|  |         prometheus::prometheus::{Prometheus, PrometheusReceiver}, | ||||||
|  |     }, | ||||||
|  |     topology::{Url, oberservability::monitoring::AlertReceiver}, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #[derive(Debug, Clone, Serialize)] | #[derive(Debug, Clone, Serialize)] | ||||||
|  | |||||||
| @ -1,3 +1 @@ | |||||||
| 
 |  | ||||||
| pub mod k8s_application_monitoring_score; | pub mod k8s_application_monitoring_score; | ||||||
| 
 |  | ||||||
|  | |||||||
| @ -4,14 +4,15 @@ use std::str::FromStr; | |||||||
| use crate::modules::helm::chart::HelmChartScore; | use crate::modules::helm::chart::HelmChartScore; | ||||||
| 
 | 
 | ||||||
| pub fn grafana_helm_chart_score(ns: &str) -> HelmChartScore { | pub fn grafana_helm_chart_score(ns: &str) -> HelmChartScore { | ||||||
|     let values =  format!( |     let values = format!( | ||||||
|         r#" |         r#" | ||||||
| rbac: | rbac: | ||||||
|   namespaced: true |   namespaced: true | ||||||
| sidecar: | sidecar: | ||||||
|   dashboards: |   dashboards: | ||||||
|     enabled: true |     enabled: true | ||||||
|         "#);
 |         "#
 | ||||||
|  |     ); | ||||||
| 
 | 
 | ||||||
|     HelmChartScore { |     HelmChartScore { | ||||||
|         namespace: Some(NonBlankString::from_str(ns).unwrap()), |         namespace: Some(NonBlankString::from_str(ns).unwrap()), | ||||||
|  | |||||||
| @ -1,2 +1 @@ | |||||||
| pub mod helm_grafana; | pub mod helm_grafana; | ||||||
| 
 |  | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| pub mod alert_channel; | pub mod alert_channel; | ||||||
| pub mod alert_rule; | pub mod alert_rule; | ||||||
|  | pub mod application_monitoring; | ||||||
|  | pub mod grafana; | ||||||
| pub mod kube_prometheus; | pub mod kube_prometheus; | ||||||
| pub mod ntfy; | pub mod ntfy; | ||||||
| pub mod grafana; |  | ||||||
| pub mod prometheus; | pub mod prometheus; | ||||||
| pub mod application_monitoring; |  | ||||||
|  | |||||||
| @ -1,2 +1 @@ | |||||||
| pub mod prometheus_helm; | pub mod prometheus_helm; | ||||||
| 
 |  | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user