无法在应用程序Insights Live Metric流中查看示例遥测数据 [英] Not able view Sample telemetry data in app Insights Live Metric stream

查看:90
本文介绍了无法在应用程序Insights Live Metric流中查看示例遥测数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 

我无法在tomcat上运行的java Web应用程序的应用程序Insights Live Metric流中查看示例遥测日志。我可以在应用洞察中查看日志 - >搜索,但不是直播。

I am not able to view the view Sample telemetry logs in app Insights Live Metric stream for my java web application running on tomcat. I am able to view the logs in app insights -> Search, but not in live stream.

我在java应用程序中的位置。

Where is what i have done in my java application.

                TelemetryConfiguration.getActive()。getChannel()。setDeveloperMode(true);

String applicationInsightsKey = System.getenv(" APPINSIGHTS_INSTRUMENTATIONKEY" ); $
TelemetryConfiguration.getActive()。setInstrumentationKey(applicationInsightsKey);

telemetryClient = new TelemetryClient();

QuickPul​​se.INSTANCE.initialize();

Map< String,String> metaData = new HashMap< String,String>();

metaData.put(" class"," KeycloakSAMLServiceController") ;

metaData.put(" method"," constructor");

telemetryClient.trackTrace(" Payment Contructor initialized",SeverityLevel.Information,metaData);

                TelemetryConfiguration.getActive().getChannel().setDeveloperMode(true);
String applicationInsightsKey = System.getenv("APPINSIGHTS_INSTRUMENTATIONKEY");
TelemetryConfiguration.getActive().setInstrumentationKey(applicationInsightsKey);
telemetryClient = new TelemetryClient();
QuickPulse.INSTANCE.initialize();
Map<String, String> metaData = new HashMap<String, String>();
metaData.put("class", "KeycloakSAMLServiceController");
metaData.put("method", "constructor");
telemetryClient.trackTrace("Payment Contructor initialized", SeverityLevel.Information, metaData);

我的  ApplicationInsights.xml如下所示

And my ApplicationInsights.xml is as below

<?xml版本= QUOT; 1.0" encoding =" utf-8"?>

< ApplicationInsights

xmlns =" http://schemas.microsoft.com/ApplicationInsights/2013/Settings"

schemaVersion =" 2014-05-30" >




<! - HTTP请求组件(裸API不需要) - >

<遥测模块>

<添加¥b $ b type =" com.microsoft.applicationinsights。 web.extensibility.modules.WebRequestTrackingTelemetryModule" />

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.modules.WebSessionTrackingTelemetryModule" />

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.modules.WebUserTrackingTelemetryModule" />

< / TelemetryModules>



<! - 事件关联(裸API不需要) - >

<! - 这些初始值设定项为每个事件添加了上下文数据 - >
$


< TelemetryInitializers>

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.initializers.WebOperationIdTelemetryInitializer" />

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.initializers.WebOperationNameTelemetryInitializer" />

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.initializers.WebSessionTelemetryInitializer" />

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.initializers.WebUserTelemetryInitializer" />

<添加¥b $ b 类型= QUOT; com.microsoft.applicationinsights.web.extensibility.initializers.WebUserAgentTelemetryInitializer" />
$


< / TelemetryInitializers>



<! - < TelemetryProcessors>

  &NBSP; &NBSP; &NBSP; < BuiltInProcessors>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Processor type =" FixedRateSamplingTelemetryProcessor">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;将百分比设置为接近100 / N,其中N是整数。

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;例如。 50(= 100/2),33.33(= 100/3),25(= 100/4),20,1(= 100/100),0.1(= 100/1000)

  ; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Add name =" SamplingPercentage" value =" 50" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / Processor>

  &NBSP; &NBSP; &NBSP; < / BuiltInProcessors>

  &NBSP; < TelemetryProcessors /> - >
$


<频道

type =" com.microsoft.applicationinsights.channel.concrete.localforwarder.LocalForwarderTelemetryChannel">

< DeveloperMode> false< / DeveloperMode>

< EndpointAddress><! - put您的LocalForwarder实例的主机名:端口 

此处 - >

< / EndpointAddress>

<! - 以下属性为可选的。显示的值是每个属性的默认值 

- >

< FlushIntervalInSeconds> 5< / FlushIntervalInSeconds><! - 必须介于 

[1,500]。边界外的值将四舍五入到最接近的边界 - >

< MaxTelemetryBufferCapacity> 500< / MaxTelemetryBufferCapacity><! - 单位=数字 

遥测项目;必须介于[1,1000] - >

< / Channel>

< ; / ApplicationInsights>

<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights
xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings"
schemaVersion="2014-05-30">


<!-- HTTP request component (not required for bare API) -->
<TelemetryModules>
<Add
type="com.microsoft.applicationinsights.web.extensibility.modules.WebRequestTrackingTelemetryModule" />
<Add
type="com.microsoft.applicationinsights.web.extensibility.modules.WebSessionTrackingTelemetryModule" />
<Add
type="com.microsoft.applicationinsights.web.extensibility.modules.WebUserTrackingTelemetryModule" />
</TelemetryModules>

<!-- Events correlation (not required for bare API) -->
<!-- These initializers add context data to each event -->

<TelemetryInitializers>
<Add
type="com.microsoft.applicationinsights.web.extensibility.initializers.WebOperationIdTelemetryInitializer" />
<Add
type="com.microsoft.applicationinsights.web.extensibility.initializers.WebOperationNameTelemetryInitializer" />
<Add
type="com.microsoft.applicationinsights.web.extensibility.initializers.WebSessionTelemetryInitializer" />
<Add
type="com.microsoft.applicationinsights.web.extensibility.initializers.WebUserTelemetryInitializer" />
<Add
type="com.microsoft.applicationinsights.web.extensibility.initializers.WebUserAgentTelemetryInitializer" />

</TelemetryInitializers>

<!-- <TelemetryProcessors>
        <BuiltInProcessors>
            <Processor type = "FixedRateSamplingTelemetryProcessor">
                Set a percentage close to 100/N where N is an integer.
                E.g. 50 (=100/2), 33.33 (=100/3), 25 (=100/4), 20, 1 (=100/100), 0.1 (=100/1000)
                <Add name = "SamplingPercentage" value = "50" />
            </Processor>
        </BuiltInProcessors>
    <TelemetryProcessors/> -->

<Channel
type="com.microsoft.applicationinsights.channel.concrete.localforwarder.LocalForwarderTelemetryChannel">
<DeveloperMode>false</DeveloperMode>
<EndpointAddress><!-- put the hostname:port of your LocalForwarder instance 
here -->
</EndpointAddress>
<!-- The properties below are optional. The values shown are the defaults 
for each property -->
<FlushIntervalInSeconds>5</FlushIntervalInSeconds><!-- must be between 
[1, 500]. values outside the bound will be rounded to nearest bound -->
<MaxTelemetryBufferCapacity>500</MaxTelemetryBufferCapacity><!-- units=number 
of telemetry items; must be between [1, 1000] -->
</Channel>
</ApplicationInsights>

即使点击过滤器图标,它也会显示在下面的消息中。



请升级SDK

您可以流式传输任何Application Insights指标或事件,并使用自定义查询对其进行过滤。但是,您的应用必须使用Application Insights SDK 2.4.0或更高版本进行检测。了解更多。



我在配置中缺少任何内容吗?

Even when clicking on the filter icon it's showing below message.

Please upgrade SDK
You can stream any Application Insights metrics or events and filter them with custom queries. However, your app must be instrumented with Application Insights SDK version 2.4.0 or later. Learn more.

Am i missing anything in configuration ?

我在引用"应用程序洞察中的采样"中文档并查看asp.net的示例,但我正在使用Java。

I'm referencing the 'Sampling in Application Insights' in the documentation and see a example for asp.net, but I'm working with Java.

-Sidhartha

-Sidhartha







推荐答案

仍在等待回复。


这篇关于无法在应用程序Insights Live Metric流中查看示例遥测数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆