通过azure-cli监视azure-iot部署

问题描述

背景

我正在使用Azure-cli(版本> 2.3.1)到create IoT Edge deployments

echo az iot edge deployment create --content $(iotDeploymentPath) --deployment-id $(deploymentId) --hub-name  ${hub} --priority $(priority) --target-condition "tags.location.place='$(env)'"

getting the metrics

targetedCount="$(az iot edge deployment show-metric --deployment-id $(deploymentId) --metric-id targetedCount  --hub-name ${hub})"
appliedCount="$(az iot edge deployment show-metric --deployment-id $(deploymentId) --metric-id appliedCount  --hub-name ${hub})"
reportedSuccessfulCount="$(az iot edge deployment show-metric --deployment-id $(deploymentId) --metric-id reportedSuccessfulCount   --hub-name ${hub})"

几天前,我们在尝试接收部署指标时收到以下错误消息:

指标“ targetedCount”未在设备配置中定义 $(deploymentId)

指标“ appliedCount”未在设备配置中定义 $(deploymentId)

未在设备中定义指标“ reportedSuccessfulCount” 配置$(deploymentId)

带有以下贬损消息:

此扩展名“ azure-cli-iot-ext”已弃用,并计划于 去除。请删除并添加“ azure-iot”。

所以我已经安装了'azure-iot'而不是'azure-cli-iot-ext',但是现在看来 az iot edge deployment show-metric停止工作,并继续发送上述错误消息。

指标“ targetedCount”未在设备配置中定义 $(deploymentId)

指标“ appliedCount”未在设备配置中定义 $(deploymentId)

未在设备中定义指标“ reportedSuccessfulCount” 配置$(deploymentId)

问题:

如何在不使用CLI弃用爆炸版本的情况下,找回这些metrics

解决方法

引用Azure支持团队的答案:

我刚从我们的产品组收到更新。他们已经通知 我认为在azure-cli-iot-ext 0.8.7之前,物联网边缘部署 show-metric仅适用于系统指标。之后,争论 为用户介绍了能够在系统和 用户指标,但要匹配物联网集线器配置显示指标,用户 指标成为默认值(结转到了Azure-Iot)。

此外,PG成员指出,所有导致 问题似乎是系统指标。在这种情况下,请尝试 添加--metric-type或–mt参数,其值为“ system”。

例如:

az iot edge deployment show-metric -n myiothub -d mydeployment -m targetedCount --mt system

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...