feat/teams-integration #40
Closed
wjro
wants to merge 5 commits from
feat/teams-integration into master
pull from: feat/teams-integration
merge into: NationTech:master
NationTech:master
NationTech:feat/openwebui
NationTech:feat/iot-walking-skeleton
NationTech:feat/iot-aggregation-scale
NationTech:feat/add-new-node
NationTech:feat/iot-operator-helm-chart
NationTech:feat/removesideeffect
NationTech:feat/test-alert-receivers-sttest
NationTech:feat/brocade-client-add-vlans
NationTech:feat/agent-desired-state
NationTech:feat/opnsense-dns-implementation
NationTech:feat/named-config-instances
NationTech:worktree-bridge-cse_012j1jB37XfjXvDGHUjHrKSj
NationTech:chore/leftover-adr
NationTech:feat/config_e2e_zitadel_openbao
NationTech:example/vllm
NationTech:feat/config_sqlite
NationTech:chore/roadmap
NationTech:feature/kvm-module
NationTech:feat/rustfs
NationTech:feat/harmony_assets
NationTech:feat/brocade_assisted_setup
NationTech:feat/cluster_alerting_score
NationTech:e2e-tests-multicluster
NationTech:fix/refactor_alert_receivers
NationTech:feat/change-node-readiness-strategy
NationTech:feat/zitadel
NationTech:feat/improve-inventory-discovery
NationTech:fix/monitoring_abstractions_openshift
NationTech:feat/nats-jetstream
NationTech:adr-nats-creds
NationTech:feat/st_test
NationTech:feat/dockerAutoinstall
NationTech:chore/cleanup_hacluster
NationTech:doc/cert-management
NationTech:feat/certificate_management
NationTech:adr/017-staleness-failover
NationTech:fix/nats_non_root
NationTech:feat/rebuild_inventory
NationTech:fix/opnsense_update
NationTech:feat/unshedulable_control_planes
NationTech:feat/worker_okd_install
NationTech:doc-and-braindump
NationTech:fix/pxe_install
NationTech:switch-client
NationTech:okd_enable_user_workload_monitoring
NationTech:configure-switch
NationTech:fix/clippy
NationTech:feat/gen-ca-cert
NationTech:feat/okd_default_ingress_class
NationTech:fix/add_routes_to_domain
NationTech:secrets-prompt-editor
NationTech:feat/multisiteApplication
NationTech:feat/ceph-install-score
NationTech:feat/ceph-osd-score
NationTech:feat/ceph_validate_health
NationTech:better-indicatif-progress-grouped
NationTech:feat/crd-alertmanager-configs
NationTech:better-cli
NationTech:opnsense_upgrade
NationTech:feat/monitoring-application-feature
NationTech:dev/postgres
NationTech:feat/cd/localdeploymentdemo
NationTech:feat/webhook_receiver
NationTech:feat/kube-prometheus
NationTech:feat/init_k8s_tenant
NationTech:feat/discord-webhook-receiver
NationTech:feat/kube-prometheus-monitor
NationTech:feat/tenantScore
NationTech:feat/slack-notifs
NationTech:monitoring
NationTech:runtime-profiles
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "feat/teams-integration"
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?
You missed the point of using a trait here. See my comment and refactor accordingly.
@@ -5,0 +9,4 @@mod prometheus_msteams;#[derive(Debug, Clone, Serialize)]pub enum AlertChannel {This defeats the purpose of using a trait. Also prevents extensibility by external users of Harmony.
If this were a trait, then anybody can
impl AlertChannel for MyCustomMessageReceiverand use this AlertChannel in his Harmony deployment.Much better than previous iteration. But still a lot of room for improvement.
First : this should be split into 4-5 pull requests :
Then, I have quite a few more comments that you will see below.
@@ -0,0 +1,14 @@[package]This should be behind a feature flag such as "msteams-deprecated"
Oh it's in the examples, forget this.
@@ -0,0 +38,4 @@webhook_url: Url,}#[typetag::serde]typetag doesn't seem to be a good idea here. Why do you use it? Show me an actual use case that requires it versus having a trait bound
+ Serializeon the PrometheusAlertChannel trait.@@ -0,0 +16,4 @@use std::fmt::Debug;use url::Url;#[typetag::serde(tag = "channel_type")]Yeah I don't think this will work. Show me the actual json that this produces and why you need to use this.
Always be extremely careful when introducing a new dependency in the project. If we need a new dependency it can mean two things :
+ Serializerequirement to the trait like we do with the Score trait.@@ -0,0 +18,4 @@#[typetag::serde(tag = "channel_type")]#[async_trait::async_trait]pub trait PrometheusAlertChannel: DynClone + Debug + Send + Sync {I think PrometheusAlertChannel is a good name for the trait. However both function names feel off :
get_alert_manager_config_contribution : what does this mean? What is the word
contributiondoing here? I feel like the return type is correct or almost correct but the function name is weird. From my understanding here this trait's job is to provide a serializable alert channel yaml configuration that can be insterted in a list of prometheus alert channels.get_dependency_score : this feels very wrong. I'm pretty sure this violates the Single Responsibility Principle as well as Harmony's architecture guidelines.
Please add a rustdoc explaining what is the purpose of this trait. Then review the SRP and make sure that it is followed here.
@@ -0,0 +1,94 @@use serde::{Deserialize, Serialize};This entire file looks pretty good 👍
Almost all types seem to describe the proper abstractions of prometheus types.
However, the implementation specific types should be bundled with their respective implementations. Such as SlackConfig and WebhookConfig.
@@ -74,1 +65,4 @@config.namespace = ns.clone();};let null_channel = NullReceiver::new();Is this really required? This feels wrong, at least it would deserve a small comment explaining why you are ALWAYS instanciating a hardcoded NullReceiver
@@ -77,0 +87,4 @@let alert_manager_config = AlertManagerConfig {global: global_config,route: AlertManagerRoute {Why is all this config hardcoded? Shouldn't it be exposed in the Score's configuration? I think it should have defaults so that users are not forced to set everything by themselves but it should not be hardcoded.
@@ -91,3 +122,3 @@}async fn deploy_alert_channel_service<T: Topology + HelmCommand>(async fn deploy_alert_channel_dependencies<T: Topology + HelmCommand>(I am 99% sure this is wrong.
Dependencies should be handled at the Topology level as capabilities. But I'm not 100% sure because this has the drawback of not being "just in time" when the score is executed. This would be happening right at the Topology's initialization.
However, this implementation here has many drawbacks :
The PrometheusAlertChannel is handling dependencies in a unique way, that is not following the rest of Harmony's architecture.
Take the K8sAnywhereTopology for example : K8sResourceScore has a K8sClient dependency, which is provided by K8sAnywhere. Then, upon initialization, K8sAnywhere will make sure that it is fulfilling is contract by making sure that there is a K8sClient available, either by installing K3d locally or verifying that it is able to reach whatever cluster it is connected to.
This means that I would have expected this architecture :
Pull request closed