Microsoft Application Insights SDK for JavaScript
MIT License
Bot releases are visible (Hide)
Published by MSNev over 4 years ago
Published by MSNev over 4 years ago
Published by MSNev over 4 years ago
Published by MSNev over 4 years ago
Published by MSNev over 4 years ago
Adds additional performance data derived from the window.performance.getEntries() for the fetch or XHR request.
Configuration options
Name | Default | Description |
---|---|---|
enableAjaxPerfTracking | false | Default false. Flag to enable looking up and including additional browser window.performance timings in the reported ajax (XHR and fetch) reported metrics. |
maxAjaxPerfLookupAttempts | 3 | Defaults to 3. The maximum number of times to look for the window.performance timings (if available), this is required as not all browsers populate the window.performance before reporting the end of the XHR request and for fetch requests this is added after its complete. |
ajaxPerfLookupDelay | 25 | Defaults to 25ms. The amount of time to wait before re-attempting to find the windows.performance timings for an ajax request, time is in milliseconds and is passed directly to setTimeout(). |
This has been enabled by default in the updated version.
It can be disabled by adding the disableExceptionCollection
config value with a value of true.
Published by MSNev over 4 years ago
Published by MSNev over 4 years ago
Published by MSNev over 4 years ago
An additional conversion was required for ES3 support as TypeScript was adding a getter for embedding a constant enum into the Common class.
Published by MSNev over 4 years ago
With this release the source files can be loaded in an ES3 environment (IE7/8) and send requests to the server. As part of this change you will now receive requests from users using an older browser, prior to this version users using an ES3 base browser will (most likely) have been getting a javascript error, which would have caused no data to be sent.
We have added upport to enable reusing the same plugin in different instances of AppInsights, owned by the same application (but using different Instrumentation keys) is required so that they can reuse a single Plugin instance for all instances.
This changes introduces a new IProcessTelemetryContext
interface that is passed to the processTelemetry() method so that the plugins can use the current request context for the event rather than the context during initialization.
To assist with creating plugins we have also introduced a base class that you can use for creating new plugins BaseTelemetryPlugin, details are included on the Readme
Published by markwolff almost 5 years ago
Published by markwolff about 5 years ago
2.2.4
...2.3.0
Published by xiao-lix about 5 years ago
#1054 Fix issue with AppInsightsCore refactor
Published by xiao-lix about 5 years ago
#1051 Add to call track trace on user init sending browser info to the end point when loggingLevelTelemetry config is on
#1050 Address issue https://github.com/MicrosoftDocs/azure-docs/issues/39011
#1049 Fix issue with PageViewPerformance event being sent with undefined name property
#1041 Add tslint error screening
#1038 Re-organize repo folders
#1035 Update to use PerformanceNavigationInterface for supported browsers
Published by markwolff about 5 years ago
#1030 Fix issue with appId correlation being appended with an incorrect format
Published by xiao-lix about 5 years ago
#1015 Update to use beaconSender for page unload when browser supports Beacon API
#1028 Fix issue where window.location is not defined
#1021 Fix issue with not parsing correlationContext
#1020 Disable by default logging to console internal SDK errors. Enable by default logging as telemetry for internal SDK errors
Published by markwolff about 5 years ago
enableAutoRouteTracking
enableAutoRouteTracking
Published by markwolff about 5 years ago
Patch release containing fixes to automatic Single Page Application route change tracking via enableAutoRouteTracking
#970 - Fixes #967 #969
Published by markwolff over 5 years ago
*You do not need to upgrade for drag and drop to work. It will work on all previous and future versions of the javascript (and Node.js) SDK
https://i.imgur.com/Efue9nU.gif
You can now drag and drop your source maps onto your Exception Telemetry in the Azure Portal to unminify your callstack. Please open an issue or use the Feedback button in the Portal if a source map you've uploaded is not working as intended. This is a first iteration and in a future update, your source maps will be automatically unminified.
You can set enableAutoRouteTracking: true
to enable state based route tracking for your Single Page Application (React, Angular, Vue, etc). You do not need to install a separate plugin to use this configuration option.
This setting will cause a new Page View telemetry item to be sent each time your app's route changes (including Hash route changes).
samplingPercentage
functionalityPublished by markwolff over 5 years ago
This update has a couple of non-breaking API changes. Namely, trackException
is now consistent with the Node.js SDK. The only change here is the named argument is renamed from error
to exception
. A shim is in place so any existing usages of trackException
will still work, and the old field is marked as optional, so any type-checked files will still "compile". There are no breaking changes with this change, but you are encouraged to use exception
as your named argument field as error will be deprecated in a future major version.
appInsights.trackException({ error: new Error() });
appInsights.trackException({ exception: new Error() });
Second, the ability to only send correlation headers to specific, whitelisted domains is now available as a configuration option , correlationHeaderDomains
. It accepts an array
of domain strings
. Wildcards ("*") are okay. By populating this array, all other domains which your application makes requests to will not have correlation headers included. This setting makes it easy to avoid OPTIONS requests to services outside of your control.
You can use the inclusion list and the exclusion list in conjunction with each other to add correlation headers to a particular domain, example.com
, and at the same time exclude headers from a prefixed version of it, no-headers.example.com
.
Performing custom tag overrides is now more consistent with all of the other Application Insights SDKs, in that it is modified via a simple key-value dictionary. There are no breaking changes with this update, and if you are setting any tags via the old way, they will still work as they do now. You are encouraged to update them since the old way will be deprecated in a future major version release.
var telemetryInitializer = (item) => {
item.tags.push({ "ai.cloud.role": "My Web App" });
};
appInsights.addTelemetryInitializer(telemetryInitializer);
var telemetryInitializer = (item) => {
item.tags["ai.cloud.role"] = "My Web App";
};
appInsights.addTelemetryInitializer(telemetryInitializer);
#869 - config: add ability to whitelist specific domains for adding correlation headers
#893 - docs: fix sample configuration settings
#899 - common: replace Array.some with Array.forEach to simplify polyfill story, add tests
#902 - snippet: add missing methods to lazy loaders
#903 - tags can now be set with same API as other AI SDKs
#904 - rename IExceptionTelemetry.error --> IExceptionTelemetry.exception
#905 - react: fix plugin causing jest tests to fail
#907 - docs: add mention of how to update current context's operation
#908 - react: remove analytics package dependency
#910 - docs: update context refresh information
#913 - Remove code from adding libVer from extensions
#918 - automatically add ai.operation.name
tag, add id
to pageview telemetry
#919 - fix issue with namePrefix
not affecting send buffers