Application Insights Telemetry in Glimpse

The following is a guest post from Beckylin Orooji, detailing a cool community built Glimpse plugin that exposes Application Insight’s telemetry. You can find out more about it on Beckylin’s post on the Azure Blog.

Glimpse is a great tool for profiling and debugging your web applications during development.  Application Insights is a tool for diagnosing issues and monitoring performance in live production. Because developers need both a great tool during development and a great tool in production, an integration of these products was created.

What is Application Insights?

Application Insights monitors your web application in production for performance, availability, and usage. It helps you understand what your users do with your app, diagnose failed requests and exceptions, and find performance issues in browser, web server or backend services.

What does the integration provide?

Application Insights items are now accessible alongside the other data collected by Glimpse. One place where Application Insights data is shown is in the Glimpse timeline tab. Application Insights automatically collects client and server-side telemetry about requests, outbound calls to dependencies such as http calls, as well as business metrics.

In Glimpse’s Trace tab, log traces and exception reports collected by Application Insights are shown.

The new Application Insights tab shows all the Application Insights telemetry from the client and server that you will be gathering after your application is deployed to production. Looking at the Application Insights tab, you can see exactly what data will be collected for specific pages as you browse through your application. Doing this during development enables you to ensure you have implemented your telemetry collection in the way you intended. After you release your application, this telemetry will be your source of business and diagnostic insights.

Try it now

See this integration in action and try it on your own application by installing one of our two NuGet packages.

Installing the Glimpse Application Insights Web package will turn on Application Insights for your application and enable a basic set of Glimpse packages. This package includes dependencies to other packages you will need for web applications making this a simple solution for everyone. If you have not onboarded to Application Insights, you should use this package. Glimpse Application Insights Web will support .NET web applications without any additional work from you.

Note: If you already onboarded Application Insights and Glimpse, you can consider using the Glimpse Application Insights NuGet package. If you want additional features, you can manually install the ADO.NET, ASP.NET and EnityFramework, or any other extension.

Installing Glimpse v2 Beta1

Yesterday we launched Glimpse v2 Beta1 for ASP.NET 5 and we couldn’t be prouder of this achievement. Over the course of the coming weeks and months we will be sharing lots of tips and tricks on how to use and optimize all the new features of v2. Today, however, we thought we’d start with the absolute basics – how to install it.

Here is Scott Hanselman talking about Glimpse v2 at the ASP.NET 5 RC1 launch at //Connect();.

Here is Scott Hanselman talking about Glimpse v2 at the ASP.NET 5 RC1 launch at //Connect();.

Installing v2 couldn’t be easier. You just need to add the “Glimpse” package to your web project and then add Glimpse to your Startup.cs. This post contains a detailed walkthrough of these steps, just in case you aren’t all that familiar with ASP.NET 5 yet.

NOTE: This release of Glimpse v2 targets ASP.NET 5 RC1 (either Core or full CLR). In the a future release Glimpse v2 will extend support for earlier versions of .NET.

Adding Glimpse Package

Adding the Glimpse package to your web project is quite simple. It can be done either by the new “NuGet” dialog window or directly by updating your project.json. See details on both options below.

“Manage NuGet Packages” Option
If you go down the dialog route, simply right click on your target web project and select “Manage NuGet Packages…”.
Screen Shot 2015-11-19 at 6.41.44 AM
Once the dialog opens, make sure you select the “Include Prerelease” checkbox, and then search for “Glimpse”. Then select the package named “Glimpse” and “Install” it into your project.
Screen Shot 2015-11-19 at 6.42.55 AM

Directly to your project.json Option
It is just as easy to add glimpse via the project.json directly. To do this simply add glimpse to the root dependencies section of your project.json and add "Glimpse": "2.0.0-beta1".
Screen Shot 2015-11-19 at 7.06.34 AM

Updating your Startup.cs

Once the package is referenced in your project, you need to update your Startup.cs so that Glimpse is hooked into your application. Specifically, services.AddGlimpse(); needs to be added to your ConfigureServices(...) method (to register our services with the ServiceCollection) and app.UseGlimpse(); to your Configure(...) method.
Screen Shot 2015-11-19 at 8.29.11 AM

Run your site

Once the above steps are complete, Glimpse will be turned on by default for any request you make from “localhost” moving forwards. This “localhost” restriction can be lifted and other restrictions added in its place or in addition. Look for more details on these configuration and extensions options coming soon.

Screen Shot 2015-11-19 at 8.36.05 AM

If you would like a sample application that already has Glimpse configured and running, feel free to download the Glimpse source and try out the various sample projects.

Glimpse v2 Beta1 Released!

This morning at the Connect(); event in New York city, Scott Hanselman announced some exciting news: Glimpse v2 Beta1 is now available!

Glimpse v2 is a major evolution of the platform. We’re extremely proud of what we’ve accomplished thus far, and we think you’ll like what you see. You’ll find lots of new bells and whistles that make Glimpse better than it ever has been, but I’d like to outline four key improvements to the Glimpse v2 experience.

Curated UI

Glimpse has always been about getting the diagnostics you need, when and where you need them. However, one of the most overwhelming pieces of feedback we have received over the years is that beyond the Heads-Up-Display, those diagnostics were not necessarily well presented and were sometimes difficult to parse.

In v2 we’ve strived to solve these issues by curating disparate data points from across multiple tabs and pulling them together into one cohesive story. We’ve also allowed diagnostics to become the real star, freeing them from the cramped space you’re used to seeing them in, and giving them the full window treatment they deserve; which coincidently makes switching between requests much easier than it was in v1. Take a look for yourself:

Cross Platform

Glimpse v2 is built completely upon ASP.NET 5 API’s, concepts and the CoreCLR. This means that Glimpse v2 automatically inherits all of the benefits of ASP.NET 5, including its ability to run cross platform on Windows, Linux and OSX.

Now everywhere you can run your site, you’ll be able to use Glimpse v2 to debug and diagnose it as well.

Full Stack

Since its inception, Glimpse has been known as “F12 tools for your server”. But as you’ll no doubt know, web development doesn’t happen only on the server.

With this in mind, Glimpse v2 has begun to leverage new browser diagnostic API’s to tell a more complete, full stack story. You’ll now be able to glean insight into some of the processing happening in the browser, right in the context of your server side diagnostics, for many request.

architecture

Production Ready

Glimpse really shines during development time. Its ease of installation and use is what’s made Glimpse v1 a favorite among web developers for years. Unfortunately, in many situations Glimpse did not work well once your application was pushed to production.

In Glimpse v2, this all changes. A much larger class of applications will now be able to use Glimpse in production environments to debug and diagnose problems in real time.

In the coming weeks we’ll devote more of this blog to covering the ins and outs of these four key features, as well as other changes, and cover exactly what they mean for you.

βeta Beware

Of course, it wouldn’t be responsible for me to cover all of the greatness that is Glimpse v2 without also reviewing its current limitations and known issues.

First of all, what we’re releasing today is an early beta build meant for gathering feedback from users and extension authors. It may have a few rough edges, the user interface is a work in progress and it certainly isn’t feature complete. Look for more stable builds, improved UX and the re-introduction of beloved features such as Timeline and the Trace tab in the future.

It’s also worth noting that Glimpse v2 Beta1 only runs on ASP.NET 5. While using the latest and greatest does have its own perks, for existing applications you’ll need to stick with Glimpse v1. That also means that Glimpse v1 extensions are incompatible with Glimpse v2. In the future we’re going to bridge this gap so that everyone, including .NET 4.5 and .NET 4.0 users will be able to benefit from the new features of Glimpse v2.

Next Steps

Over the next several weeks, keep an eye on this blog and our GitHub repository where we’ll continue to improve Glimpse v2, support and update along with ASP.NET 5 and march towards a full, final 2.0 release.

In the mean time, install Beta1 and give it a try.

We really hope that you enjoy this release and are excited about the direction Glimpse is going, but more than anything else, we’re excited to hear your feedback.

Glimpse and Microsoft join forces

It is my pleasure to announce that moving forward the sponsorship of Glimpse is being taken over by Microsoft. More details around the the particulars will be coming out soon, but for the here and now there are fairly comprehensive writeup’s on the Visual Studio and Asp.Net blog’s, as well as our own blog’s (Anthony van der Hoorn and Nik Molnar).

Microsoft

For the last 3 years Glimpse has been lucky enough to be sponsored by Red Gate. This relationship has been amazing and has made it possible for us to get to where we are today. That said, moving forward and for where we want to take the project (deeper integration into Asp.Net, as well as going cross platform and working on other web stacks), Microsoft is a really great fit.

Looking forward to bring you more details, as well as making Glimpse even more awesome.

Version 1.9.2 for Asp.Net Released

As these things go, we’re still hard at work on getting the various bits in place so we get get Glimpse v2 into your hands as soon as possible. In the mean time, this release has got a few fixes that have come in from the community since our last release. It focuses on a couple of small Asp.Net features/fixes and a fix to an annoying bug that effected some EF users.

This release sees updates to following packages:

  • Glimpse.AspNet – Featherweight release 1.9.2
    • Added support for AspNetSynchronizationContext
    • Added support for Build Mode detection of assemblies in Environment tab
  • Glimpse.EF* – Featherweight release 1.6.5
    • Fix bug lead to cast exceptions on GlimpseDbConnection by loosen GetDbProviderManifestToken behavior

Special Thanks
In terms of pull requests, I have to say a big thanks to:

  • jasonkenneth
    • #836 Loosen GetDbProviderManifestToken behavior
  • Lohith
    • #823 Implement Build Mode detection of assemblies in Environment tab

Well, as usual, I think that is a wrap. For a full list of changes, issues and commits see below:

Thanks to everyone involved and enjoy the release!

We need your help! Glimpse vNext is coming…

We are currently in the process of developing the next version of Glimpse and are looking at what the design and user experience is going to evolve into. To do the best job that we can, we want to talk to all of you and see what you need, how you are using Glimpse and what you would like to see that would make Glimpse even more awesome.

If you would like to help out by giving us some feedback, we would love to talk to you. Simply email us and tell us a bit about how you are currently using Glimpse and we will get back to you as soon as possible.

Thanks for your continued help and support!

Version 1.7.3 for ADO Released

This release it a fairly minor one to fix a rather painful bug that went out in EF 6.1.1. This error revolved around a NullReferenceException that would be generated when users upgraded to EF 6.1.1.

With help from the guys on the EF team, we narrowed down the issue:

Basically in ClonedObjectContext, EF first disposes of the Glimpse connection, and then EF disposes of EntityConnection (which then tries to unsubscribe from the state change event). Fix is to simply change the order of those calls in EF.

Unfortunately with EF 6.1.1 being in the wild now, it was important that Glimpse could work around this issue. Hence, additional checks where added to Glimpse.ADO in this release to work around this issue.

This release sees updates to following packages:

  • Glimpse.ADO – Featherweight release 1.7.3
    • Conduct an additional null check around the StateChange event (fixes bug in EF 6.1.1)
  • Glimpse.EF* – Featherweight release 1.6.4
    • Update to work around bug in EF 6.1.1

And for the great issue reports, I want to thank:

Also I would like to say a very big thanks to the EF team, specifically:

  • Maurycy Markowski
  • Arthur Vickers & Lawrence Jones
  • Rowan Miller

Well, as usual, I think that is a wrap. For a full list of changes, issues and commits see below:

Glimpse 1.8.6 released

Its that time again and we have another release ready to go. This one is mainly another patch/bug release, but it also a couple of nice things come to the table.

Glimpse Launcher
One of the biggest things to note is the addition of a new button to the `~/glimpse.axd` page. This button is designed to be a temporary fix to help those who have sites that contain only services. Currently its difficult for these users to launch Glimpse. In most cases it requires adding a dummy page to the site, so that Glimpse can be launched from that point. This new button allows the user to launches the client in fullscreen mode. From there, the history tab can be used to track requests.

Launch Glimpse in FullScreen Mode

Launch Glimpse in FullScreen Mode

Note, there is currently a limitation on this feature which means the client will only launch if Glimpse has already detected at least one request. If this limitation causes you any issues please let us know. Additionally, v2 of Glimpse will bring to the table first class support for services.

This release sees updates to following packages:

  • Glimpse.Core – Featherweight release 1.8.6
    • Add button which makes it easy to launch glimpse for service only sites
    • Improve how client renders for those using Zurb Foundation
  • Glimpse.AspNet – Featherweight release 1.9.1
    • Fix issue for ajax requests that are using “Bufferless input streams”
    • Show non-MvcRoute route types in route tab
  • Glimpse.WebForms – Featherweight release 1.1.1
    • Fix issue to make Glimpse checks if it is enabled in DataBoundControlAdapter
  • Glimpse.Ado – Featherweight release 1.7.2
    • Ensure ADO inspector does quotes `AnsiString` parameters in query output
    • Ensure that all parameters in `CreateDbCommandDefinition` are forwarded through
    • Prevent command sanitizer from replacing partial matches of parameters

In terms of pull requests, I have to say a big thanks to:

  • Kristian Hellang
    • #802 – Prevent command sanitizer from replacing partial matches of parameters
  • Thomas Zitzler
    • #806 – Fix issue for ajax requests that are using “Bufferless input streams”
    • #803 – Ensure that all parameters in `CreateDbCommandDefinition` are forwarded
  • grahammendick
    • #789 – Fix issue to make Glimpse checks if it is enabled in DataBoundControlAdapter
  • Boris S
    • #783 – Fix issue to make Glimpse checks if it is enabled in DataBoundControlAdapter

And for the great issue reports, I want to thank:

Well I think that is a wrap. For a full list of changes, issues and commits see below:

Glimpse 1.8.5 released

Its that time again and we have another release ready to go. This one is mainly another patch/bug release, but it also sees support for Attribute routes come to the table.

In addition, there has been a fairly sizeable fix released for Entity Framework which affected people trying to use Glimpse.EF6 with EF 6.1.0 – 6.2.0-beta. This has taken a little to track down, and I would like to thank everyone involved in sorting this out and coming up with the fix (especially the guys on the EF team… HUGE thanks guys!!!).

This release sees updates to following packages:

  • Glimpse.Core – Featherweight release 1.8.5
    • Fix where Clients that have a name with quotes in it blows up
  • Glimpse.AspNet – Bantamweight release 1.9.0
    • Added support for attribute routes
  • Glimpse.Ado – Welterweight release 1.7.1
    • Significant performance improvement when calling stored procedure with binary data param
  • Glimpse.Ef* – Welterweight release 1.6.2
    • Fixed possible NullReferenceException in Glimpse that was surfaced with EF 6.0.2
    • Introduced workaround for bug that was introduced in EF 6.1.0 – 6.2.0-beta

In terms of pull requests, I have to say a big thanks to:

And for the great issue reports, I want to thank:

Well I think that is a wrap. For a full list of changes, issues and commits see below:

Glimpse 1.8.4 released

Another month has gone by since our last release and this time round its a smallish one. Mostly bug fixes and a couple of usefully additions, but most of our time lately has been focused on v2.

By way of a small update on v2, we have almost finished the work we want to do on the backend and starting to look at the UI of v2. If you are interested in seeing exactly where things are at or seeing where you can get involved, feel free to take a look.

Getting back to the release, here is what we have this time around:
Release Notes

  • Glimpse.Core – Featherweight release 1.8.4
    • Fix up edge case where UI would not be resizable
    • Extending the ContentTypeElement to include optional RuntimePolicy
  • Glimpse.ASP.NET – Bantamweight release 1.8.1
    • Update to RouteInspector to ignore non AspNet routes doesn’t work for WebHosted WebAPIs
  • Glimpse.EF* – Bantamweight release 1.6.1
    • Fixed bug when using DbGeography type in some edge cases

Special Thanks
In terms of pull requests, I have to say a big thanks to:

  • Paul Atkins
    • #736 The update to RouteInspector to ignore non AspNet routes doesn’t work for WebHosted WebAPIs
  • Björn Holdt
    • #746 Migrate Build to use Automatic Package Restore
  • James Chambers
    • Update to contributing documentation

And for the great issue reports, I want to thank:

Release Details
Well I think that is a wrap. For a full list of changes, issues and commits see below:

Thanks to everyone involved and enjoy the release!