Skip to content

Commit

Permalink
[Feature] Improve SLA documentation (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxzuo authored Mar 7, 2024
1 parent 950868b commit 7c27485
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 10 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
id: 'notification-email'
title: 'email notification'
---

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: 'notification-wecombot'
title: 'weCom bot notification'
---



3 changes: 3 additions & 0 deletions docs/04-features/04-slas/02-slas-notification/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "SLAs Notifications"
}
3 changes: 3 additions & 0 deletions docs/04-features/04-slas/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Slas"
}
8 changes: 8 additions & 0 deletions i18n/zh-CN/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
"message": "执行引擎",
"description": "The label for category Data Quality Engine in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Slas": {
"message": "SLAs",
"description": "The label for category Data Quality Slas in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.SLAs Notifications": {
"message": "SLAs 通知",
"description": "The label for category Data Quality Slas Notifications in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Catalog": {
"message": "数据目录",
"description": "The label for category Catalog in sidebar tutorialSidebar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ cd datavines-dist/target
tar -zxvf datavines-1.0.0-SNAPSHOT-bin.tar.gz
```

> 注意: 此时如果前端 `datavines-ui` 打包异常, 可能是网络问题, 可以尝试更换 npm 源
找到 `datavines-ui` 项目的 pom 文件, 在 `npm install` 添加 `--registry https://registry.npmmirror.com`, 如下所示
```xml
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install --registry https://registry.npmmirror.com</arguments>
</configuration>
</execution>
```

解压完成以后进入目录
```
cd datavines-1.0.0-SNAPSHOT-bin
Expand All @@ -46,11 +61,14 @@ vi application.yaml
主要是修改数据库信息
```
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/datavines?useUnicode=true&characterEncoding=UTF-8
username: root
password: 123456
config:
activate:
on-profile: mysql
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/datavines?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 123456
```
如果你是使用Spark做为执行引擎,并且是提交到Yarn上面去执行的,那么需要在common.properties中配置yarn相关的信息
- standalone 模式
Expand All @@ -76,6 +94,22 @@ sh datavines-daemon.sh start mysql

查看日志,如果日志里面没有报错信息,并且能看到`[INFO] 2022-04-10 12:29:05.447 io.datavines.server.DatavinesServer:[61] - Started DatavinesServer in 3.97 seconds (JVM running for 4.69)`的时候,证明服务已经成功启动

### windows 打包问题
如果项目是 在 windows 中打包的 执行 `sh datavines-daemon.sh start mysql` 时可能会报以下异常
![windows打包问题](/doc/image/windows_package_script_error.png)
这是因为 Windows格式文件的换行符为\r\n , 而Unix&Linux文件的换行符为\n
此时需要执行 `dos2unix` 来转换文件格式
安装 dos2unix
```shell
yum install -y dos2unix
```
格式转换
```shell
cd bin
find . -type f -print0 | xargs -0 dos2unix
```


### 访问前端页面
在浏览器输入:localhost:5600,就会跳转至登录界面,输入账号密码 admin/123456

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
id: 'slas'
title: 'SLAs'
id: 'slas-intro'
title: 'SLAs介绍'
---
SLA 是系统的核心功能,也是通知用户的通道。用户可以给每个规则配置多个SLA来通知不同的用户群,一个SLA也可以给多个规则检查作业使用,目前系统只支持邮件。
### 邮件通道
- 在告警通道管理里面添加新的通道,填上相应的配置
- 在SLA 里面 添加告警通道,输入接收邮箱和抄送邮箱
### 配置 SLA
- 在sla中创建sla,
![创建sla](/doc/image/create_slas.png)
- 在通知里面创建一个通道
![创建通知](/doc/image/create_notify.png)
- 进去sla后,在sla中创建个通知关联上这个通道
![sla关联通知](/doc/image/slas_add_notify.png)
### SLA 使用
创建数据质量检查作业时可以在配置页面选择SLA,当检查结果为失败时会通过该SLA里面所配置的告警通道进行告警
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: 'notification-email'
title: '邮件通知'
---

## 介绍
支持用邮件通知

## 属性配置

### 通知发件人配置

| 参数 | 描述 |
| ------------------------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| mail.smtp.host | SMTP 服务器地址 |
| mail.smtp.port | SMTP 服务器端口 |
| mail.sender | 邮件发送者 |
| mail.smtp.auth | 是否需要认证 |
| mail.user | 验证用户名 |
| mail.passwd | 验证密码 |
| mail.smtp.starttls.enable | 如果为true,则在发出任何登录命令之前,允许使用STARTTLS命令(如果服务器支持)将连接切换到 TLS-protected 的连接。 如果服务器不支持STARTTLS,则在不使用TLS的情况下继续连接。 |
| mail.smtp.ssl.enable | 如果设置为true,则默认情况下使用SSL进行连接并使用SSL端口。对于“smtp”协议,默认值为false,对于“smtps”协议,则默认值为true。 |
| mail.smtp.ssl.trust | 如果已设置,并且尚未指定套接字工厂,则启用 MailSSLSocketFactory。如果设置为“*”,则所有主机都是受信任的。如果设置为以空格分隔的主机列表,则这些主机是受信任的。否则,信任取决于服务器提供的证书。 |

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: 'notification-wecombot'
title: '企业微信机器人通知'
---

## 介绍
支持用企业微信机器人通知

## 属性配置

| 参数 | 描述 |
| ------------------------- |-------------------------------------------------------------------------------------------------------------------|
| webhook | 企业微信机器人 webhook 地址. 如 `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=12345678-xxxx-xxxx-xxxx-123456789999` |

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "SLAs Notifications"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Slas"
}
Binary file added static/doc/image/create_notify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc/image/create_slas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc/image/slas_add_notify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/doc/image/windows_package_script_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7c27485

Please sign in to comment.