diff --git a/docs/configuration/alertmanager-integration/outofcluster-prometheus.rst b/docs/configuration/alertmanager-integration/outofcluster-prometheus.rst index 6c08533fe..16c3fcb35 100644 --- a/docs/configuration/alertmanager-integration/outofcluster-prometheus.rst +++ b/docs/configuration/alertmanager-integration/outofcluster-prometheus.rst @@ -10,9 +10,8 @@ Send Alerts to Robusta This integration lets your central Prometheus send alerts to Robusta, as if they were in the same cluster: -1. Enable cloud-routing of alerts by setting ``disableCloudRouting: false`` in ``generated_values.yaml``. -2. Verify that all alerts contain a label named ``cluster_name`` or ``cluster``, matching the :ref:`cluster_name defined in Robusta's configuration `. This is necessary to identify which robusta-runner should receive alerts. -3. Edit the configuration for your centralized AlertManager: +1. Verify that all alerts contain a label named ``cluster_name`` or ``cluster``, matching the :ref:`cluster_name defined in Robusta's configuration `. This is necessary to identify which robusta-runner should receive alerts. +2. Edit the configuration for your centralized AlertManager: .. admonition:: alertmanager.yaml diff --git a/docs/setup-robusta/additional-settings.rst b/docs/setup-robusta/additional-settings.rst index 10e0dce41..e369b3597 100644 --- a/docs/setup-robusta/additional-settings.rst +++ b/docs/setup-robusta/additional-settings.rst @@ -127,19 +127,6 @@ You can map your own Prometheus severities, using the ``custom_severity_map`` He The mapped values must be one of: high, low, info, and debug. -Two-way Interactivity ------------------------- - -Two-way interactivity allows the Robusta UI and the Slack sink to connect to the Robusta running in your cluster. - -The Robusta UI uses interactivity to display dynamic data, such as Prometheus graphs. -Slack uses it to support custom remediation buttons. - -To **enable** interactivity, set the following in your `generated_values.yaml` file: - -.. code-block:: yaml - - disableCloudRouting: false Censoring Logs ---------------- diff --git a/helm/robusta/templates/_helpers.tpl b/helm/robusta/templates/_helpers.tpl index edbf189e8..d98829e94 100644 --- a/helm/robusta/templates/_helpers.tpl +++ b/helm/robusta/templates/_helpers.tpl @@ -19,14 +19,6 @@ playbook_repos: {{- fail "At least one sink must be defined!" }} {{- end }} -{{- range .Values.sinksConfig }} - {{- if .robusta_sink }} - {{- if $.Values.disableCloudRouting }} - {{- fail "You cannot set `disableCloudRouting: true` when the Robusta UI sink (robusta_sink) is enabled, as this flag breaks the UI's behavior.\nPlease remove `disableCloudRouting: true` to continue installing." -}} - {{- end }} - {{- end }} -{{- end }} - {{- if or .Values.slackApiKey .Values.robustaApiKey }} {{- /* support old values files, prior to chart version 0.8.9 */}} sinks_config: diff --git a/helm/robusta/templates/runner.yaml b/helm/robusta/templates/runner.yaml index a84b5865a..fc19180a6 100644 --- a/helm/robusta/templates/runner.yaml +++ b/helm/robusta/templates/runner.yaml @@ -74,10 +74,6 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - {{- if .Values.disableCloudRouting }} - - name: CLOUD_ROUTING - value: "False" - {{- end }} {{- if not .Values.monitorHelmReleases }} - name: DISABLE_HELM_MONITORING value: "True" diff --git a/helm/robusta/values.yaml b/helm/robusta/values.yaml index 26293764e..a009842f2 100644 --- a/helm/robusta/values.yaml +++ b/helm/robusta/values.yaml @@ -99,8 +99,6 @@ enableServiceMonitors: true monitorHelmReleases: true argoRollouts: false -# disable messages routed by Robusta cloud -disableCloudRouting: false # scale alerts processing. # Used to support clusters with high load of alerts. When used, the runner will consume more memory diff --git a/src/robusta/integrations/receiver.py b/src/robusta/integrations/receiver.py index d99a90c18..2e14db65d 100644 --- a/src/robusta/integrations/receiver.py +++ b/src/robusta/integrations/receiver.py @@ -37,7 +37,6 @@ from robusta.utils.error_codes import ErrorCodes WEBSOCKET_RELAY_ADDRESS = os.environ.get("WEBSOCKET_RELAY_ADDRESS", "wss://relay.robusta.dev") -CLOUD_ROUTING = json.loads(os.environ.get("CLOUD_ROUTING", "True").lower()) RECEIVER_ENABLE_WEBSOCKET_TRACING = json.loads(os.environ.get("RECEIVER_ENABLE_WEBSOCKET_TRACING", "False").lower()) INCOMING_WEBSOCKET_RECONNECT_DELAY_SEC = int(os.environ.get("INCOMING_WEBSOCKET_RECONNECT_DELAY_SEC", 3)) WEBSOCKET_THREADPOOL_SIZE = int(os.environ.get("WEBSOCKET_THREADPOOL_SIZE", 10)) @@ -79,8 +78,8 @@ class ActionRequestReceiver: def __init__(self, event_handler: PlaybooksEventHandler, robusta_sink: "RobustaSink"): self.event_handler = event_handler self.active = True - self.account_id = self.event_handler.get_global_config().get("account_id") - self.cluster_name = self.event_handler.get_global_config().get("cluster_name") + self.account_id = robusta_sink.account_id + self.cluster_name = robusta_sink.cluster_name self.auth_provider = AuthProvider() self.healthy = False self.robusta_sink = robusta_sink @@ -104,10 +103,6 @@ def __init__(self, event_handler: PlaybooksEventHandler, robusta_sink: "RobustaS self.start_receiver() def start_receiver(self): - if not CLOUD_ROUTING: - logging.info("outgoing messages only mode. Incoming event receiver not initialized") - return - if WEBSOCKET_RELAY_ADDRESS == "": logging.warning("relay address empty. Not initializing relay") return @@ -285,17 +280,15 @@ def on_error(self, ws, error): logging.info(f"Relay websocket error: {error}") def on_open(self, ws): - account_id = self.event_handler.get_global_config().get("account_id") - cluster_name = self.event_handler.get_global_config().get("cluster_name") token = self.robusta_sink.dal.get_session_token() open_payload = { "action": "auth", - "account_id": account_id, - "cluster_name": cluster_name, + "account_id": self.account_id, + "cluster_name": self.cluster_name, "version": RUNNER_VERSION, "token": token, } - logging.info(f"connecting to server as account_id={account_id}; cluster_name={cluster_name}") + logging.info(f"connecting to server as account_id={self.account_id}; cluster_name={self.cluster_name}") ws.send(json.dumps(open_payload)) def __validate_request(self, action_request: ExternalActionRequest, validate_timestamp: bool) -> ValidationResponse: diff --git a/src/robusta/runner/config_loader.py b/src/robusta/runner/config_loader.py index 12ce46681..79ed54510 100644 --- a/src/robusta/runner/config_loader.py +++ b/src/robusta/runner/config_loader.py @@ -84,32 +84,31 @@ def __reload_scheduler(self, playbooks_registry: PlaybooksRegistry): scheduler.update(playbooks_registry.get_playbooks(ScheduledTriggerEvent())) - def __reload_receiver(self): + def __reload_receiver(self) -> None: + robusta_sinks = self.registry.get_sinks().get_robusta_sinks() + if not robusta_sinks: + logging.info("No robusta sinks found, skipping receiver creation") + return + robusta_sink = robusta_sinks[0] + receiver = self.registry.get_receiver() if not receiver: # no existing receiver, just start one - self.__create_receiver() + self.__create_receiver(robusta_sink) return - current_account_id = self.event_handler.get_global_config().get("account_id") - current_cluster_name = self.event_handler.get_global_config().get("cluster_name") + updated_account_id = robusta_sink.account_id + updated_cluster_name = robusta_sink.cluster_name - if current_account_id != receiver.account_id or current_cluster_name != receiver.cluster_name: + if updated_account_id != receiver.account_id or updated_cluster_name != receiver.cluster_name: # need to re-create the receiver receiver.stop() - self.__create_receiver() - - def __create_receiver(self): - robusta_sinks = self.registry.get_sinks().get_robusta_sinks() - if not robusta_sinks: - logging.info("No robusta sinks found, skipping receiver creation") - return - - robusta_sink = robusta_sinks[0] + self.__create_receiver(robusta_sink) + def __create_receiver(self, robusta_sink: "RobustaSink"): receiver = ActionRequestReceiver(self.event_handler, robusta_sink) self.registry.set_receiver(receiver) return receiver - + @staticmethod def __get_package_name_from_pyproject(local_path: str) -> str: with open(os.path.join(local_path, "pyproject.toml"), "r") as pyproj_toml: @@ -263,7 +262,6 @@ def __reload_playbook_packages(self, change_name): self.registry.set_sinks(sinks_registry) self.__reload_receiver() - telemetry = self.registry.get_telemetry() telemetry.playbooks_count = len(runner_config.active_playbooks) if runner_config.active_playbooks else 0 telemetry.account_id = hashlib.sha256(