none
Not able view Sample telemetry data in app Insights Live Metric stream RRS feed

  • Question

  • Hi 

    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.

    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();
    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);

    And my ApplicationInsights.xml is as below

    <?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>

    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 ?

    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



    Thursday, May 30, 2019 3:02 PM

All replies

  • Still Waiting for a reply.
    Friday, May 31, 2019 9:04 AM
  • Hello, Sidhartha.  Thank you for using Application Insights!

    The first thing I would do is look through the Java setup instructions, especially step 2 where it goes through the process of adding the Application Insights SDK for Java.  We've seen a couple instances where data is missing because the SDK is not up to date, and the error message you mentioned makes it seem like a good place to start:

    https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-get-started

    How should I update the SDK to the latest version?

    • If you are using Gradle or Maven...
      • Update your build file to specify the latest version or use Gradle/Maven's wildcard syntax to include the latest version automatically. Then, refresh your project's dependencies. The wildcard syntax can be seen in the examples above for Gradleor Maven.
    • If you are manually managing dependencies...

    There are also some additional Java specific troubleshooting steps you can look at here (I would go through the "No data" section):

    https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-troubleshoot

    Sunday, June 2, 2019 8:36 PM
    Moderator
  • Hi

    I have already below dependencies in pom.xml

    <dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>applicationinsights-logging-logback</artifactId>
    <version>[2.0,)</version>
    </dependency>
    <dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>applicationinsights-web</artifactId>
    <version>[2.0,)</version>
    </dependency>
    <dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>applicationinsights-core</artifactId>
    <version>[2.0,)</version>
    </dependency>

    And followed the steps mentioned in the link, but not able to view sampling data.

    Again why 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.

    -Sidhartha

    Monday, June 3, 2019 6:19 AM
  • Sidhartha,

     

    It looks like we will need to do some additional investigation to figure exactly what is going on here.  Please email the following to AzCommunity@microsoft.com and we'll get back to you promptly:

     

    • Your Subscription ID (this can be found by searching for "Subscriptions" in the portal)
    • A link to this thread so we can validate and expedite the request
    • A brief, 2-3 sentence summary of your issue
    • The person you were working with (kobulloc)

     

    That would look something like this:

     

    I was working with kobulloc on an Application Insights issue where I kept encountering an SDK error, even after updating my SDK.

     

    Forum Link:

    https://social.msdn.microsoft.com/Forums/en-US/93928694-9419-4404-b422-5ee067c5b8eb/not-able-view-sample-telemetry-data-in-app-insights-live-metric-stream?forum=ApplicationInsights

     

    Subscription ID:

    aaaaaa-bbbb-cccc-1111-222222222222

    Tuesday, June 4, 2019 12:48 AM
    Moderator