标签: azure-application-insights

按 API 名称分组,但忽略参数 - Application Insights

我正在使用应用程序洞察来监控应用程序中的 API 使用情况。我正在尝试生成一份报告来列出过去 2 个月内调用特定 API 的次数。这是我的查询

requests
| where timestamp >= ago(24*60h)
| summarize count() by name
| order by count_ desc
Run Code Online (Sandbox Code Playgroud)

问题在于 API 的“名称”也随 URL 附加了参数,因此相同的 API 会在结果集中多次出现,且参数不同(例如 GET api/getTasks/1、GET api/getTasks/ 2)。我尝试查看“请求”架构以检查是否有一个我可以使用的列,其中包含不带参数的 API 名称,但找不到它。有没有一种方法可以按“名称”分组而无需见解参数?请帮忙查询一下。预先非常感谢。

api azure azure-diagnostics azure-application-insights

1
推荐指数
1
解决办法
1377
查看次数

调用 TelemetryClient.TrackEvent() 后是否能保证 Azure Application Insights 自定义事件的传递?

Microsoft 声明 Application Insights 的 SLA 是:

我们保证Application Insights服务的数据延迟99.9%的时间不超过两小时。

https://azure.microsoft.com/en-us/support/legal/sla/application-insights/v1_0/

对于 SLA 之外的 0.1% 时间,当 TelemetryClient.TrackEvent() 在我的代码中执行时,Microsoft 是否保证该事件肯定会在某个时间点发布(只是不是在 2 小时内)?或者事件会在这 0.1% 时间内丢失吗?

azure azure-application-insights

1
推荐指数
1
解决办法
789
查看次数

Angular 路由器事件

尝试使用 github https://github.com/sandorfr/ngx-app-insights-sample/issues/1中找到的一些 applicationinsights 服务,但该服务似乎遇到了错误

尝试按照 stackoverflow 中的建议导入一些事件

import { Injectable } from '@angular/core';
import { Router, ActivatedRoute, ResolveEnd, ActivatedRouteSnapshot } from '@angular/router';
import { Subscription } from 'rxjs';
import 'rxjs/add/operator/filter';
import { AppInsights } from 'applicationinsights-js';
import { NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators';
const environment = {
    production: false,
    appInsights: {
        instrumentationKey: 'sampleinstrumentationkey'
    }
};
@Injectable()
export class MonitoringService {

    private routerSubscription: Subscription;

    constructor(
        private router: Router,
        private activatedRoute: ActivatedRoute
    ) {
        if …
Run Code Online (Sandbox Code Playgroud)

azure-application-insights angular

1
推荐指数
1
解决办法
2005
查看次数

如何在 Krusto 查询中循环数组以获取 Azure App Insight 数据?

我遇到了一个问题,我有一个 id 数组,我需要使用 id 过滤查询的输出。我怎样才能在 Krusto 中做到这一点,因为我没有找到任何有关循环或 foreach 的运算符。

例如,现在我有一个数组

let id=dynamic(['X0001', 'X0002', 'X0003'])
Run Code Online (Sandbox Code Playgroud)

然后我必须像这样过滤输出

myDatabase
| where message has id
| project timestamp, message
Run Code Online (Sandbox Code Playgroud)

我预计输出将是已经过滤消息的行,并且数组中存在任何 id。所以我必须循环数组中的 id 并检查它是否存在于消息属性中

我怎样才能实现这个目标?真的很感谢任何帮助!

azure azure-application-insights kql azure-data-explorer

1
推荐指数
1
解决办法
6808
查看次数

使用 Javascript 中的 App Insights TrackEvent 将自定义复杂属性发送到遥测到 Azure 门户?

如何使用基本 Javascript(不是 NodeJS)中的 App Insights TrackEvent 将自定义复杂非字符串属性发送到遥测到 Azure 门户?

我通过以下设置片段初始化了 Application Insights JavaScript SDK:

<script type='text/javascript'>
        var appInsights=window.appInsights||function(config)
        {
            function r(config){ t[config] = function(){ var i = arguments; t.queue.push(function(){ t[config].apply(t, i)})} }
            var t = { config:config},u=document,e=window,o='script',s=u.createElement(o),i,f;for(s.src=config.url||'//az416426.vo.msecnd.net/scripts/a/ai.0.js',u.getElementsByTagName(o)[0].parentNode.appendChild(s),t.cookie=u.cookie,t.queue=[],i=['Event','Exception','Metric','PageView','Trace','Ajax'];i.length;)r('track'+i.pop());return r('setAuthenticatedUserContext'),r('clearAuthenticatedUserContext'),config.disableExceptionTracking||(i='onerror',r('_'+i),f=e[i],e[i]=function(config, r, u, e, o) { var s = f && f(config, r, u, e, o); return s !== !0 && t['_' + i](config, r, u, e, o),s}),t
        }({
            instrumentationKey: "@Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey"
        });
        window.appInsights=appInsights;
        appInsights.trackPageView();
    </script>
Run Code Online (Sandbox Code Playgroud)

我尝试了这里的示例https://github.com/microsoft/ApplicationInsights-JS和这里的https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics #properties但没有成功:

appInsights.trackEvent({
  name: …
Run Code Online (Sandbox Code Playgroud)

javascript azure azure-application-insights azure-log-analytics azure-analytics

1
推荐指数
1
解决办法
4709
查看次数

Azure App Insights 显示空间消耗指标

我收到警报,指出我的每日 1GB 限制应用洞察数据量已超出。如何确定哪些条目占用的空间最多?

下面的图表app insights -> Usage and estimated costs向我展示了一个摘要,但我无法向下钻取。

我找不到给我大小的日志/跟踪条目的任何属性。

  • 有没有?
  • “度量”类别中累积了哪些条目?
  • 我能以某种方式获得生成此图表的查询吗?

数据量趋势

azure azure-application-insights

1
推荐指数
1
解决办法
185
查看次数

Azure Monitor(Application Insights)日志查询图表 - Y 轴上有什么?

如何选择 Application Insights(Azure Monitor?)图表中 Y 轴显示的内容? 在此输入图像描述

我在 Application Insights 中有自定义事件,并且想要使用自定义指标构建时间序列图表。

但 Y 轴上显示的是 itemCount,而不是我的指标。如何选择Y轴的指标?

azure azure-monitoring azure-application-insights

1
推荐指数
1
解决办法
2275
查看次数

如何根据自定义图表中的azure仪表板中的选定时间段计算时间粒度

在编写 kusto 查询以在我的 azure 仪表板上创建自定义图表时,我希望能够根据用户在仪表板上选择的时间段来计算时间粒度。

例如:最后 4 小时 => 时间粒度 2 分钟,最后 24 小时 => 10 分钟

我尝试了以下方法来计算该期间,因为我们仍然无法访问它(据我在互联网上可以找到的)。

let timeGrain = traces
| summarize min_time = min(timestamp), max_time = max(timestamp)
| extend timeWindow = max_time - min_time   // days / hrs/ min / seconds
| project timeWindow
| extend timeGrain = case(timeWindow <= 4h, "2m", 
                       timeWindow <= 12h, "5m", 
                       timeWindow <= 24h, "10m",
                       "2h")
                       | project timeGrain;      
Run Code Online (Sandbox Code Playgroud)

该查询返回我想要实现的时间粒度,但我无法在其他查询中使用此变量。

traces
...
| summarize percentile(DurationInMs, 50) by bin(timestamp, timeGrain), CommandType
| render …
Run Code Online (Sandbox Code Playgroud)

azure azure-application-insights kql

1
推荐指数
1
解决办法
2644
查看次数

如何在 Azure Monitor 中跨 Log Analytics 和 Application Insights 进行查询

此答案总结了 App Insights (AI) 和 Log Analytics (LA) 正在合并为一项服务。它还提供了一个建议,即 AI 中的新资源可以指向 LA,以便您的所有代码都在一个地方。

我的问题是如何跨 LA 和 AI 资源进行查询,因为两者都存在,并且您没有时间或权限将 AI 更改为指向 LA。

使用 Azure 工作簿,我意识到我可以从 LA 或 AI 内部的多个资源进行查询,但我似乎无法在一个单元格中跨 LA 和 AI 进行查询(也无法在单元格之间保存结果。)

目前我能想到的解决这个问题的唯一方法是通过 API 查询或加入 PBI 报告,但这两种方法都是完成探索性查询的巨大开销。有没有更简单的方法,最好是同时留在 Kusto 查询中?

azure azure-application-insights azure-log-analytics azure-data-explorer

1
推荐指数
1
解决办法
1245
查看次数

应该使用哪个 API 来查询 Application Insights 跟踪日志?

我们的 ASP.NET Core 应用将跟踪消息记录到 App Insights。我们需要能够查询它们并通过一些自定义维度进行过滤。但是,我找到了 3 个 API,但不确定要使用哪一个:

  1. 应用洞察 REST API
  2. Azure 日志分析 REST API
  3. Azure 数据资源管理器 .NET SDK(预览版)

首先,我不明白这些选项之间的关系。我认为 App Insights 将其数据保存到 Log Analytics;但如果是这种情况,我希望只能通过 Log Analytics 进行查询。

无论如何,我只需要知道哪个最好用,我希望文档更清晰。我的直觉是使用 App Insights API,因为我们只需要来自 App Insights 的数据,而不需要来自其他来源的数据。

azure-monitoring azure-application-insights azure-log-analytics azure-data-explorer

1
推荐指数
1
解决办法
226
查看次数