Application Insights: Frequently Asked Questions

Configuration problems

I'm having trouble setting up my:

I get no data from my server

Can I use Application Insights with ...?

Is it free?

Yes, for experimental use. In the basic pricing plan, your application can send a certain allowance of data each month free of charge. The free allowance is large enough to cover development, and publishing an app for a small number of users. You can set a cap to prevent more than a specified amount of data from being processed.

Larger volumes of telemetry are charged by the Gb. We provide some tips on how to limit your charges.

The Enterprise plan incurs a charge for each day that each web server node sends telemetry. It is suitable if you want to use Continuous Export on a large scale.

Read the pricing plan.

How much is it costing?

  • Open the Features + pricing page in an Application Insights resource. There's a chart of recent usage. You can set a data volume cap, if you want.
  • Open the Azure Billing blade to see your bills across all resources.

What does Application Insights modify in my project?

The details depend on the type of project. For a web application:

  • Adds these files to your project:

    • ApplicationInsights.config.
    • ai.js
  • Installs these NuGet packages:

    • Application Insights API - the core API
    • Application Insights API for Web Applications - used to send telemetry from the server
    • Application Insights API for JavaScript Applications - used to send telemetry from the client

      The packages include these assemblies:

    • Microsoft.ApplicationInsights
    • Microsoft.ApplicationInsights.Platform
  • Inserts items into:

    • Web.config
    • packages.config
  • (New projects only - if you add Application Insights to an existing project, you have to do this manually.) Inserts snippets into the client and server code to initialize them with the Application Insights resource ID. For example, in an MVC app, code is inserted into the master page Views/Shared/_Layout.cshtml

How do I upgrade from older SDK versions?

See the release notes for the SDK appropriate to your type of application.

How can I change which Azure resource my project sends data to?

In Solution Explorer, right-click ApplicationInsights.config and choose Update Application Insights. You can send the data to an existing or new resource in Azure. The update wizard changes the instrumentation key in ApplicationInsights.config, which determines where the server SDK sends your data. Unless you deselect "Update all," it will also change the key where it appears in your web pages.

What is Status Monitor?

A desktop app that you can use in your IIS web server to help configure Application Insights in web apps. It doesn't collect telemetry: you can stop it when you are not configuring an app.

Learn more.

What telemetry is collected by Application Insights?

From server web apps:

From client web pages:

From other sources, if you configure them:

Can I filter out or modify some telemetry?

Yes, in the server you can write:

  • Telemetry Processor to filter or add properties to selected telemetry items before they are sent from your app.
  • Telemetry Initializer to add properties to all items of telemetry.

Learn more for ASP.NET or Java.

How are City, Country and other geo location data calculated?

We look up the IP address (IPv4 or IPv6) of the web client using GeoLite2.

  • Browser telemetry: We collect the sender's IP address.
  • Server telemetry: The Application Insights module collects the client IP address. It is not collected if X-Forwarded-For is set.

You can configure the ClientIpHeaderTelemetryInitializer to take the IP address from a different header. In some systems, for example, it is moved by a proxy, load balancer, or CDN to X-Originating-IP. Learn more.

You can use Power BI to display your request telemetry on a map.

How long is data retained in the portal? Is it secure?

Take a look at Data Retention and Privacy.

Might personally identifiable information (PII) be sent in the telemetry?

This is possible if your code sends such data. It can also happen if variables in stack traces include PII. Your development team should conduct risk assessments to ensure that PII is properly handled. Learn more about data retention and privacy.

The last octet of the client web address is always set to 0 after ingestion by the portal.

My iKey is visible in my web page source.

  • This is common practice in monitoring solutions.
  • It can't be used to steal your data.
  • It could be used to skew your data or trigger alerts.
  • We have not heard that any customer has had such problems.

You could:

  • Use two separate iKeys (separate Application Insights resources), for client and server data. Or
  • Write a proxy that runs in your server, and have the web client send data through that proxy.

How do I see POST data in Diagnostic search?

We don't log POST data automatically, but you can use a TrackTrace call: put the data in the message parameter. This has a longer size limit than the limits on string properties, though you can't filter on it.

Should I use single or multiple Application Insights resources?

Use a single resource for all the components or roles in a single business system. Use separate resources for development, test, and release versions, and for independent applications.

How do I dynamically change the instrumentation key?

What are the User and Session counts?

  • The JavaScript SDK sets a user cookie on the web client, to identify returning users, and a session cookie to group activities.
  • If there is no client-side script, you can set cookies at the server.
  • If one real user uses your site in different browsers, or using in-private/incognito browsing, or different machines, then they will be counted more than once.
  • To identify a logged-in user across machines and browsers, add a call to setAuthenticatedUserContext().

Have I enabled everything in Application Insights?

What you should see How to get it Why you want it
Availability charts Web tests Know your web app is up
Server app perf: response times, ... Add Application Insights to your project or Install AI Status Monitor on server (or write your own code to track dependencies) Detect perf issues
Dependency telemetry Install AI Status Monitor on server Diagnose issues with databases or other external components
Get stack traces from exceptions Insert TrackException calls in your code (but some are reported automatically) Detect and diagnose exceptions
Search log traces Add a logging adapter Diagnose exceptions, perf issues
Client usage basics: page views, sessions, ... JavaScript initializer in web pages Usage analytics
Client custom metrics Tracking calls in web pages Enhance user experience
Server custom metrics Tracking calls in server Business intelligence

Why are the counts in Search and Metrics charts unequal?

Sampling reduces the number of telemetry items (requests, custom events, and so on) that are actually sent from your app to the portal. In Search, you see the number of items actually received. In metric charts that display a count of events, you see the number of original events that occurred.

Each item that is transmitted carries an itemCount property that shows how many original events that item represents. To observe sampling in operation, you can run this query in Analytics:

    requests | summarize original_events = sum(itemCount), transmitted_events = count()

Automation

Configuring Application Insights

You can write PowerShell scripts using Azure Resource Monitor to:

  • Create and update Application Insights resources.
  • Set the pricing plan.
  • Get the instrumentation key.
  • Add a metric alert.
  • Add an availability test.

You can't set up a Metric Explorer report or set up continuous export.

Querying the telemetry

Use the REST API to run Analytics queries.

How can I set an alert on an event?

Azure alerts are only on metrics. Create a custom metric that crosses a value threshold whenever your event occurs. Then set an alert on the metric. Note that: you'll get a notification whenever the metric crosses the threshold in either direction; you won't get a notification until the first crossing, no matter whether the initial value is high or low; there is always a latency of a few minutes.

Are there data transfer charges between an Azure web app and Application Insights?

  • If your Azure web app is hosted in a data center where there is an Application Insights collection endpoint, there is no charge.
  • If there is no collection endpoint in your host data center, then your app's telemetry will incur Azure outgoing charges.

This doesn't depend on where your Application Insights resource is hosted. It just depends on the distribution of our endpoints.

Can I send telemetry to the Application Insights portal?

We recommend you use our SDKs and use the SDK API (app-insights-api-custom-events-metrics.md). There are variants of the SDK for various platforms. These SDKs handle buffering, compression, throttling, retries, and so on. However, the ingestion schema and endpoint protocol are public.

Can I monitor an intranet web server?

Here are two methods:

Firewall door

Allow your web server to send telemetry to our endpoints https://dc.services.visualstudio.com:443 and https://rt.services.visualstudio.com:443.

Proxy

Route traffic from your server to a gateway on your intranet, by setting this in ApplicationInsights.config:

<TelemetryChannel>
    <EndpointAddress>your gateway endpoint</EndpointAddress>
</TelemetryChannel>

Your gateway should route the traffic to https://dc.services.visualstudio.com:443/v2/track

Can I run Availability web tests on an intranet server?

Our web tests run on points of presence that are distributed around the globe. There are two solutions:

  • Firewall door - Allow requests to your server from the long and changeable list of web test agents.
  • Write your own code to send periodic requests to your server from inside your intranet. You could run Visual Studio web tests for this purpose. The tester could send the results to Application Insights using the TrackAvailability() API.

More answers