リソースタイプ | resource_nameフィールド | record_idフィールド | record_tagフィールド | 例 | 補足 |
ユーザー | sls.common.user | user_id | user_name | {
"user_id": "alex",
"user_name": "Alex",
"email": [
"***@example.com"
],
"country_code": "86",
"phone": "133********3333",
"enabled": true,
"sms_enabled": true,
"voice_enabled": true
}
| なし。 |
ユーザーグループ | sls.common.us er_group | user_group_id | user_group_name | {
"user_group_id": "devops",
"user_group_name": "DevOps Team",
"enabled": true,
"members": [
"alex"
]
}
| なし。 |
稼働中グループ | sls.alert.oncall_group | oncall_id | oncall_name | {
"oncall_id": "default_oncall",
"oncall_name": "Default Oncall",
"enabled": true,
"overrides": [],
"rotations": [
{
"targets": [
{
"type": "user",
"target_id": "alex"
},
{
"type": "user_group",
"target_id": "devops"
}
],
"end_time": 0,
"shift_day": "",
"shift_time": "12:00",
"shift_type": "day",
"start_time": 1633017600,
"shift_minute": 0,
"end_time_type": "none",
"shift_interval": 1,
"shift_week_custom": null,
"restriction_date_type": "workday",
"restriction_time_type": "allday",
"restriction_week_range": null,
"restriction_time_custom_range": null
}
],
"calendar_id": "default_calendar"
}
| この構成は複雑である。 Simple Log Serviceコンソールで設定を完了することを推奨します。 |
Webhookの統合 | sls.alert.action_webhook | id | name | {
"id": "custom-webhook",
"name": "Custom Webhook",
"type": "custom",
"url": "http://localhost:9099/data/webhook",
"method": "POST",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Foo",
"value": "bar"
}
]
}
{
"id": "dingtalk",
"name": "Dingtalk Webhook",
"type": "dingtalk",
"url": "https://oapi.dingtalk.com/robot/send?access_token=**********",
"method": "POST",
"secret": "SEC**********",
"headers": []
}
| typeをwebhookのタイプに設定します。 有効な値: カスタムを除くすべての型について、methodをPOSTに設定し、headersを空の配列に設定します。 dingtalkチャットボットの作成時にtypeをDingTalkに設定し、セキュリティ設定に追加の署名を選択した場合、またはタイプをlarkに設定し、Larkボットの作成時にセキュリティ設定に署名検証を設定した場合は、secretフィールドを追加する必要があります。 secretフィールドの値は、DingTalkのチャットボット管理ページまたはLarkのボット管理ページで取得できます。
|
アラートポリシー | sls.alert. alert_ポリシー | policy_id | policy_name | {
"policy_id": "sls.builtin",
"policy_name": "SLS Builtin Alert Policy",
"parent_id": "sls.root",
"is_default": false,
"group_script": "fire(action_policy=\"sls.builtin\", group={\"project\": \"__a__\", \"uid\": alert.aliuid}, group_wait=\"5s\", group_interval=\"2m\", repeat_interval=\"2m\")\nstop()\nfire(action_policy=\"sls.builtin\", group={\"alert_id\": alert.alert_id}, group_wait=\"5s\", group_interval=\"10s\", repeat_interval=\"2m\")\nif alert.labels.name ~= \"^\\\\w+s$\":\n\tfire(action_policy=\"sls.builtin\", group={\"product\": \"xxs\"}, group_wait=\"5s\", group_interval=\"10s\", repeat_interval=\"2m\")\n\tstop()\nstop()\nfire(action_policy=\"sls.builtin\", group={\"label_name\": alert.labels.name}, group_wait=\"10s\", group_interval=\"10s\", repeat_interval=\"2m\")",
"inhibit_script": "if alert.severity >= 8:\n silence alert.severity < 6",
"silence_script": ""
}
| _defaultをfalseに設定します。 group_scriptをマージポリシーに設定します。 inhibition_scriptを禁止ポリシーに設定します。 silence_scriptを無音ポリシーに設定します。 SDKを使用して設定を実行する場合、group_script、inhibit_script、およびsilence_scriptにはドメイン固有言語 (DSL) スクリプト情報のみが含まれ、UI設定情報は含まれません。 したがって、Simple Log Serviceコンソールでアラートポリシーのグラフィカルな構造を表示することはできません。
|
アクションポリシー | sls.alert.action_policy | action_policy_id | action_policy_name | {
"action_policy_id": "sls.builtin",
"action_policy_name": "SLS Builtin Action Policy",
"labels": {},
"is_default": false,
"primary_policy_script": "fire(type=\"webhook_integration\", integration_type=\"dingtalk\", webhook_id=\"dingtalk-test\", template_id=\"default-template\", period=\"any\")",
"secondary_policy_script": "fire(type=\"voice\", users=[\"jizhi\"], groups=[\"group-jizhi\"], template_id=\"default-template\")",
"escalation_start_enabled": false,
"escalation_start_timeout": "10s",
"escalation_inprogress_enabled": false,
"escalation_inprogress_timeout": "10s",
"escalation_enabled": false,
"escalation_timeout": "4h0m0s"
}
| _defaultをfalseに設定します。 ラベルを空のオブジェクトに設定します。 labelsは予約済みパラメータです。 primary_policy_scriptをプライマリアクションポリシーに設定します。 secondary_policy_scriptをセカンダリアクションポリシーに設定します。 エスカレーション_* を設定して、セカンダリアクションポリシーを有効にするかどうかを決定します。 詳細については、Simple Log Serviceコンソールの設定項目をご参照ください。 SDKを使用して設定を実行する場合、primary_policy_scriptおよびsecondary_policy_scriptにはDSLスクリプト情報のみが含まれ、UI設定情報は含まれません。 したがって、Simple Log Serviceコンソールでアクションポリシーのグラフィカルな構造を表示することはできません。
|
アラートンプレート | sls.alert.content_template | template_id | template_name | {
"template_id": "default-template",
"template_name": "Default Template",
"is_default": false,
"templates": {
"fc": {
"limit": 0,
"locale": "zh-CN",
"content": "",
"send_type": "merged"
},
"sms": {
"locale": "zh-CN",
"content": ""
},
"lark": {
"title": "Alerthub alert test ${alert_name}",
"locale": "zh-CN",
"content": ""
},
"email": {
"locale": "zh-CN",
"content": "",
"subject": "SLS alert test-jizhi-test"
},
"slack": {
"title": "Alerthub alert test ${alert_name}",
"locale": "zh-CN",
"content": ""
},
"voice": {
"locale": "zh-CN",
"content": ""
},
"wechat": {
"title": "Alerthub alert test ${alert_name}",
"locale": "zh-CN",
"content": ""
},
"webhook": {
"limit": 0,
"locale": "zh-CN",
"content": "",
"send_type": "batch"
},
"dingtalk": {
"title": "Alerthub alert test ${alert_name}",
"locale": "zh-CN",
"content": ""
},
"event_bridge": {
"locale": "zh-CN",
"content": "",
"subject": "wkb-test"
},
"message_center": {
"locale": "zh-CN",
"content": ""
}
}
}
| _defaultをfalseに設定します。 使用する通知方法ごとに、templatesをアラートテンプレートに設定します。 通知方法でcontentが空の場合、通知方法にはデフォルトのアラートテンプレートが使用されます。 詳細については、「デフォルトのアラートテンプレート」をご参照ください。 localeをzh-CNまたはen-USに設定します。 webhookおよびfc通知方法の場合、send_typeをsingleまたはbatchに設定します。 単一の値は、Simple Log Serviceが各アラートの通知を送信することを示します。 値batchは、Simple Log Serviceがアラートをアラートセットにマージし、アラートセットに対して1つの通知のみを送信することを示します。
|
デフォルトのカレンダー | sls.common.calendar | calendar_id | calendar_name | {
"calendar_id": "default_calendar",
"calendar_name": "Default Calendar",
"timezone": "Asia/Shanghai",
"workdays": [
1,
2,
3,
4,
5
],
"worktime": [
{
"end_time": "21:00",
"start_time": "09:00"
}
],
"reset_days": [],
"holiday_sync": "china"
}
| |