Navigation and service panel


Content

Sitecore Glimpse

By Tobias Studer on 11. August 2014, No comments

Glimpse is an amazing diagnostics platform for the web. Providing real time diagnostics & insights. Adam Conn did a great job extending the tool with some Sitecore information. He gave me the opportunity to extend it with an Sitecore MVC tab and create NuGet packages for Sitecore 6 and 7 for easier distribution.

Installation

The Sitecore-Glimpse extension is open source and available on GitHub. It can be installed through the public NuGet-Feed. Follow these steps to install it into your project:

  1. Install the Sitecore Glimpse NuGet package into your website project, depending on the version of Sitecore you are using.
  2. Ensure, that the Glimpse modules and handlers, which are added to the web.config during the Glimpse installation are configured before all Sitecore entries.

    <system.webServer>
      <handlers>
        <!-- Glimpse -->
        <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
        [...]
      </handlers>
    
      [...]
    
      <modules>
        <!-- Glimpse -->
        <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
        [...]
      </modules>
    </system.webServer>
    
    [...]
    
    <system.web>
      <httpHandlers>
        <!-- Glimpse -->
        <add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" />
        [...]
      </httpHandlers>
    
      [...]
    
      <httpModules>
        <!-- Glimpse -->
        <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" />
        [...]
      </httpModules>
    </system.web>
    
  3. The URI-Regex in the runtime policy will prevent Glimpse from running in the Sitecore client.

    <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
      <runtimePolicies>
        <uris>
          <add regex="/sitecore/.*" />
        </uris>
      </runtimePolicies>
    </glimpse>
    
  4. Open your browser and navigate to www.yourproject.com/glimpse.axd to turn Glimpse on or off Glimpse Admin Page

  5. Enjoy the magic of Glimpse Glimpse Tools

Configuration

You can use all the configuration posibilities which the Glimpse tool offers: http://getglimpse.com/Docs/Configuration

Use these to enable/disable different runtime policies or hide tabs, which are not interesting for your project.

Example

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
  <tabs>
    <ignoredTypes>
      <add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc5" />
      <add type="Sitecore.Glimpse.Tabs.SitecorePageTab, Sitecore.Glimpse" />
      <add type="Sitecore.Glimpse.Tabs.SitecoreAnalyticsTab, Sitecore.Glimpse" />
      <add type="Sitecore.Glimpse.Tabs.SitecoreProfilesTab, Sitecore.Glimpse" />
    </ignoredTypes>
  </tabs>
  <runtimePolicies>
    <ignoredTypes>
      <add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
    </ignoredTypes>
    <uris>
      <add regex="/sitecore/.*" />
    </uris>
  </runtimePolicies>
</glimpse>

Use the configuration helper on the Glimpse admin page (/glimpse.axd), which will show you the configuration changes based on the selected checkboxes. Glimpse Settings Glimpse Configuration Helper

Security Hardening

We don't want the Glimpse admin page to be accessible on the delivery systems on the production environment. This means, that we need to either only add those changes to the web.config for certain environments, or remove them appropriately. This step pretty much depends on your build system and how you deploy your application.

Credits

Many thanks to Adam Conn for the code base and the opportunity to contribute to the project. If you're experiencing any problems, feel free to create an issue directly on GitHub.

Categories  ASP.NET MVC  Tools Tags  glimpse  mvc  diagnostics

No comments

Add your comment

Your email address will not be published. Required fields are marked *

*