Configuring Glimpse diagnostic tool

Glimpse is a free, open source diagnostic tool that can save you a lot time when it comes to troubleshooting and diagnosing issues in your application. Over the years more and more developers have contributed to glimpse making this a must have tool for daily .NET development.

Glimpse works by inspecting web requests as they come through the request pipeline. Each request is visually broken down into various information tabs, which in turn allows you to dive deeper to diagnose an issue. Each tab contains data specific to various server side concerns.

 

Installation :

The official site has very good notes on how to install so I won’t bore you with those details.

Features

The Glimpse.AspNet package adds these tabs to Glimpse, which can be used for diagnosing problems common to ASP.NET based frameworks:

Tabs

  • Configuration – The Configuration tab displays web.config entries that could be helpful when debugging.
  • Environment – The Environment tab displays information about the server that responded to the selected HTTP request.
  • Request – The Request tab shows basic HTTP request information as the server received it
  • Routes – The Routes tab shows the routes of the web application, along with default values and constraints
  • Server – The Server tab shows all web server variables available for the request.
  • Session – The Session tab shows the data that is associated with the current requestor’s session store

Here are some of the awesome features glimpse comes with :

  • Visual Profiling – Glimpse profiles key server side activities and displays the timing of each in an easy to understand Gantt chart.
  • Transparent Data Access – Out of process database calls are expensive. Glimpse lists each of them, so excessive or under-performant queries can be reigned in.
  • Server Configuration – Know everything necessary about a request’s origin server including: timezone, patch version, process ID and pertinent web.configentries.

Configuration Tips

NOTE : These changes are all made in your web.config file

After installation Glimpse will make several changes to you your web.config file you should be aware of.

<configuration>
  <configSections>
  
  <section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" /></configSections>

<!-- For IIS 7 & greater -->
  <system.webServer>
    <!-- The Glimpse.ASP.Net Module will run on every request made to the application-->
      <modules>
            <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
    </modules>

    <handlers>
      <!-- The Glimpse.axd handler is used to turn Glimpse on and off-->
      <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
    </handlers>
  </system.webServer>
  <!-- This is where you put custom configuration -->
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    </glimpse>
  </configuration>
  • How to configure tabs

You can disable Glimpse tabs by instructing Glimpse to ignore their types:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <tabs>
        <ignoredTypes>
            <add type="{Namespace.Type, AssemblyName}"/>
        </ignoredTypes>
    </tabs>
</glimpse>
  • How to Configure runtime policy

Policies control what Glimpse is allowed to do to any given request. Policies can be disabled and customized to simplify some scenarios. For example, to run Glimpse on a remote server (like a server in Windows Azure), disable theLocalPolicy:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd" >
    <runtimePolicies>
        <ignoredTypes>
            <add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
        </ignoredTypes>
    </runtimePolicies>
</glimpse>

Glimpse will never be allowed more permissions than the defaultRuntimePolicy allows. On and Off are the simplest configuration values.