我正在尝试为 Azure 上的 App Insights 自定义指标创建警报。
例如,如果“我的指标”指标在 5 分钟内大于 40,则发出警报。
根据 Azure Monitor 中的自定义指标,这应该是可能的。
将它们发布到 Azure Monitor 后,你可以浏览、查询 Azure 资源和应用程序的自定义指标以及 Azure 发出的标准指标并发出警报。
我使用 App Insights Python SDK 使用此代码创建了指标(请参阅用法)。
from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.track_metric('My Metric', 42)
tc.flush()
我可以查看我创建的自定义指标。它是 Azure 门户中“指标”屏幕屏幕截图中唯一的蓝色条。
However, when I click on the New rule alert button on that screen, I'm taken to the Create rule screen but it displays the following error.
Alerts configuration via Metrics not supported if selection includes multiple resources or more than two metric signals. Please modify your selection and try again or create the rule below. Please click to see the list of supported resources.
AFAIK, I'm only using one resource (the App Insights "Dev" resource) and one metric signal (the "My Metric" metric) as you can see from the screenshot.
Any ideas on what I've done wrong or what I'm missing and how I can correct it?
I'm pretty new to Azure so I'm also open to suggestions on others way of alerting on a custom metric.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句