【问题标题】:monitoring azure-iot deployments via azure-cli通过 azure-cli 监控 azure-iot 部署
【发布时间】:2020-08-12 11:27:15
【问题描述】:

背景

我正在使用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)

问题:

我怎样才能让那些metrics 回来没有有 CLI 已弃用的扩展版本?

【问题讨论】:

  • 当你说az iot edge deployment show-metric“停止工作”时,你是什么意思?有错误吗?
  • 我在管道中使用相同的,只是查看了我的日志,一切似乎都在工作。您的管道是否正确传递了deploymentId 参数?该错误看起来好像它无法解析参数。

标签: azure azure-iot-hub azure-cli azure-iot-edge


【解决方案1】:

引用 Azure 支持团队的回答:

我刚刚收到我们产品组的更新。他们已告知 我说在 azure-cli-iot-ext 0.8.7 之前,物联网边缘部署 show-metric 仅适用于系统指标。之后,一场争论 引入了让用户能够在系统和 用户指标,但要匹配 iot hub 配置 show-metric,用户 指标成为默认值(延续到 azure-iot)。

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

例如:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-02
    • 2017-09-15
    • 1970-01-01
    • 2021-08-14
    • 1970-01-01
    • 1970-01-01
    • 2020-09-04
    • 1970-01-01
    相关资源
    最近更新 更多