我正在 Azure Monitor 中使用工作簿并尝试创建仪表板。
我的所有资源数据进入 1 个 Application Insights 资源。 我在此 Azure 帐户中创建了存储、Azure Functions、VPN、Web App 等资源。 我正在使用一项订阅。
我正在尝试在请求表上运行查询
我想为特定的 WebApp 创建仪表板,即“ABC”
或者
我想为资源 WebApp、Azure Function、Storage 创建 1 个仪表板,其名称包含“XYZ” requests 表不包含 resourcesid 列。我应该使用哪个其他表来获取资源类型和资源 id、名称
最佳答案
我在登录常见应用洞察资源时遇到了同样的问题。
据我所知,所有不同的日志应用程序之间没有共同的属性,我可以用来确定遥测源。
我最终的结果是使用遥测初始值设定项向所有遥测添加自定义属性(可以在启动期间添加,例如在 Azure Functions 以及 AppService 中添加)。对于Storage,不知道是否也可以这样做。
// C# sample for the initializer
public class ComponentNameTelemetryInitializer : ITelemetryInitializer
{
private readonly string _ComponentName;
public ComponentNameTelemetryInitializer(string assemblyName)
{
_ComponentName = assemblyName;
}
public void Initialize(ITelemetry telemetry)
{
if (telemetry is ISupportProperties propTelemetry)
{
propTelemetry.Properties["ComponentName"] = _ComponentName;
}
}
}
这样我就可以过滤自定义维度 ComponentName 的日志,并获取来自特定应用程序的所有条目。
关于azure - 请求表 Azure Application Insights 哪个操作属于哪个资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72239271/