Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Global Config>`. 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 <Global Config>`. This is necessary to identify which robusta-runner should receive alerts.
2. Edit the configuration for your centralized AlertManager:

.. admonition:: alertmanager.yaml

Expand Down
13 changes: 0 additions & 13 deletions docs/setup-robusta/additional-settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------
Expand Down
8 changes: 0 additions & 8 deletions helm/robusta/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions helm/robusta/templates/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 5 additions & 12 deletions src/robusta/integrations/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
30 changes: 14 additions & 16 deletions src/robusta/runner/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Comment thread
moshemorad marked this conversation as resolved.
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:
Expand Down Expand Up @@ -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(
Expand Down
Loading