Skip to content

Commit d42e8e8

Browse files
authored
Merge pull request #411 from flashcatcloud/docs/member-notify-agent-instructions
openapi: add agent_instructions to MemberNotifyResponse
2 parents 2659c82 + 63decdc commit d42e8e8

98 files changed

Lines changed: 2620 additions & 379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/upload.yml‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Upload documentation to Meilisearch for AI Q&A bot indexing.
22
#
3+
# Every run syncs the whole doc set: all docs are upserted and index documents
4+
# whose source file is gone are deleted.
5+
#
36
# Uses GitHub Environments for dev/prod separation. Create two environments in
47
# Settings > Environments: "development" and "production".
58
#
69
# Per-environment secrets (all required, keep as secrets to hide Meilisearch endpoint):
710
# MEILI_ENDPOINT - Meilisearch instance URL
8-
# MEILI_API_KEY - API key with documents write permission
11+
# MEILI_API_KEY - API key with documents read/write permission
912
# MEILI_INDEX - Target index name
1013
#
1114
# Branch mapping: main -> production, test -> development
@@ -29,22 +32,19 @@ on:
2932
options:
3033
- production
3134
- development
32-
full_upload:
33-
description: 'Re-upload all docs (use after clearing index or changing settings)'
34-
required: false
35-
default: false
36-
type: boolean
3735

3836
jobs:
3937
upload:
4038
runs-on: ubuntu-latest
4139
environment: ${{ github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'production' || 'development') }}
40+
# One sync per index at a time: an older run listing the index while a
41+
# newer one uploads would delete the newer run's added docs.
42+
concurrency:
43+
group: meilisearch-upload-${{ github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'production' || 'development') }}
44+
cancel-in-progress: false
4245
steps:
4346
- name: Checkout
4447
uses: actions/checkout@v4
45-
with:
46-
# Need history for git diff in incremental mode
47-
fetch-depth: 2
4848

4949
- name: Install dependencies
5050
run: |
@@ -57,7 +57,6 @@ jobs:
5757
MEILI_ENDPOINT: ${{ secrets.MEILI_ENDPOINT }}
5858
MEILI_API_KEY: ${{ secrets.MEILI_API_KEY }}
5959
MEILI_INDEX: ${{ secrets.MEILI_INDEX }}
60-
FULL_UPLOAD: ${{ github.event.inputs.full_upload || 'false' }}
6160
run: |
6261
chmod +x ./scripts/upload.sh
6362
bash ./scripts/upload.sh

‎api-reference/monitors.openapi.en.json‎

Lines changed: 94 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5923,6 +5923,7 @@
59235923
"items": {
59245924
"$ref": "#/components/schemas/InvestigationTarget"
59255925
},
5926+
"maxItems": 20,
59265927
"description": "Drill-down entries linked from the alert event detail page; at most 20 items, duplicates rejected. On update the field is presence-based: omit it to keep the current value, pass `[]` to clear.",
59275928
"x-flashduty-preserve-absence": true
59285929
},
@@ -6223,22 +6224,32 @@
62236224
},
62246225
"InvestigationTarget": {
62256226
"type": "object",
6226-
"description": "Drill-down entry linked to alert events. A deliberately closed tagged union: new kinds require explicit server support.",
6227+
"description": "Alert-event drill-down entry. A deliberately closed tagged union: new kinds require explicit server support, and unknown fields inside a target are rejected.",
62276228
"properties": {
62286229
"kind": {
62296230
"type": "string",
62306231
"enum": [
6231-
"dashboard"
6232+
"dashboard",
6233+
"query"
62326234
],
6233-
"description": "Entry type; currently only `dashboard` is supported."
6235+
"description": "Entry kind: `dashboard` opens a dashboard panel, `query` opens an Explore query. It decides whether `dashboard` or `query` must be supplied; supplying the other one is rejected."
6236+
},
6237+
"time_range": {
6238+
"$ref": "#/components/schemas/InvestigationTimeRange",
6239+
"description": "Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor."
6240+
},
6241+
"query": {
6242+
"$ref": "#/components/schemas/QueryInvestigationTarget",
6243+
"description": "Configuration for the `query` kind; required when `kind` is `query`, and rejected when `kind` is `dashboard`."
62346244
},
62356245
"dashboard": {
62366246
"$ref": "#/components/schemas/DashboardInvestigationTarget",
62376247
"description": "Configuration for the `dashboard` kind; required when `kind` is `dashboard`."
62386248
}
62396249
},
62406250
"required": [
6241-
"kind"
6251+
"kind",
6252+
"time_range"
62426253
]
62436254
},
62446255
"DashboardInvestigationTarget": {
@@ -6253,37 +6264,103 @@
62536264
"type": "string",
62546265
"description": "Panel ID inside the dashboard; must be a canonical UUIDv7. Optional."
62556266
},
6256-
"variable_bindings": {
6267+
"variables": {
62576268
"type": "object",
62586269
"additionalProperties": {
6259-
"$ref": "#/components/schemas/InvestigationVariableBinding"
6270+
"type": "string"
62606271
},
6261-
"description": "Dashboard variable bindings, keyed by dashboard variable name."
6272+
"description": "Dashboard variable values, keyed by variable name. Values may reference event labels through `{{ }}` templates; defaults to an empty object."
6273+
}
6274+
},
6275+
"required": [
6276+
"dashboard_id",
6277+
"variables"
6278+
]
6279+
},
6280+
"InvestigationTimeRange": {
6281+
"type": "object",
6282+
"description": "Window around the alert event time, expressed as two offsets. Both directions must be non-negative and at least one must be greater than zero, so an entry never resolves to an empty window.",
6283+
"properties": {
6284+
"before_seconds": {
6285+
"type": "integer",
6286+
"format": "int64",
6287+
"minimum": 0,
6288+
"maximum": 9007199254740,
6289+
"description": "Seconds to look back from the event time."
6290+
},
6291+
"after_seconds": {
6292+
"type": "integer",
6293+
"format": "int64",
6294+
"minimum": 0,
6295+
"maximum": 9007199254740,
6296+
"description": "Seconds to look forward from the event time, so behaviour after the event stays visible."
62626297
}
62636298
},
62646299
"required": [
6265-
"dashboard_id"
6300+
"before_seconds",
6301+
"after_seconds"
62666302
]
62676303
},
6268-
"InvestigationVariableBinding": {
6304+
"QueryInvestigationTarget": {
62696305
"type": "object",
6270-
"description": "Binding between a dashboard variable and alert event data.",
6306+
"description": "Explore query used by a `query` drill-down entry. The expression may reference event labels through `{{ }}` templates, while `args` values may not.",
62716307
"properties": {
6272-
"source": {
6308+
"datasource_id": {
6309+
"type": "integer",
6310+
"format": "int64",
6311+
"minimum": 1,
6312+
"maximum": 9007199254740991,
6313+
"description": "Data source the query runs against."
6314+
},
6315+
"query": {
6316+
"$ref": "#/components/schemas/DashboardQuery",
6317+
"description": "Query payload."
6318+
}
6319+
},
6320+
"required": [
6321+
"datasource_id",
6322+
"query"
6323+
]
6324+
},
6325+
"DashboardQuery": {
6326+
"type": "object",
6327+
"description": "Query payload shared by dashboards and drill-down entries.",
6328+
"properties": {
6329+
"mode": {
62736330
"type": "string",
62746331
"enum": [
6275-
"event_label"
6332+
"instant",
6333+
"range",
6334+
"window"
62766335
],
6277-
"description": "Where the bound value comes from; currently only `event_label` (the alert event's label value) is supported."
6336+
"description": "Evaluation mode: `instant` evaluates at a single timestamp, `range` evaluates a stepped series, `window` returns raw rows inside a time window."
62786337
},
6279-
"key": {
6338+
"expr": {
62806339
"type": "string",
6281-
"description": "Alert event label name; must follow Prometheus label naming rules and must not be a reserved label."
6340+
"description": "Query expression in the target data source's language. May reference event labels through `{{ }}` templates."
6341+
},
6342+
"args": {
6343+
"type": "object",
6344+
"additionalProperties": {
6345+
"type": "string"
6346+
},
6347+
"description": "Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain `{{ }}` templates."
6348+
},
6349+
"min_step_seconds": {
6350+
"type": [
6351+
"integer",
6352+
"null"
6353+
],
6354+
"format": "int64",
6355+
"minimum": 1,
6356+
"maximum": 9007199254740,
6357+
"description": "Minimum step, in seconds. Only accepted when `mode` is `range`, and must be greater than zero; omit or pass null to let the server decide."
62826358
}
62836359
},
62846360
"required": [
6285-
"source",
6286-
"key"
6361+
"mode",
6362+
"expr",
6363+
"args"
62876364
]
62886365
}
62896366
}

‎api-reference/monitors.openapi.zh.json‎

Lines changed: 94 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5923,6 +5923,7 @@
59235923
"items": {
59245924
"$ref": "#/components/schemas/InvestigationTarget"
59255925
},
5926+
"maxItems": 20,
59265927
"description": "告警事件详情页关联的排障入口列表,最多 20 项,不允许重复。更新接口中该字段按 presence 处理:省略时保留原配置,传 `[]` 清空。",
59275928
"x-flashduty-preserve-absence": true
59285929
},
@@ -6223,22 +6224,32 @@
62236224
},
62246225
"InvestigationTarget": {
62256226
"type": "object",
6226-
"description": "告警事件的关联排障入口,为封闭的 tagged union:新增类型需服务端显式支持。",
6227+
"description": "告警事件的关联排障入口,为封闭的 tagged union:新增类型需服务端显式支持,入口内出现未知字段会被拒绝。",
62276228
"properties": {
62286229
"kind": {
62296230
"type": "string",
62306231
"enum": [
6231-
"dashboard"
6232+
"dashboard",
6233+
"query"
62326234
],
6233-
"description": "排障入口类型,目前仅支持 `dashboard`。"
6235+
"description": "入口类型:`dashboard` 打开仪表盘面板,`query` 打开 Explore 查询。它决定必须提供 `dashboard` 还是 `query`,提供另一个会被拒绝。"
6236+
},
6237+
"time_range": {
6238+
"$ref": "#/components/schemas/InvestigationTimeRange",
6239+
"description": "事件时间前后的取数窗口,每个已保存的入口都必填。长度为 0 的窗口会被拒绝;默认值由前端编辑器提供。"
6240+
},
6241+
"query": {
6242+
"$ref": "#/components/schemas/QueryInvestigationTarget",
6243+
"description": "`query` 类型的入口配置;`kind` 为 `query` 时必填,`kind` 为 `dashboard` 时不允许出现。"
62346244
},
62356245
"dashboard": {
62366246
"$ref": "#/components/schemas/DashboardInvestigationTarget",
62376247
"description": "`dashboard` 类型的入口配置;`kind` 为 `dashboard` 时必填。"
62386248
}
62396249
},
62406250
"required": [
6241-
"kind"
6251+
"kind",
6252+
"time_range"
62426253
]
62436254
},
62446255
"DashboardInvestigationTarget": {
@@ -6253,37 +6264,103 @@
62536264
"type": "string",
62546265
"description": "仪表盘内目标面板 ID,须为规范的 UUIDv7;可选。"
62556266
},
6256-
"variable_bindings": {
6267+
"variables": {
62576268
"type": "object",
62586269
"additionalProperties": {
6259-
"$ref": "#/components/schemas/InvestigationVariableBinding"
6270+
"type": "string"
62606271
},
6261-
"description": "仪表盘变量绑定,键为仪表盘变量名。"
6272+
"description": "仪表盘变量取值,键为变量名。值可通过 `{{ }}` 模板引用事件标签;默认空对象。"
6273+
}
6274+
},
6275+
"required": [
6276+
"dashboard_id",
6277+
"variables"
6278+
]
6279+
},
6280+
"InvestigationTimeRange": {
6281+
"type": "object",
6282+
"description": "以两个偏移量表示告警事件时间前后的取数窗口。两个方向都必须非负,且至少一个大于 0,因此入口不会解析出空窗口。",
6283+
"properties": {
6284+
"before_seconds": {
6285+
"type": "integer",
6286+
"format": "int64",
6287+
"minimum": 0,
6288+
"maximum": 9007199254740,
6289+
"description": "相对事件时间向前回溯的秒数。"
6290+
},
6291+
"after_seconds": {
6292+
"type": "integer",
6293+
"format": "int64",
6294+
"minimum": 0,
6295+
"maximum": 9007199254740,
6296+
"description": "相对事件时间向后延伸的秒数,用于保留事件发生后的表现。"
62626297
}
62636298
},
62646299
"required": [
6265-
"dashboard_id"
6300+
"before_seconds",
6301+
"after_seconds"
62666302
]
62676303
},
6268-
"InvestigationVariableBinding": {
6304+
"QueryInvestigationTarget": {
62696305
"type": "object",
6270-
"description": "仪表盘变量与告警事件数据的绑定。",
6306+
"description": "`query` 类型入口使用的 Explore 查询。表达式可通过 `{{ }}` 模板引用事件标签,`args` 的值不允许包含模板。",
62716307
"properties": {
6272-
"source": {
6308+
"datasource_id": {
6309+
"type": "integer",
6310+
"format": "int64",
6311+
"minimum": 1,
6312+
"maximum": 9007199254740991,
6313+
"description": "查询所用的数据源。"
6314+
},
6315+
"query": {
6316+
"$ref": "#/components/schemas/DashboardQuery",
6317+
"description": "查询内容。"
6318+
}
6319+
},
6320+
"required": [
6321+
"datasource_id",
6322+
"query"
6323+
]
6324+
},
6325+
"DashboardQuery": {
6326+
"type": "object",
6327+
"description": "仪表盘与排障入口共用的查询内容。",
6328+
"properties": {
6329+
"mode": {
62736330
"type": "string",
62746331
"enum": [
6275-
"event_label"
6332+
"instant",
6333+
"range",
6334+
"window"
62766335
],
6277-
"description": "绑定值来源,目前仅支持 `event_label`(取告警事件的标签值)。"
6336+
"description": "求值模式:`instant` 在单个时间点求值,`range` 求值一条按步长采样的曲线,`window` 返回时间窗口内的原始数据。"
62786337
},
6279-
"key": {
6338+
"expr": {
62806339
"type": "string",
6281-
"description": "告警事件标签名,须符合 Prometheus 标签命名规则,且不能使用保留标签。"
6340+
"description": "目标数据源语法下的查询表达式,可通过 `{{ }}` 模板引用事件标签。"
6341+
},
6342+
"args": {
6343+
"type": "object",
6344+
"additionalProperties": {
6345+
"type": "string"
6346+
},
6347+
"description": "命名查询参数,默认空对象。值按原样透传,不允许包含 `{{ }}` 模板。"
6348+
},
6349+
"min_step_seconds": {
6350+
"type": [
6351+
"integer",
6352+
"null"
6353+
],
6354+
"format": "int64",
6355+
"minimum": 1,
6356+
"maximum": 9007199254740,
6357+
"description": "最小步长(秒)。仅在 `mode` 为 `range` 时可用,且必须大于 0;省略或传 null 由服务端决定。"
62826358
}
62836359
},
62846360
"required": [
6285-
"source",
6286-
"key"
6361+
"mode",
6362+
"expr",
6363+
"args"
62876364
]
62886365
}
62896366
}

0 commit comments

Comments
 (0)