monitoringalerting #37
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: NationTech/harmony#37
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "monitoringalerting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: Something here feels off to me, the config fields for which services are deployed through via the helm chart are not easily modifiable. Since harmony is opinionated I,m not sure how much of a problem that is. Do we want the end user to have the liberty/responsibility to chose which services are deployed by default or not
Good improvement over the first version, still some work to do to have it really look good. Keep it up!
@ -34,1 +34,4 @@
"#;
let mut values_overrides: HashMap<NonBlankString, String> = HashMap::new();
macro_rules! insert_flag {
Using a macro here is weird at the very least.
It makes code not easily readable
insert_flag
is way less obvious to me what it does thanvalues_overrides.insert(...)
wouldUse a function if you want to make the NonBlankString boilerplate more readable. And if you want to write a macro that does something valuable you should validate the NonBlankString at compile time like we do with out ip! and mac_address! macros.
@ -43,3 +75,3 @@
chart_version: None,
values_overrides: None,
values_overrides: Some(values_overrides),
values_yaml: Some(values.to_string()),
Why use values_overrides here when there already is a values_yaml right above? Would make it a lot more readable I think.
@ -11,0 +12,4 @@
use super::{config::KubePrometheusConfig, kube_prometheus::kube_prometheus_helm_chart_score};
#[derive(Debug, Clone, Serialize)]
pub enum AlertChannel {
Nice, but did you test smtp? If it's not working yet there should be a // TODO comment or something like that.
I would expect to see server, username, password or something like that here. Then there is a bajillion providers with no standards. Emails are not a simple topic. Maybe we should even only support Webhook for now.
@ -11,0 +19,4 @@
},
Smpt {
email_address: EmailAddress,
service_name: String,
What is service_name used for? As this is user facing, a bit of rust doc (with triple slashes ///) to describe how to use would be useful here.
@ -16,2 +34,2 @@
pub monitoring_stack: HelmChartScore,
pub namespace: String,
pub alert_channel: Option<AlertChannel>,
pub monitoring_stack: Stack,
No need for this
monitoring_stack: Stack
field for now. This is a case of YAGNI. We support only one type and I don't see in the very short term a use case that would force us.Another note, I'm realising now something that slipped by me yesterday :
I think we should have two scores for monitoring : cluster monitoring and app monitoring. The one we want with LampScore is ApplicationMonitoringScore. It comes with quite a bit of boilerplate but at least it makes sense to deploy it anywhere. Then we also provide a ClusterMonitoringScore. Under the hood they could very well use the same Interpret and work together efficiently.
@ -32,3 +47,1 @@
Self {
monitoring_stack: kube_prometheus_score(ns),
namespace: ns.to_string(),
fn match_alert_channel(&self, config: &mut KubePrometheusConfig) {
Poor function name. What's the use of this function?
Something like
configure_alerts
maybe?@ -35,0 +47,4 @@
fn match_alert_channel(&self, config: &mut KubePrometheusConfig) {
if let Some(alert_channel) = &self.alert_channel {
match alert_channel {
//opt1
Useless comments
The name MonitoringAlertingStackScore bothered me all along but I couldn't figure out why. Now I did :
The word Stack.
It should be MonitoringAlertingScore or TelemetryScore or something like that.
Our goal with this is to provide a functionnality to the app developers. This functionnality is not a specific stack, but only the Monitoring and Alerting features.
And now that I think of it, maybe they should be separate : MonitoringScore and AlertingScore.
Both could depend on the same feature provider under the hood. Could be prometheus grafana, hyperdx, datadog, etc.
Let's merge this as-is for now but I think we have a nice opportunity for a great design here!