如何在 Azure Monitor 工作簿中显示请求的折线图?

发布于 2025-01-12 05:24:31 字数 1636 浏览 0 评论 0原文

我正在尝试在 Azure Monitor 工作簿中为受到限制和不受限制的请求创建一个每分钟时间 (RPM) 图表,以两行(重叠)的形式显示。我设法用一行创建 RPM 时间表,但为每种类型的请求显示两条不同行的最佳方法是什么。

输入图片此处描述

这是图表的 KQL。考虑基于 ResultType(Throttled 和 Non-Throttled)对表(T)执行自连接,但不确定。也许有更好的解决方案。

let T = datatable(Timestamp:datetime, ResultType:string, ResultSignature:string, CorrelationId:string) [
"2022-03-02T14:25:21.8262878Z", "Throttled", "200", "be8bd024-8f5c-4a01-9703-2945ef3bc8ba",
"2022-03-02T14:25:35.3729584Z", "Throttled", "200", "66ed2194-ffa2-43ae-96f4-d3d8d1fb4c4d",
"2022-03-02T14:25:35.5681385Z", "Throttled", "200", "37b33938-0498-4e66-b16e-8c77ac9cf6b9",
"2022-03-02T14:25:35.9571988Z", "Throttled", "200", "cc9a0638-37b2-4c25-8578-8df206896de0",
"2022-03-02T14:25:38.1975426Z", "Throttled", "200", "2b70359d-1732-4cfe-8eda-ef993bbd638a",
"2022-03-02T14:25:38.3044257Z", "Throttled", "200", "9143b5fc-c074-467a-bb97-9765e698e3ff",
"2022-03-02T14:25:40.0240219Z", "Throttled", "200", "8cd18445-556e-44fe-81d8-38e261fddb02",
"2022-03-02T14:25:48.3866310Z", "Throttled", "200", "c5d21533-e1cd-484a-aee2-d05b804eecf0",
"2022-03-02T14:26:03.2572998Z", "Throttled", "200", "46c47f34-2402-45e1-ba8b-fea4d2e59640",
"2022-03-02T14:28:23.1553098Z", "Non-Throttled", "302", "fa309b65-b0b7-43d3-b3aa-9b6de6ce17cb",
"2022-03-02T14:28:23.9385460Z", "Non-Throttled", "200", "daedb13f-8b3e-4268-9803-b3bf8039d776",
    ];
T 
    | project Timestamp, ResultType, ResultSignature , CorrelationId
    | summarize TotalRequests = count() by bin(Timestamp,1m)

I am trying to create a requests per minute time (RPM) chart in Azure Monitor workbook for requests which are throttled and non-throttle in the form of two lines (overlayed). I manage to create a time chart for RPM with one line but what is the best way to show two distinct lines for each type of request.

enter image description here

Here is the KQL for the chart. Thinking to perform self-join on the table (T) based on ResultType (Throttled and Non-Throttled) but not sure about it. Maybe a better solution out there.

let T = datatable(Timestamp:datetime, ResultType:string, ResultSignature:string, CorrelationId:string) [
"2022-03-02T14:25:21.8262878Z", "Throttled", "200", "be8bd024-8f5c-4a01-9703-2945ef3bc8ba",
"2022-03-02T14:25:35.3729584Z", "Throttled", "200", "66ed2194-ffa2-43ae-96f4-d3d8d1fb4c4d",
"2022-03-02T14:25:35.5681385Z", "Throttled", "200", "37b33938-0498-4e66-b16e-8c77ac9cf6b9",
"2022-03-02T14:25:35.9571988Z", "Throttled", "200", "cc9a0638-37b2-4c25-8578-8df206896de0",
"2022-03-02T14:25:38.1975426Z", "Throttled", "200", "2b70359d-1732-4cfe-8eda-ef993bbd638a",
"2022-03-02T14:25:38.3044257Z", "Throttled", "200", "9143b5fc-c074-467a-bb97-9765e698e3ff",
"2022-03-02T14:25:40.0240219Z", "Throttled", "200", "8cd18445-556e-44fe-81d8-38e261fddb02",
"2022-03-02T14:25:48.3866310Z", "Throttled", "200", "c5d21533-e1cd-484a-aee2-d05b804eecf0",
"2022-03-02T14:26:03.2572998Z", "Throttled", "200", "46c47f34-2402-45e1-ba8b-fea4d2e59640",
"2022-03-02T14:28:23.1553098Z", "Non-Throttled", "302", "fa309b65-b0b7-43d3-b3aa-9b6de6ce17cb",
"2022-03-02T14:28:23.9385460Z", "Non-Throttled", "200", "daedb13f-8b3e-4268-9803-b3bf8039d776",
    ];
T 
    | project Timestamp, ResultType, ResultSignature , CorrelationId
    | summarize TotalRequests = count() by bin(Timestamp,1m)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁的年少不轻狂 2025-01-19 05:24:31

您可以添加 ResultType 作为聚合键。

即你可以替换它:

|总结 TotalRequests = count() by bin(Timestamp,1m)

如下:

|总结 TotalRequests = count() by ResultType, bin(Timestamp,1m)

you can add ResultType as an aggregation key.

i.e. you can replace this:

| summarize TotalRequests = count() by bin(Timestamp,1m)

with this:

| summarize TotalRequests = count() by ResultType, bin(Timestamp,1m)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文