Git Product home page Git Product logo

applicationinsights-vscode's Introduction

Azure Application Insights

Azure Application Insights is a service that can help your team gain insights into the usage, reliability and performance of your live Node.js Express applications.

Learn about Azure Application Insights

The Application Insights extension for Visual Studio Code brings information from your production services right into your code editor to help you find and fix issues faster.

Features

Request data in CodeLens

Three request metrics are available in CodeLens in Visual Studio Code. Each shows data from the last 24 hours as measured by the Application Insights resource you set up with Visual Studio Code:

  • Total Requests - Number of requests made to this route
  • Failed Request - Number of failed requests to this route
  • Average Response Times - Average response time for requests made to this route.

Example of request CodeLens functionality

Easy Onboarding

Enable Application Insights telemetry collection in your Express app with a simple command in Visual Studio Code.

Example of onboarding

Getting started with Express and Application Insights

Create an Express app

Get started by installing the Express generator, creating a new app, and opening it in Visual Studio Code:

$ npm install express-generator -g
$ express mywebapp
$ cd mywebbapp && npm install
$ code .

Learn about using the Express generator.

Onboard with Application Insights

Run the 'Add to Project' command to register your app with Application Insights.

Ctrl/Command + Shift + P -> "Application Insights: Add to Project"

This command guides you through creating (or selecting) an Azure resource for your telemetry. It also adds the required packages/code to start collecting telemetry data and showing it in CodeLens. Run your app or deploy it to start seeing telemetry in Visual Studio Code and the Azure Portal.

Application Insights resources are free for the first gigabyte of data per month. See Application Insights Pricing for more details.

Example of onboarding

See CodeLens on request definitions

Example of request CodeLens functionality

Click on the CodeLens indicator to see more details.

See CodeLens data from a different Application Insights Resource

If you want CodeLens to show data from a different resource than the one you onboarded from, then run the 'Choose CodeLens resource' command. This is a common scenario when you have different resources for your development and production environment.

Ctrl/Command + Shift + P -> "Application Insights: Choose CodeLens resource"

How to select a resource

Release Notes

Version 0.3.1

  • Switched to using esprima-fb in order to support es7 syntax.
  • Telemetry improvements.

Version 0.3.0

  • Added commnad to open azure portal.
  • Informational prompt to add Application Insights to a new project.

Version 0.2.0

  • Application Insights onboarding for Node.js Express apps.
  • Disable telemetry auto-collection.
  • Update third party notices file.
  • Add functionality to opt out of usage telemetry reporting.

Version 0.1.1

  • Bug fix to enable usage telemetry.

Version 0.1.0

  • Support CodeLens with request statistics for Node.js Express applications.

Feedback

  • In order to report bugs or provide general feedback please visit our repository's Issues page.

Privacy Statement

The Microsoft Online Services Privacy Statement describes the privacy statement of this software.

If you don’t wish to send usage data to Microsoft, add the environment variable AITOOLSVSCODE_DISABLETELEMETRY.

License

The extension is made available under the Microsoft Software License Terms. Please see the third-party notices file for additional copyright notices and license terms applicable to portions of the software.

applicationinsights-vscode's People

Contributors

acearun avatar avidhanju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

applicationinsights-vscode's Issues

Don't recognizes all routes

Hello,

Extension recognizes well some simple routes and shows Code Lens for it, but not other. In my case it recognizes only following:

router.get('/refund/:transactId/:amount/:currency', (req, res, next) => {

but none of with destructed params

// destruction
router.post('/', async ({ body: { email } }, res) => {
...
router.get('/logo/:flightOrAirlineCode', ({ params: { flightOrAirlineCode } }, res) => {

How to disable the 'Monitor your app with...' pop-up?

When doing a tutorial, or a series of tutorials, or even lots of little projects that do not require Application Insights, having this constantly bombard you with messages makes me want to remove the plug-in completely.

Can we disable this pop-up via options/ config somewhere?

image

Can't paste password into login screen [macOS]

Version: 1.44.2
Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd
Date: 2020-04-16T17:07:18.473Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

Plugin version 0.4.2

When I click "Add to Project" then select "Add an Account", I get a popup login view. I can't paste my randomly generated, 100char password into the login prompt, rendering this plugin effectively useless

Screen Shot 2020-04-22 at 12 22 13

Screen Shot 2020-04-22 at 12 23 08

Can we use setAuthenticatedUserContext(userID)?

Currently when using the extension, in my AI dashboard, I see all events as if they were coming from a single user's single session. I've googled around and it seems like the method in the issue title is the way to fix this, but it doesn't seem to be exposed. Is there an alternative, or could it be exposed, please?

esprima and es7 syntax

The release notes contain the following entry (for Version 0.3.1):

Switched to using esprima-fb in order to support es7 syntax

Esprima-fb is Facebook-fork of Esprima and Facebook has abandoned it. Please consider not using it.

The upstream Esprima has already baked in support for ES7 (officially known as ES2016). It will continue to support future ECMA-262 standards and it is actively maintained. For more information: http://esprima.org/.

'Sorry this project is not supported'

When I do a 'Application Insights: Add To Project', I get the error message 'Sorry this project is not supported'.

Steps:

  1. Creat an Application Insights resource on Azure.
  2. Locally do a 'dotnet new mvc'
  3. Install the Application Insights extension.
  4. 'Application Insights: Add To Project' results in the error message 'Sorry this project is not supported'.

VS Code version: 1.25.1
OS: Windows 10

ApplicationInsight's "Add To Project" inject javascript code in host.json file

I'm working on sample Azure Functions local project generated by Azure Functions VSCode extension. It generates host.json file for project's configuration. However, adding Application Insights to this project using extension will inject Javascript code into JSON file, making it invalid syntax

Original host.json

{
  "version": "2.0"
}

After enabling Application Insights

// Enable telemetry collection with Application Insights
var ai = require('applicationinsights');
ai.setup(process.env.APPLICATIONINSIGHTSKEY || '<APPLICATION INSIGHTS KEY HERE>').start();{
  "version": "2.0"
}

update extension to use VS Code's webview API

Got this notification when I clicked on a codelens:

'VisualStudioOnlineApplicationInsights.application-insights' uses the 'vscode.previewHtml' command which is deprecated and will be removed soon. Please file an issue against this extension to update to use VS Code's webview API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.