Application Insights: GETing a fix for Sitecore/Index

Per Osbeck
3 min readJun 12, 2019

--

Photo by Nick Hillier on Unsplash

This is a story all about Application Insights. But not how to set it up or how to use it. If that’s what your in to, I can recommend Bas’ blog.

So, Application Insights — your number 1 go to app for getting a better and deeper understanding of what you actually have built. If you’re not using it, get to it!
Now!

Are you back? So, now that you’ve been looking at your pretty graphs and hopefully have a better view of your application and its dependencies, you probably noticed that a certain page is getting a lot of hits;
the Sitecore/Index page is mighty popular!

Looking at the stats shows that all requests are grouped under this “page”. The reason behind is probably how Sitecores pipelines and wiring works.

This makes it fairly difficult to actually make use of the data when trying to find the real pages behind those 2.03 seconds.

But we can fix that!

Application Insights is very flexible and extensible so it’s easy to plugin your own code.

So you need to create a new TelemetryProcessor like this:

As you can see, the Name for both the operation and the request is set to Sitecore/Index so we simply parse out the http method and change the name to the AbsolutePath of the request instead. This better matches other, non Sitecore requests.

Edit: In the year of 2021 and Sitecore LayoutService the above snippet has been updated.

To get the processor to kick in, you just need to add it as Telemetry processor:

…and of course do the normal Sitecore plumbing.

When it’s up and running you should instead see something like the below.

That’s it. So get your insights in place and start analyzing how your app actually behaves. Without the numbers and insights, you’re pretty much in the dark.

Enjoy!

This post was sponsored by Consid — a global Sitecore partner.

--

--

Per Osbeck

i like computers, i like things that blink and i like to control them.