Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Monitoring your team services extension is an important DevOps practice. In this article we’ll demonstrate how to integrate Application Insights telemetry in your extension by using our new Telemetry Client for Team Services extension.
Prerequisite – You need an Azure subscription and an Application Insights resource.
Reference two npm modules dependencies inside your extension package.json.
Add an entry in your extension manifest to import the JavaScript SDK when we package of the extension.
The module files will be imported to the lib folder.
Reference the SDK in your extension HTML file.
Create a TelemetryClientSettings.ts configuration file in your src folder.
key | your Application Insights Instrumentation key | required |
extensioncontext | the name of the context of your extension, e.g the name of the extension | required |
disableTelemetry | true or false, default is false, to disable the telemetry tracking | optional |
disableAjaxTracking | true or false, default is false, to not track ajax dependencies | optional |
enableDebug | true or false, default is false, to enable debug mode of application insight | optional |
Add code to your extension to send telemetry data to Application Insights.
Here’s an example:
[1] Import modules of the TelemetryClient and the telemetry client settings configuration
[2] Call the getClient method to send telemetry data.
We need to import the code for the TelemetryClient and Settings class in our extension and construct a single file. See the How to create or upgrade your team services extension in 4 steps , step 2, for an overview of the minification process with webpack.
Here an example of the minified code of the extension once is packaged:
Notice the telemetryclient and telemetryClientSettings class at the end of the above code.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in