Skip to content

Commit c59a439

Browse files
authored
Merge pull request #376 from shu-unifra/scroll-sdk-init-monitor
add section monitoring
2 parents 598b638 + c39b815 commit c59a439

File tree

6 files changed

+127
-10
lines changed

6 files changed

+127
-10
lines changed
455 KB
Loading
391 KB
Loading
547 KB
Loading
341 KB
Loading

src/content/docs/en/sdk/guides/aws-deployment.mdx

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import ToggleElement from "../../../../../components/ToggleElement.astro";
1414
import AWSCloudflareDNSWildcards from "./_images/aws-cloudflare-dns-wildcards.png";
1515
import AWSCloudflareDNS from "./_images/aws-cloudflare-dns.png";
1616
import AWSEBSDriver from "./_images/aws-ebs-driver.png";
17+
import CreateSlackApp from "./_images/CreateSlackApp.png"
18+
import AddNewWebhookToWorkspace from "./_images/AddNewWebhookToWorkspace.png"
19+
import CopyWebhookURL from "./_images/CopyWebhookURL.png"
20+
import GrafanaDashboard from "./_images/grafana.png"
1721

1822
This guide demonstrates how to deploy a Scroll SDK on Amazon Web Services (AWS) using Elastic Kubernetes Service (EKS) and other managed services.
1923

@@ -187,14 +191,7 @@ helm repo update
187191
helm install nginx-ingress nginx-stable/ingress-nginx --namespace kube-system
188192
```
189193

190-
2. Prometheus Stack:
191-
```bash
192-
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
193-
helm repo update
194-
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace kube-system
195-
```
196-
197-
3. Cert-Manager:
194+
2. Cert-Manager:
198195
```bash
199196
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.0/cert-manager.yaml
200197
```
@@ -807,4 +804,62 @@ controller:
807804

808805
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.
809806

810-
{/* TODO: Fix this comment once we add this documentation */}
807+
{/* TODO: Fix this comment once we add this documentation */}
808+
809+
810+
### Monitoring
811+
You can monitor the cluster's running status through Grafana.
812+
Additionally, you can send alerts via email and Slack using Alertmanager.
813+
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`.
814+
<ClickToZoom src={GrafanaDashboard} alt="Copy Webhook URL" />
815+
816+
#### send alert to slack
817+
1. **Create a Slack App**
818+
819+
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.
820+
821+
2. **Activate Incoming Webhooks**
822+
823+
Click the **`Incoming Webhooks`** label on the right side of the page, then turn on **`Activate Incoming Webhooks`**.
824+
<ClickToZoom src={CreateSlackApp} alt="Create Slack App" />
825+
826+
Click the **`Add New Webhook to Workspace`** button.
827+
<ClickToZoom src={AddNewWebhookToWorkspace} alt="Add New Webhook to Workspace" />
828+
829+
Select the channel you want to send alerts to, then copy the Webhook URL.
830+
<ClickToZoom src={CopyWebhookURL} alt="Copy Webhook URL" />
831+
832+
833+
3. **Edit the Config File**
834+
835+
Edit `./values/alert-manager.yaml` to replace it with your webhook URL and your Slack channel name.
836+
```
837+
kube-prometheus-stack:
838+
alertmanager:
839+
config:
840+
global:
841+
resolve_timeout: 5m
842+
slack_api_url: 'https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx' # your webhook url
843+
receivers:
844+
- name: 'slack-alerts'
845+
slack_configs:
846+
- channel: '#scroll-webhook' #your channel name
847+
send_resolved: true
848+
text: '{{ .CommonAnnotations.description }}'
849+
title: '{{ .CommonAnnotations.summary }}'
850+
route:
851+
group_by: ['alertname']
852+
receiver: 'slack-alerts'
853+
routes:
854+
- matchers: []
855+
receiver: 'slack-alerts'
856+
```
857+
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/).
858+
859+
4. **Update to alertmanager**
860+
861+
Use the following command to update Alertmanager:
862+
```
863+
helm upgrade --reuse-values -i scroll-monitor oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-monitor -n $(NAMESPACE) \
864+
--values ./values/alert-manager.yaml
865+
```

src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import DOKubernetesConnect from "./_images/do-cluster-connection.png"
2525
import DOConnectionPools from "./_images/do-connection-pools.png"
2626
import DOConnectionInfo from "./_images/do-connection-info.png"
2727
import DOVPCNetwork from "./_images/do-vpc-network.png"
28+
import CreateSlackApp from "./_images/CreateSlackApp.png"
29+
import AddNewWebhookToWorkspace from "./_images/AddNewWebhookToWorkspace.png"
30+
import CopyWebhookURL from "./_images/CopyWebhookURL.png"
31+
import GrafanaDashboard from "./_images/grafana.png"
2832

2933
This guide documents getting a Scroll SDK deployment working on Digital Ocean's Kubernetes and managed databases, using Cloudflare for DNS.
3034

@@ -716,4 +720,62 @@ To quickly get started with Grafana, run the following command:
716720
717721
Now, visit the localhost URL in [your browser](http://localhost:3000/). The default password for the `admin` user is `prom-operator`.
718722
719-
Adding an ingress URL, changing the default password or adding LDAP login are all suggested if you use this stack in production. */}
723+
Adding an ingress URL, changing the default password or adding LDAP login are all suggested if you use this stack in production. */}
724+
725+
726+
### Monitoring
727+
You can monitor the cluster's running status through Grafana.
728+
Additionally, you can send alerts via email and Slack using Alertmanager.
729+
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`.
730+
<ClickToZoom src={GrafanaDashboard} alt="Copy Webhook URL" />
731+
732+
#### send alert to slack
733+
1. **Create a Slack App**
734+
735+
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.
736+
737+
2. **Activate Incoming Webhooks**
738+
739+
Click the **`Incoming Webhooks`** label on the right side of the page, then turn on **`Activate Incoming Webhooks`**.
740+
<ClickToZoom src={CreateSlackApp} alt="Create Slack App" />
741+
742+
Click the **`Add New Webhook to Workspace`** button.
743+
<ClickToZoom src={AddNewWebhookToWorkspace} alt="Add New Webhook to Workspace" />
744+
745+
Select the channel you want to send alerts to, then copy the Webhook URL.
746+
<ClickToZoom src={CopyWebhookURL} alt="Copy Webhook URL" />
747+
748+
749+
3. **Edit the Config File**
750+
751+
Edit `./values/alert-manager.yaml` to replace it with your webhook URL and your Slack channel name.
752+
```
753+
kube-prometheus-stack:
754+
alertmanager:
755+
config:
756+
global:
757+
resolve_timeout: 5m
758+
slack_api_url: 'https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx' # your webhook url
759+
receivers:
760+
- name: 'slack-alerts'
761+
slack_configs:
762+
- channel: '#scroll-webhook' #your channel name
763+
send_resolved: true
764+
text: '{{ .CommonAnnotations.description }}'
765+
title: '{{ .CommonAnnotations.summary }}'
766+
route:
767+
group_by: ['alertname']
768+
receiver: 'slack-alerts'
769+
routes:
770+
- matchers: []
771+
receiver: 'slack-alerts'
772+
```
773+
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/).
774+
775+
4. **Update to alertmanager**
776+
777+
Use the following command to update Alertmanager:
778+
```
779+
helm upgrade --reuse-values -i scroll-monitor oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-monitor -n $(NAMESPACE) \
780+
--values ./values/alert-manager.yaml
781+
```

0 commit comments

Comments
 (0)