Skip to content

Commit

Permalink
1. add motoring section to digital ocean guide
Browse files Browse the repository at this point in the history
2. show default user and password of grafana
  • Loading branch information
shu-unifra committed Oct 23, 2024
1 parent 7712a90 commit 10b5119
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/en/sdk/guides/aws-deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ Some services do not support this without additional configurations (for example
### 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.xyz, where you will see two sets of dashboards.
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`.
<ClickToZoom src={GrafanaDashboard} alt="Copy Webhook URL" />

#### send alert to slack
Expand Down
65 changes: 64 additions & 1 deletion src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -536,4 +540,63 @@ 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. */}
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`.
<ClickToZoom src={GrafanaDashboard} alt="Copy Webhook URL" />

#### 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`**.
<ClickToZoom src={CreateSlackApp} alt="Create Slack App" />

Click the **`Add New Webhook to Workspace`** button.
<ClickToZoom src={AddNewWebhookToWorkspace} alt="Add New Webhook to Workspace" />

Select the channel you want to send alerts to, then copy the Webhook URL.
<ClickToZoom src={CopyWebhookURL} alt="Copy 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 -i scroll-monitor oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-monitor -n $(NAMESPACE) \
--version=0.0.4 \
--values ./values/alert-manager.yaml
```

0 comments on commit 10b5119

Please sign in to comment.