forked from robusta-dev/robusta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into project-structure-improvements
- Loading branch information
Showing
36 changed files
with
600 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Prometheus Integration | ||
###################### | ||
|
||
Setting up the webhook | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
Robusta playbooks can run in response to any Prometheus alert. To configure, add the robusta-runner webhook to your alert manager configuration: | ||
|
||
.. admonition:: AlertManager configuration | ||
|
||
.. code-block:: yaml | ||
receivers: | ||
- name: 'webhook' | ||
webhook_configs: | ||
- url: 'http://robusta-runner.default.svc.cluster.local/api/alerts' | ||
send_resolved: true | ||
.. warning:: | ||
If you use the Prometheus Operator, configure AlertManager using a `manually managed secret | ||
<https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/alerting.md#manually-managed-secret>`_ | ||
and **not** an AlertmanagerConfig due to `this limitation <https://github.com/prometheus-operator/prometheus-operator/issues/3750>`_. | ||
|
||
Trying it out | ||
^^^^^^^^^^^^^ | ||
.. | ||
TODO: add details here on using existing Prometheus playbooks and not just writing your own | ||
You can now write and use a playbook action like the following: | ||
|
||
.. admonition:: Example Prometheus playbook | ||
|
||
.. code-block:: python | ||
@action | ||
def my_action(alert: PrometheusKubernetesAlert): | ||
print(f"The alert {alert.alert_name} fired on pod {alert.pod.metadata.name}") | ||
print(f"The pod has these processes:", alert.pod.exec("ps aux")) | ||
print(f"The pod has {len(alert.pod.spec.containers)} containers") | ||
.. tip:: | ||
``alert.pod`` is a Kubernetes pod object. It has the same fields as a Pod yaml. For example, ``alert.pod.metadata.name`` maps to ``metadata.name`` in the yaml. |
Oops, something went wrong.