如何从Log Analytics获取Azure Synapse流水线活动运行的详细信息?
Azure Synapse 流水线活动指标Log Analytics查询方案
第一步:确认诊断配置正确性
- 进入Azure Synapse工作区的「诊断设置」页,确认已勾选Synapse Integration Activity Runs日志类别
- 确认日志导出目标为你当前使用的Log Analytics工作区,配置完成后需等待15分钟以上确保日志完成同步
第二步:字段逻辑说明
你之前查询报错找不到Output字段,是因为该字段没有直接暴露在表结构顶层,而是嵌套在PropertiesJSON字段内,需要先解析该字段再提取输出内容。
第三步:完整可用KQL查询示例
以下查询可直接提取复制活动的dataRead、rowsCopied等核心指标:
SynapseIntegrationActivityRuns // 仅筛选复制活动,可根据实际需求删除该行查看所有活动类型 | where ActivityType == "Copy" // 解析顶层Properties JSON字段 | extend PropertiesJson = parse_json(Properties) // 提取活动输出对象 | extend Output = PropertiesJson.Output // 提取所需核心指标 | extend dataRead = Output.dataRead, rowsCopied = Output.rowsCopied, copyDurationSec = Output.copyDuration, sourceType = Output.source.type, sinkType = Output.sink.type // 过滤掉执行失败无有效输出的记录 | where isnotempty(dataRead) // 自定义展示字段 | project PipelineName, ActivityName, ActivityRunStartTime = ActivityRunStart, ActivityRunEndTime = ActivityRunEnd, RunStatus = Status, dataRead, rowsCopied, copyDurationSec, sourceType, sinkType | order by ActivityRunStartTime desc
拓展调整说明
如果需要查询数据流、存储过程等其他活动类型的指标,可先运行以下语句查看完整字段结构,再对应调整提取逻辑:
SynapseIntegrationActivityRuns | limit 20 | extend PropertiesJson = parse_json(Properties) | project PropertiesJson
内容的提问来源于stack exchange,提问作者katebeckett
相关产品推荐
相关产品推荐

