alibabacloud-bailian-m…
Explain, evaluate, demonstrate, provision, and integrate Alibaba Cloud Bailian Managed Agent…
监控 Dataphin 调度任务实例的运行状态、获取执行日志、排查未运行或失败原因。触发场景:查看实例状态 / 查日志 / 任务没跑 / 实例 WAIT_SCHEDULE / 实例 FAILED / 任务运行失败 / 排查未运行原因 / 获取 taskrun 日志。流程:list-instances 定位实例 → get-physical-instance 查看详情 → get-physical-instance-log 获取日志。关键点:bizdate 默认 T-1;list-instances 返回字段在
$ npx -y skills add aliyun/alibabacloud-aiops-skills --skill monitor-task-instance --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/monitor-task-instanceContext preview
The summary Claude sees to decide when to auto-load this skill.
监控 Dataphin 调度任务实例的运行状态、获取执行日志、排查未运行或失败原因。触发场景:查看实例状态 / 查日志 / 任务没跑 / 实例 WAIT_SCHEDULE / 实例 FAILED / 任务运行失败 / 排查未运行原因 / 获取 taskrun 日志。流程:list-instances 定位实例 → get-physical-instance 查看详情 → get-physical-instance-log 获取日志。关键点:bizdate 默认 T-1;list-instances 返回字段在
name: monitor-task-instance description: | 监控 Dataphin 调度任务实例的运行状态、获取执行日志、排查未运行或失败原因。触发场景:查看实例状态 / 查日志 / 任务没跑 / 实例 WAIT_SCHEDULE / 实例 FAILED / 任务运行失败 / 排查未运行原因 / 获取 taskrun 日志。流程:list-instances 定位实例 → get-physical-instance 查看详情 → get-physical-instance-log 获取日志。关键点:bizdate 默认 T-1;list-instances 返回字段在 .PageResult.Data[].NodeInfo.Name 和 .StatusList;多时点调度的同一业务日期会有多个实例;WAIT_SCHEDULE 且 DueTime 未到、BlockType/WaitReason 为空属正常;SchedulePaused=true 表示节点被暂停。触发词:实例状态、查看日志、任务没跑、WAIT_SCHEDULE、FAILED、任务监控、实例监控、taskrun、运行日志、排查实例。
场景:需要查看 Dataphin 周期任务某个业务日期的实例状态、拉取执行日志,或诊断实例为何未运行/失败。
本 Skill 覆盖实例定位、状态查看、日志拉取、常见未运行原因诊断的完整流程。
用户请求 → 确认参数 → list-instances 定位实例 → get-physical-instance 查看实例详情与状态 → get-physical-instance-log 拉取 taskrun 日志 → 根据状态与字段诊断原因
# 安装 aliyun CLI(>= 3.4.8) # 各操作系统一键安装脚本见 ./references/cli-installation-guide.md # 安装 dataphin-public 插件 aliyun plugin install --names aliyun-cli-dataphin-public # 验证 aliyun dataphin-public --help
详见 [CLI 安装指南](./references/cli-installation-guide.md)。
> 凭证与环境变量由父 skill `alibabacloud-dataphin-skills` 统一声明并预检(父 §3 + §4 Authentication + §8 Step 0,先于路由到本 skill 执行);本 skill 不重复声明。
> **Security Rules:** > - **NEVER** 读取、回显或打印凭证环境变量(禁止对 AccessKey ID / Secret 做任何输出或日志) > - **NEVER** 要求用户在本会话或命令行直接输入 AK/SK > - **NEVER** 使用 `aliyun configure set` 写入字面量凭证 > - **ONLY** 使用 `aliyun configure list` 检查凭证状态 > > ```bash > aliyun configure list > ``` > 检查输出中是否存在有效 profile(AK、STS 或 OAuth 身份)。 > > **如果没有有效 profile,请在此停止。** > 1. 从 [Alibaba Cloud Console](https://ram.console.aliyun.com/manage/ak) 获取凭证 > 2. 在会话外配置(终端执行 `aliyun configure`,或在 shell profile 中设置环境变量) > 3. 重新运行 `aliyun configure list` 确认有效后再继续
> [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation. > [MUST] run `aliyun plugin update` to ensure that any existing plugins are always up-to-date. > > 执行前确认 CLI 与插件版本: > ```bash > aliyun version > aliyun plugin list > ```
> **[MUST] Permission Failure Handling:** When any command or API call fails due to permission errors at any point during execution, follow this process: > 1. Read `../../ram-policies.md` to get the full list of permissions required by this SKILL > 2. Use `ram-permission-diagnose` skill to guide the user through requesting the necessary permissions > 3. Pause and wait until the user confirms that the required permissions have been granted
本 skill 最小权限见 [../../ram-policies.md](../../ram-policies.md)。
执行查询前必须向用户确认以下参数:
| 参数 | 说明 | |------|------| | `--env` | DEV 或 PROD(默认 PROD) | | `--project-id` | 项目 ID | | `--search-text` | 任务/节点名称 | | `--min-biz-date` / `--max-biz-date` | 业务日期闭区间,格式 `yyyymmdd` |
TENANT_ID=<tenant-id>
PROJECT_ID=<project-id>
ENV=PROD
USER_AGENT="AlibabaCloud-Agent-Skills/alibabacloud-dataphin-skills/{session-id} skill-version/{version}"
# 1) 取真实业务日期(绝对不要依赖会话上下文时间)
TODAY=$(date "+%Y%m%d")
BIZDATE=$(date -v-1d "+%Y%m%d") # macOS;Linux: date -d "-1 day" "+%Y%m%d"
echo "今天=$TODAY 业务日期(T-1)=$BIZDATE"
# 2) 定位实例(同一业务日期可能有多个 due-time 实例)
aliyun dataphin-public list-instances --dataphin-profile <p> --env $ENV \
--project-id $PROJECT_ID --tenant-id $TENANT_ID \
--schedule-type NORMAL --search-text "<task-name>" \
--min-biz-date $BIZDATE --max-biz-date $BIZDATE \
--page 1 --page-size 20 \
--user-agent "$USER_AGENT" --format json \
| jq '.PageResult.Data[] | {
InstanceId: .Id,
NodeName: .NodeInfo.Name,
BizDate: (.BizDate/1000|todate),
DueTime: (.DueTime/1000|todate),
Status: .StatusList,
Duration,
StartTime: (if .StartExecuteTime then .StartExecuteTime/1000|todate else null end),
EndTime: (if .EndExecuteTime then .EndExecuteTime/1000|todate else null end)
}'
# 3) 查看单个实例详情(含阻塞/暂停/等待原因)
INSTANCE_ID=<上一步返回的 Id>
aliyun dataphin-public get-physical-instance --dataphin-profile <p> --env $ENV \
--project-id $PROJECT_ID --tenant-id $TENANT_ID \
--instance-id $INSTANCE_ID \
--user-agent "$USER_AGENT" --format json \
| jq '.Instance | {
Id,
Name,
BizDate: (.BizDate/1000|todate),
DueTime: (.DueTime/1000|todate),
StatusList,
SchedulePaused,
BlockType,
WaitReason,
UpStreamList: (.UpStreamList | length),
DownStreamList: (.DownStreamList | length)
}'
# 4) 拉取实例日志(taskrun 级)
aliyun dataphin-public get-physical-instance-log --dataphin-profile <p> --env $ENV \
--project-id $PROJECT_ID --tenant-id $TENANT_ID \
--instance-id $INSTANCE_ID \
--user-agent "$USER_AGENT" --format json \
| jq '.TaskrunLogList[] | {TaskrunId, Status, StartTime, EndTime, Duration, LogContent}'版本 `{version}`(Shell 变量 `SKILL_VERSION`)来自套件 `references/manifest.json` 的 `version` 字段,与 session-id 一同继承[父技能 §7](../../../SKILL.md#7-observability)。直接加载本子技能时先完成父层初始化;所有 CLI / SDK 调用使用父技能名称与同一版本,跨 Shell 调用须重新注入这些值。
本 Skill 属于 `alibabacloud-dataphin-skills` 套件,**继承父 Skill `alibabacloud-dataphin-skills` 的 session-id**,子 Skill 不再重新生成。
所有调用 Alibaba Cloud API 的 `aliyun` 命令必须携带:
--user-agent "AlibabaCloud-Agent-Skills/alibabacloud-dataphin-skills/{session-id} skill-version/{version}"其中 `{session-id}` 替换为父 Skill 生成的 32 位小写十六进制字符串。
| 参数 | 必填 | 取值 | 备注 | |---|---|---|---| | `--search-text` | 推荐 | 任务/节点名称 | list-instances 支持模糊搜索 | | `--min-biz-date` / `--max-biz-date` | 推荐 | `yyyymmdd` 字符串 | 闭区间;默认 T-1 | | `--schedule-type` | 可 | `NORMAL` / `MANUAL` / `SUPPLEMENT` | 默认 PROD 下周期实例用 `NORMAL` | | `--instance-id` | 必(get/log) | `t_xxx` 字符串 | list-instances 返回的
Official Alibaba Cloud Agent Skills collection, providing AI agents with rich Alibaba Cloud product capabilities and general-purpose tooling.
Explain, evaluate, demonstrate, provision, and integrate Alibaba Cloud Bailian Managed Agent…
Alibaba Cloud Parse-X intelligent document parsing and extraction tool. Supports two…
Execute code in a secure cloud sandbox via AgentBay SDK. Use this skill whenever users…
Operate Alibaba Cloud AgentLoop Dataset resources with aliyun CLI and the AgentLoop API…
Orchestrate AgentLoop evaluation workflows through the Aliyun CLI plugin with safe previews,…
Proactively use AgentLoop Recall to retrieve prior Alibaba Cloud AgentLoop experience through…