diff --git a/src/content/docs/en/sdk/guides/_images/AddNewWebhookToWorkspace.png b/src/content/docs/en/sdk/guides/_images/AddNewWebhookToWorkspace.png new file mode 100644 index 00000000..49b18b47 Binary files /dev/null and b/src/content/docs/en/sdk/guides/_images/AddNewWebhookToWorkspace.png differ diff --git a/src/content/docs/en/sdk/guides/_images/CopyWebhookURL.png b/src/content/docs/en/sdk/guides/_images/CopyWebhookURL.png new file mode 100644 index 00000000..d80e2822 Binary files /dev/null and b/src/content/docs/en/sdk/guides/_images/CopyWebhookURL.png differ diff --git a/src/content/docs/en/sdk/guides/_images/CreateSlackApp.png b/src/content/docs/en/sdk/guides/_images/CreateSlackApp.png new file mode 100644 index 00000000..5a9ad5bd Binary files /dev/null and b/src/content/docs/en/sdk/guides/_images/CreateSlackApp.png differ diff --git a/src/content/docs/en/sdk/guides/_images/grafana.png b/src/content/docs/en/sdk/guides/_images/grafana.png new file mode 100644 index 00000000..14722259 Binary files /dev/null and b/src/content/docs/en/sdk/guides/_images/grafana.png differ diff --git a/src/content/docs/en/sdk/guides/aws-deployment.mdx b/src/content/docs/en/sdk/guides/aws-deployment.mdx index 412e2b73..ec127fee 100644 --- a/src/content/docs/en/sdk/guides/aws-deployment.mdx +++ b/src/content/docs/en/sdk/guides/aws-deployment.mdx @@ -14,6 +14,10 @@ import ToggleElement from "../../../../../components/ToggleElement.astro"; import AWSCloudflareDNSWildcards from "./_images/aws-cloudflare-dns-wildcards.png"; import AWSCloudflareDNS from "./_images/aws-cloudflare-dns.png"; import AWSEBSDriver from "./_images/aws-ebs-driver.png"; +import CreateSlackApp from "./_images/CreateSlackApp.png" +import AddNewWebhookToWorkspace from "./_images/AddNewWebhookToWorkspace.png" +import CopyWebhookURL from "./_images/CopyWebhookURL.png" +import GrafanaDashboard from "./_images/grafana.png" This guide demonstrates how to deploy a Scroll SDK on Amazon Web Services (AWS) using Elastic Kubernetes Service (EKS) and other managed services. @@ -187,14 +191,7 @@ helm repo update helm install nginx-ingress nginx-stable/ingress-nginx --namespace kube-system ``` -2. Prometheus Stack: -```bash -helm repo add prometheus-community https://prometheus-community.github.io/helm-charts -helm repo update -helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace kube-system -``` - -3. Cert-Manager: +2. Cert-Manager: ```bash kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.0/cert-manager.yaml ``` @@ -807,4 +804,62 @@ controller: Some services do not support this without additional configurations (for example, `l2-sequencer` and `l2-bootnode`). We are working on additional info on how to properly run multiple services for load balancing between or for having redundant backups available. -{/* TODO: Fix this comment once we add this documentation */} \ No newline at end of file +{/* TODO: Fix this comment once we add this documentation */} + + +### Monitoring +You can monitor the cluster's running status through Grafana. +Additionally, you can send alerts via email and Slack using Alertmanager. +If you have configured a domain for Grafana in the previous steps, you can access it by opening http://grafana.yourdomain, where you will see two sets of dashboards. The defalt password of user `admin` is `scroll-sdk`. + + +#### send alert to slack +1. **Create a Slack App** + + Open [https://api.slack.com/apps](https://api.slack.com/apps) and click **`Create New App`** if you don't have one already. Select **`From scratch`**, enter a name, and select the workspace. + +2. **Activate Incoming Webhooks** + + Click the **`Incoming Webhooks`** label on the right side of the page, then turn on **`Activate Incoming Webhooks`**. + + + Click the **`Add New Webhook to Workspace`** button. + + + Select the channel you want to send alerts to, then copy the Webhook URL. + + + +3. **Edit the Config File** + + Edit `./values/alert-manager.yaml` to replace it with your webhook URL and your Slack channel name. + ``` + kube-prometheus-stack: + alertmanager: + config: + global: + resolve_timeout: 5m + slack_api_url: 'https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx' # your webhook url + receivers: + - name: 'slack-alerts' + slack_configs: + - channel: '#scroll-webhook' #your channel name + send_resolved: true + text: '{{ .CommonAnnotations.description }}' + title: '{{ .CommonAnnotations.summary }}' + route: + group_by: ['alertname'] + receiver: 'slack-alerts' + routes: + - matchers: [] + receiver: 'slack-alerts' + ``` + This configuration file will send all alerts to your Slack channel. If you need more complex rules, refer to the [Prometheus Alerting Configuration Documentation](https://prometheus.io/docs/alerting/latest/configuration/). + +4. **Update to alertmanager** + + Use the following command to update Alertmanager: + ``` + helm upgrade --reuse-values -i scroll-monitor oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-monitor -n $(NAMESPACE) \ + --values ./values/alert-manager.yaml + ``` diff --git a/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx b/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx index 44565187..5bbdd650 100644 --- a/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx +++ b/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx @@ -25,6 +25,10 @@ import DOKubernetesConnect from "./_images/do-cluster-connection.png" import DOConnectionPools from "./_images/do-connection-pools.png" import DOConnectionInfo from "./_images/do-connection-info.png" import DOVPCNetwork from "./_images/do-vpc-network.png" +import CreateSlackApp from "./_images/CreateSlackApp.png" +import AddNewWebhookToWorkspace from "./_images/AddNewWebhookToWorkspace.png" +import CopyWebhookURL from "./_images/CopyWebhookURL.png" +import GrafanaDashboard from "./_images/grafana.png" This guide documents getting a Scroll SDK deployment working on Digital Ocean's Kubernetes and managed databases, using Cloudflare for DNS. @@ -716,4 +720,62 @@ To quickly get started with Grafana, run the following command: Now, visit the localhost URL in [your browser](http://localhost:3000/). The default password for the `admin` user is `prom-operator`. -Adding an ingress URL, changing the default password or adding LDAP login are all suggested if you use this stack in production. */} \ No newline at end of file +Adding an ingress URL, changing the default password or adding LDAP login are all suggested if you use this stack in production. */} + + +### Monitoring +You can monitor the cluster's running status through Grafana. +Additionally, you can send alerts via email and Slack using Alertmanager. +If you have configured a domain for Grafana in the previous steps, you can access it by opening http://grafana.yourdomain, where you will see two sets of dashboards. The defalt password of user `admin` is `scroll-sdk`. + + +#### send alert to slack +1. **Create a Slack App** + + Open [https://api.slack.com/apps](https://api.slack.com/apps) and click **`Create New App`** if you don't have one already. Select **`From scratch`**, enter a name, and select the workspace. + +2. **Activate Incoming Webhooks** + + Click the **`Incoming Webhooks`** label on the right side of the page, then turn on **`Activate Incoming Webhooks`**. + + + Click the **`Add New Webhook to Workspace`** button. + + + Select the channel you want to send alerts to, then copy the Webhook URL. + + + +3. **Edit the Config File** + + Edit `./values/alert-manager.yaml` to replace it with your webhook URL and your Slack channel name. + ``` + kube-prometheus-stack: + alertmanager: + config: + global: + resolve_timeout: 5m + slack_api_url: 'https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx' # your webhook url + receivers: + - name: 'slack-alerts' + slack_configs: + - channel: '#scroll-webhook' #your channel name + send_resolved: true + text: '{{ .CommonAnnotations.description }}' + title: '{{ .CommonAnnotations.summary }}' + route: + group_by: ['alertname'] + receiver: 'slack-alerts' + routes: + - matchers: [] + receiver: 'slack-alerts' + ``` + This configuration file will send all alerts to your Slack channel. If you need more complex rules, refer to the [Prometheus Alerting Configuration Documentation](https://prometheus.io/docs/alerting/latest/configuration/). + +4. **Update to alertmanager** + + Use the following command to update Alertmanager: + ``` + helm upgrade --reuse-values -i scroll-monitor oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-monitor -n $(NAMESPACE) \ + --values ./values/alert-manager.yaml + ```